Skip to content

spaceh3ad/eth-token-swapper

Repository files navigation

Overview

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

Requirements

This repository was build with Foundry

curl -L https://foundry.paradigm.xyz | bash
foundryup

Clone repository

git clone [email protected]:spaceh3ad/eiger-task.git
cd eiger-task

Build

NOTE: export abstract syntax tree

forge build --ast

Test & Coverage

forge test
forge coverage

Security Analysis

  1. Slither

    slither .

    Report at Slither.md

  2. Aderyn

    aderyn . --exclude lib

    Report at Aderyn.md

  3. Mythril

    myth analyze src/*.sol --solc-json mythril.solc.json
    ```
    
    Report at [Myth.md](./security-scans/Myth.md)
    
  4. Solidity Metrics

    Report is available at solidity-metrics. Can be viewed in nice format at http://127.0.0.1:3000/

Deployment

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

Verify

You could verify contracts with:

forge verify-contract CONTRACT_ADDRES src/Contract.sol:Contract -c 5 --num-of-optimizations 200 --watch

Documentation

forge doc --serve --port 4000 --open

Smart Contracts

Contracts are deployed at Goerli network

To perform a swap user should call swapEtherToToken through Proxy contract.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published