Skip to content

Commit

Permalink
fix echidna tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Jul 15, 2024
1 parent db9829f commit 6c4c079
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
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
3 changes: 2 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]
fs_permissions = [{ access = "read", path = "out"}]
fs_permissions = [{ access = "read", path = "out"}]
evm_version = "london"
12 changes: 10 additions & 2 deletions test/fuzz/ERC20CustodyNewEchidnaTest.sol
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../../contracts/prototypes/evm/TestERC20.sol";
import "../../contracts/prototypes/evm/ERC20CustodyNew.sol";
import "../../contracts/prototypes/evm/GatewayEVM.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import {Upgrades} from "openzeppelin-foundry-upgrades/LegacyUpgrades.sol";

contract ERC20CustodyNewEchidnaTest is ERC20CustodyNew {
using SafeERC20 for IERC20;

TestERC20 public testERC20;
address public echidnaCaller = msg.sender;

GatewayEVM testGateway = new GatewayEVM();
address proxy = address(new ERC1967Proxy(
address(new GatewayEVM()),
abi.encodeWithSelector(GatewayEVM.initialize.selector, (echidnaCaller))
));
GatewayEVM testGateway = GatewayEVM(proxy);

constructor() ERC20CustodyNew(address(testGateway)) {
testGateway.initialize(echidnaCaller);
testERC20 = new TestERC20("test", "TEST");
testGateway.setCustody(address(this));
}
Expand Down
5 changes: 4 additions & 1 deletion test/fuzz/GatewayEVMEchidnaTest.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../../contracts/prototypes/evm/GatewayEVM.sol";
import "../../contracts/prototypes/evm/TestERC20.sol";
import "../../contracts/prototypes/evm/ERC20CustodyNew.sol";
Expand All @@ -11,7 +14,7 @@ contract GatewayEVMEchidnaTest is GatewayEVM {
address public echidnaCaller = msg.sender;

constructor() {
initialize(echidnaCaller);
tssAddress = echidnaCaller;
testERC20 = new TestERC20("test", "TEST");
custody = address(new ERC20CustodyNew(address(this)));
}
Expand Down

0 comments on commit 6c4c079

Please sign in to comment.