From 58d97186c5c94e597ca7d00326b7c13f8d31195c Mon Sep 17 00:00:00 2001 From: delegatedev <101163997+delegatedev@users.noreply.github.com> Date: Tue, 8 Mar 2022 09:01:27 +0000 Subject: [PATCH] feat: Add forge support --- .github/workflows/CI.yml | 25 +++++++++++ foundry.toml | 6 +++ remappings.txt | 5 ++- truffle-config.js | 92 ---------------------------------------- 4 files changed, 34 insertions(+), 94 deletions(-) create mode 100644 .github/workflows/CI.yml create mode 100644 foundry.toml delete mode 100644 truffle-config.js diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..3aa6b94 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,25 @@ +name: CI +on: + push: + branches: + - master + pull_request: + +jobs: + run-ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - uses: actions/setup-node@v2 + - name: Install dev dependencies + run: npm install + + - name: Install Foundry + uses: onbjerg/foundry-toolchain@v1 + with: + version: nightly + + - name: Run tests + run: forge test -f $JSON_RPC_URL diff --git a/foundry.toml b/foundry.toml new file mode 100644 index 0000000..2b6d535 --- /dev/null +++ b/foundry.toml @@ -0,0 +1,6 @@ +[default] +src = 'contracts' +out = 'out' +libs = ['lib'] + +# See more config options https://github.com/gakonst/foundry/tree/master/config diff --git a/remappings.txt b/remappings.txt index d208f91..b2581f2 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,4 +1,5 @@ yamV3/=lib/yamV3/contracts/ ds-test/=lib/ds-test/src/ -openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/ -uma/=lib/uma/packages/core/contracts/ \ No newline at end of file +@openzeppelin/=lib/openzeppelin-contracts/ +openzeppelin-contracts/=lib/openzeppelin-contracts/contracts +uma/=lib/uma/packages/core/contracts/ diff --git a/truffle-config.js b/truffle-config.js deleted file mode 100644 index 9071914..0000000 --- a/truffle-config.js +++ /dev/null @@ -1,92 +0,0 @@ -require('dotenv-flow').config(); -const HDWalletProvider = require("@truffle/hdwallet-provider"); -var Web3 = require('web3'); -// var p = ; -module.exports = { - compilers: { - solc: { - version: '0.5.15', - docker: process.env.DOCKER_COMPILER !== undefined - ? process.env.DOCKER_COMPILER === 'true' : true, - parser: 'solcjs', - settings: { - optimizer: { - enabled: true, - runs: 5 - }, - evmVersion: 'istanbul', - }, - }, - }, - networks: { - test: { - host: '0.0.0.0', - port: 8545, - network_id: '1001', - gasPrice: 50000000000, - gas: 8000000, - network_id: '1001', - }, - distribution: { - host: '0.0.0.0', - port: 8545, - network_id: '1001', - gasPrice: 50000000000, - gas: 8000000, - network_id: '1001', - }, - test_ci: { - host: '0.0.0.0', - port: 8545, - gasPrice: 1, - gas: 10000000, - network_id: '1001', - }, - mainnet: { - network_id: '1', - provider: () => new HDWalletProvider( - [process.env.DEPLOYER_PRIVATE_KEY], - "http://192.168.1.39:8545", - 0, - 1, - ), - gasPrice: Number(process.env.GAS_PRICE), - gas: 8000000, - from: process.env.DEPLOYER_ACCOUNT, - timeoutBlocks: 800, - }, - kovan: { - network_id: '42', - provider: () => new HDWalletProvider( - [process.env.DEPLOYER_PRIVATE_KEY], - 'https://kovan.infura.io/v3/04c5f76635f24c70b28488be34dbd838', - 0, - 1, - ), - gasPrice: 10000000000, // 10 gwei - gas: 6900000, - from: process.env.DEPLOYER_ACCOUNT, - timeoutBlocks: 500, - }, - dev: { - host: 'localhost', - port: 8445, - network_id: '1005', - gasPrice: 1000000000, // 1 gwei - gas: 8000000, - }, - coverage: { - host: '0.0.0.0', - network_id: '1002', - port: 8555, - gas: 0xfffffffffff, - gasPrice: 1, - }, - docker: { - host: 'localhost', - network_id: '1313', - port: 8545, - gasPrice: 1, - }, - }, -};