diff --git a/.github/workflows/evm_foundry_ci.yml b/.github/workflows/evm-foundry-ci.yml similarity index 100% rename from .github/workflows/evm_foundry_ci.yml rename to .github/workflows/evm-foundry-ci.yml diff --git a/.github/workflows/slither.yml b/.github/workflows/slither.yml new file mode 100644 index 00000000..55a9f72c --- /dev/null +++ b/.github/workflows/slither.yml @@ -0,0 +1,16 @@ +name: Slither Analysis + +on: + push: + branches: + - main + pull_request: + +jobs: + analyze: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crytic/slither-action@v0.4.0 + with: + target: 'foundry/' \ No newline at end of file diff --git a/README.md b/README.md index 61ac890c..db429f99 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,19 @@ TODO: add banner Tycho Execution makes it easy to trade on different DEXs by handling the complex encoding for you. Instead of creating custom code for each DEX, you get a simple, ready-to-use tool that generates the necessary data to execute trades. It’s -designed to be safe, straightforward, and quick to set up, so anyone can start trading without extra effort. \ No newline at end of file +designed to be safe, straightforward, and quick to set up, so anyone can start trading without extra effort. + +# Contract Analysis + +We use [Slither](https://github.com/crytic/slither) to detect any potential vulnerabilities in our contracts. + +To run locally, simply install Slither in your conda env and run it inside the foundry directory. + +``` +conda create --name tycho-execution python=3.10 +conda activate tycho-execution + +python3 -m pip install slither-analyzer` +cd foundry +slither . +``` \ No newline at end of file diff --git a/foundry/foundry.toml b/foundry/foundry.toml index 086c3aca..a3c8d7b8 100644 --- a/foundry/foundry.toml +++ b/foundry/foundry.toml @@ -2,7 +2,7 @@ src = 'src' out = 'out' libs = ['lib'] -solc = "0.8.18" +solc = "0.8.28" evm_version = 'shanghai' optimizer = true optimizer_runs = 1000 diff --git a/foundry/src/Counter.sol b/foundry/src/Counter.sol index aded7997..574cf8fe 100644 --- a/foundry/src/Counter.sol +++ b/foundry/src/Counter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; +pragma solidity ^0.8.28; contract Counter { uint256 public number; diff --git a/foundry/src/TychoRouter.sol b/foundry/src/TychoRouter.sol new file mode 100644 index 00000000..36034d43 --- /dev/null +++ b/foundry/src/TychoRouter.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.28; + +contract TychoRouter { + constructor() {} +} diff --git a/foundry/test/Counter.t.sol b/foundry/test/Counter.t.sol index 54b724f7..3840a3f1 100644 --- a/foundry/test/Counter.t.sol +++ b/foundry/test/Counter.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; +pragma solidity ^0.8.28; import {Test, console} from "forge-std/Test.sol"; import {Counter} from "../src/Counter.sol";