Smart contracts that enable native ETH sell orders on CoW Swap.
The ETH-flow contract has been deployed on all networks that are supported by CoW Swap (currently Ethereum mainnet, Gnosis Chain, Görli). There are two deployments of the ETH-flow contract for each network: one is used in the production environment and one is used in the barn (staging/testing) environment. The bytecode and parameters are the same for all contracts in the same network.
You can find deployment details by network id in broadcast/Deploy.sol/
.
We also release all current contract addresses together with our build artifacts. The addresses of the ETH-flow's latest deployments can be found here (production) and here (barn)
You can also retrieve the deployed contract for any tagged version. For example, for version v1.0.0 you can find the contract addresses for production here and for barn here.
This project uses Foundry for development and testing. Instructions on how to install this framework can be found here.
Other required NPM-based dev toolings can be installed using yarn.
yarn install
forge build
Build artifacts are automatically generated for every tagged version.
A version of the code at tag tag-name
with build artifacts included can ba found at tag tag-name-artifacts
.
Artifacts are stored in the folder artifacts
in the root directory.
The tag main-artifacts
is kept up to date with the latest working version of current main and provides up-to-date artifacts.
To manually generate the build artifacts, run:
forge build -o artifacts
The ETH flow contract has a dedicated deployment script. To simulate a deployment, run:
forge script script/Deploy.sol --rpc-url "$RPC_URL" -vvvv
You can find a list of supported RPC URLs in foundry.toml
under [rpc_endpoints]
.
To broadcast the deployment onchain you must also add the private key of the deployer and the broadcast flag: --private-key "$PK" --broadcast
.
You can verify a contract you deployed with the deployment script on the block explorer of the current chain with:
export ETHERSCAN_API_KEY=<your Etherscan API key> # Only needed if the default chain explorer is Etherscan
forge script script/Deploy.sol --rpc-url "$RPC_URL" -vvvv --verify
yarn fmt
forge test
Add an increased number of verbosity flags for debugging. For example:
forge test -vvv
For seeing line coverage results, run:
forge coverage