🚨No warranty is provided on this utility. This utility only accepts terminal input of private keys for signing transactions. Use at your own risk.🚨
This command line tool provides the ability for a Safe to transact gaslessly with Cowswap 🐮, and includes the following features:
- Token lists for Ethereum mainnet, Gnosis Chain, and Goerli.
- Custom tokens with meta data looked up directly on-chain.
- Signature collection for threshold number of Safe owners (via direct private key entry).
- Sending of ERC20 approval when there is insufficent allowance for the
GPv2VaultRelayer
contract. - Submission of the EIP-1271 signed order to the Cowswap API.
In order to use this tool, you must have rust
installed. Use rustup
to install rust
.
Once you have rust
installed, you will need to clone this repository:
git clone https://github.com/rndlabs/safe-cow.git
Now, to create an order, you, run:
cargo run -- --rpc-url <RPC_URL> --safe <SAFE_ADDRESS> create-order
It is important that the RPC_URL
that is specified be for either Ethereum Mainnet, Gnosis Chain, or Goerli, as these are the only chains that Cowswap currently supports. At this point, follow the on-screen prompts in order to submit a swap.
WARNING: Orders that are submitted as limit orders. Orders by default have a 20 min timeout. No quotes are provided by the Cowswap API, and users are required to enter the token swap values manually.
Here's an example of the above:
You may review the results of the above example swap on:
Note that the order cross the orderbook significantly, however due to the solver competition, the surplus is preserved and received by the trader. This should be the case, and should be enforced by the solver competition parameters. However, the surplus may be subject to adverse market forces during times of high volatility. users should set pricing spreads tightly to avoid adverse slippage.
- Order cancellations (*EIP-1271 cancellations not currently supported by the Cowswap API).