This repository provides Swapper
smart contract written in Solidity that allows swapping ETHs to tokens. Trades are done through Proxy
contract that provides upgradeability of logic. Proxy updates are being managed by Multisig
.
- Proxy - allowing upgrading swapping logic or adding new features/updates
- Multisig - each update must be approved by privileged users - quorum of at least 3 approvals must be reached to update implementation contract
- Swapper - contains swap logic including providing quotes on tokens
This repository was build with Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
git clone [email protected]:spaceh3ad/eiger-task.git
cd eiger-task
NOTE: export abstract syntax tree
forge build --ast
forge test
forge coverage
-
slither .
Report at Slither.md
-
aderyn . --exclude lib
Report at Aderyn.md
-
myth analyze src/*.sol --solc-json mythril.solc.json ``` Report at [Myth.md](./security-scans/Myth.md)
-
Report is available at solidity-metrics. Can be viewed in nice format at http://127.0.0.1:3000/
Copy .env.example and rename to .env. Also fill out the envs.
Deploy contracts to Goerli.
forge script script/Deploy.s.sol --ffi --rpc-url https://goerli.gateway.tenderly.co --broadcast
You could verify contracts with:
forge verify-contract CONTRACT_ADDRES src/Contract.sol:Contract -c 5 --num-of-optimizations 200 --watch
forge doc --serve --port 4000 --open
Contracts are deployed at Goerli network
To perform a swap user should call swapEtherToToken
through Proxy contract.