This exercise is designed to test a programmer's understanding of the Solidity language, ability to research and integrate other protocols, and their understanding of both traditional finance and DeFi concepts such as arbitrage, decentralized exchanges, and automated market makers.
Modify the Arbitrager.sol contract to handle arbitraging a WETH/token pair between two exchanges that use Uniswap V2 contracts. The function needs to check that the call was profitable and return the ETH back to the sender or revert otherwise.
The following challenges are not required but they help us understand your coding skills and ability to handle architectural changes to the smart contracts.
- Modify the contract to support arbitrary token pairs.
- Make the contract ownable and then have the contract use its own funds for trading. Provide profit-sharing incentives to users who call the
arbitrage()
function. - Add support for gas station network and use profits to pay for the gas costs.
- Integrate flash loans to improve the capital efficiency of the contract.
- Import this repository as a private repo. Note that this is different from forking.
- Go to
Settings
->Actions
->General
and selectAllow all actions and reusable workflows
. This will allow the Github workflow that is part of the repo to run in your pull request so you can get feedback about your contract from CI. - Give read access to Adam and Michalis.
- Push your solution in a new branch and open a pull request in your repo to your
main
branch.
yarn
yarn compile
yarn test