diff --git a/evm/forge-test/FastTransfer.t.sol b/evm/forge-test/FastTransfer.t.sol new file mode 100644 index 0000000..ecaa2a7 --- /dev/null +++ b/evm/forge-test/FastTransfer.t.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: Apache 2 + +pragma solidity ^0.8.0; + +import "../contracts/FastTransfer.sol"; +import "forge-std/Test.sol"; + +contract TestFastTransfer is FastTransfer, Test { + + function testWrapAndTransferETH() public { + // Goerli Testnet + wormhole = IWormhole(0x706abc4E45D419950511e474C7B9Ed348A4a716c); + portal = ITokenBridge(0xF890982f9310df57d00f659cf4fd87e65adEd8d7); + + // TODO: test + + } +} diff --git a/evm/foundry b/evm/foundry new file mode 100755 index 0000000..7757b11 --- /dev/null +++ b/evm/foundry @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# This script is a wrapper around the foundry Docker image. +# In an ideal world, we could just use anvil (and forge) directly, but there are regular +# upstream breaking changes in the nightly builds, and binaries of older +# versions are deleted frequently from their GitHub. The Docker releases are +# available for longer, so we just use those here. +# +# the DOCKER_ARGS environment variable can be used to pass additional args to docker. + +set -eo pipefail + +# This is a known-to-be-working build. +DOCKER_IMAGE="ghcr.io/foundry-rs/foundry:nightly-0d4468765c264d00ac961275fe176ce003d3e4ca@sha256:88fe2ea1005b9a3a7f8068645fef4cfb0fa7c16a5dd3b35582c70a1e36d16c25" + +args=$(printf '"%s" ' "$@") + +docker run --rm --platform=linux/amd64 -i $DOCKER_ARGS $DOCKER_IMAGE "$args" diff --git a/evm/package.json b/evm/package.json index e4f7a37..388c37c 100644 --- a/evm/package.json +++ b/evm/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "test": "npm run generate && tsc && jest --config jestconfig.json --verbose", + "test": "DOCKER_ARGS=\"-v $(pwd):/app\" ./foundry sh -c \"cd app && forge test\"", "genTypes": "typechain --target ethers-v5 --out-dir ethers-contracts/abi --show-stack-traces ./build/contracts/*.json", "generate": "rimraf lib && rimraf ethers-contracts && rimraf build && truffle compile && npm run genTypes", "build": "truffle compile",