Skip to content

Commit

Permalink
Merge branch 'main' into slither-only-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Jul 17, 2024
2 parents 0ce2bd8 + 2bbd352 commit df1eb0f
Show file tree
Hide file tree
Showing 99 changed files with 6,788 additions and 48,497 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ jobs:
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install Dependencies
run: yarn install

- name: Test with coverage
run: yarn coverage || true
run: yarn coverage

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
6 changes: 3 additions & 3 deletions .github/workflows/generated-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "18.0.0"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "18.0.0"
registry-url: "https://registry.npmjs.org"

- name: Install Foundry
Expand All @@ -37,6 +37,9 @@ jobs:

- name: Build project
run: yarn build

- name: Test (foundry)
run: yarn test:foundry

- name: Test (hardhat)
run: yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tsconfig.tsbuildinfo
# Coverage
coverage
coverage.json
lcov.info

# Slither
scripts/slither-results/*
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-foundry-upgrades"]
path = lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
2 changes: 1 addition & 1 deletion contracts/prototypes/evm/ERC20CustodyNew.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces.sol";
Expand Down
8 changes: 5 additions & 3 deletions contracts/prototypes/evm/GatewayEVM.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
Expand All @@ -16,7 +16,10 @@ contract GatewayEVM is Initializable, OwnableUpgradeable, UUPSUpgradeable, IGate
address public custody;
address public tssAddress;

constructor() {}
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}

function initialize(address _tssAddress) public initializer {
__Ownable_init();
Expand All @@ -31,7 +34,6 @@ contract GatewayEVM is Initializable, OwnableUpgradeable, UUPSUpgradeable, IGate

function _execute(address destination, bytes calldata data) internal returns (bytes memory) {
(bool success, bytes memory result) = destination.call{value: msg.value}(data);

if (!success) revert ExecutionFailed();

return result;
Expand Down
1 change: 1 addition & 0 deletions contracts/prototypes/evm/GatewayEVMUpgradeTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
// NOTE: Purpose of this contract is to test upgrade process, the only difference should be name of Executed event
// The Gateway contract is the endpoint to call smart contracts on external chains
// The contract doesn't hold any funds and should never have active allowances
/// @custom:oz-upgrades-from GatewayEVM
contract GatewayEVMUpgradeTest is Initializable, OwnableUpgradeable, UUPSUpgradeable {
using SafeERC20 for IERC20;

Expand Down
2 changes: 1 addition & 1 deletion contracts/prototypes/evm/ReceiverEVM.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/prototypes/evm/TestERC20.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/prototypes/evm/interfaces.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
pragma solidity ^0.8.0;

interface IGatewayEVMEvents {
event Executed(address indexed destination, uint256 value, bytes data);
Expand Down
59 changes: 0 additions & 59 deletions contracts/prototypes/test/GatewayEVM.t.sol

This file was deleted.

101 changes: 0 additions & 101 deletions contracts/prototypes/test/GatewayEVMZEVM.t.sol

This file was deleted.

3 changes: 2 additions & 1 deletion echidna.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ cryticArgs: ['--solc-remaps', '@=node_modules/@']
testMode: "assertion"
testLimit: 50000
seqLen: 10000
allContracts: false
allContracts: false
balanceAddr: 0x1043561a8829300000
10 changes: 8 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
src = 'contracts'
out = 'out'
libs = ['node_modules', 'lib']
test = 'test'
test = 'testFoundry'
cache_path = 'cache_forge'
no-match-contract = '.*EchidnaTest$'
optimizer = true
optimizer_runs = 10_000
optimizer_runs = 10_000
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]
fs_permissions = [{ access = "read", path = "out"}]
evm_version = "london"
1 change: 1 addition & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const config: HardhatUserConfig = {
},
networks: {
...getHardhatConfigNetworks(),
hardhat: {},
},
solidity: {
compilers: [
Expand Down
1 change: 1 addition & 0 deletions lib/openzeppelin-foundry-upgrades
46 changes: 4 additions & 42 deletions lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
export type ParamSymbol =
| "BNB.BSC"
| "BTC.BTC"
| "ETH.ETH"
| "gETH"
| "MATIC.AMOY"
| "sETH.SEPOLIA"
| "tBNB"
| "tBTC"
| "tMATIC"
| "USDC.BSC"
| "USDC.ETH"
| "USDC.SEPOLIA"
| "USDC"
| "USDT.BSC"
| "USDT.ETH";
export type ParamChainName =
| "amoy_testnet"
| "bsc_mainnet"
| "bsc_testnet"
| "btc_mainnet"
| "btc_testnet"
| "eth_mainnet"
| "sepolia_testnet"
| "zeta_mainnet"
| "zeta_testnet";
export type ParamType =
| "connector"
| "erc20Custody"
| "fungibleModule"
| "pauser"
| "systemContract"
| "tss"
| "tssUpdater"
| "uniswapV2Factory"
| "uniswapV2Router02"
| "uniswapV3Factory"
| "uniswapV3Router"
| "weth9"
| "zetaToken"
| "zetaTokenConsumerUniV3"
| "zrc20";
export type ParamSymbol = "USDC.BSC" | "USDC.ETH" | "BTC.BTC" | "BNB.BSC" | "USDT.ETH" | "USDT.BSC" | "ETH.ETH" | "sETH.SEPOLIA" | "USDC" | "gETH" | "tMATIC" | "tBTC" | "MATIC.AMOY" | "USDC.SEPOLIA" | "tBNB";
export type ParamChainName = "eth_mainnet" | "bsc_mainnet" | "zeta_mainnet" | "btc_mainnet" | "bsc_testnet" | "zeta_testnet" | "btc_testnet" | "amoy_testnet" | "sepolia_testnet";
export type ParamType = "connector" | "erc20Custody" | "pauser" | "tss" | "tssUpdater" | "uniswapV2Factory" | "uniswapV2Router02" | "uniswapV3Factory" | "uniswapV3Router" | "weth9" | "zetaToken" | "fungibleModule" | "systemContract" | "zrc20" | "zetaTokenConsumerUniV3";

Loading

0 comments on commit df1eb0f

Please sign in to comment.