Created
December 23, 2022 10:55
-
-
Save andreolf/42a457ba43bfa96118af39db14eef3be to your computer and use it in GitHub Desktop.
Pass constructor arguments to a contract in an Echidna test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.0; | |
contract MyContract { | |
uint public value; | |
constructor(uint _value) public { | |
value = _value; | |
} | |
} | |
// Echidna test code | |
import "echidna/echidna.sol"; | |
contract TestMyContract { | |
using Echidna for *; | |
MyContract myContract; | |
function beforeEach() public { | |
myContract = new MyContract(123); | |
} | |
@test | |
function testConstructor() public { | |
assert(myContract.value() == 123); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment