Closed JacobYiu closed 5 months ago
Hello!
You need to specify the correct contract name which has the properties. Use the --contract
command line option.
Oh thank you very much! I did not realise I had to place contract inside because echidna had automatically detected right contract where the invariant was placed.
Hi, I may be an idiot, but I was wondering how you would deploy multiple contracts. If I have 2 contracts main and dummy, where the test invariant is placed in main, how would I deploy both of them where they both contain some eth? I have managed to deploy both, where main contains an initial balance, but I am unable to figure out how to have an initial balance for dummy. I have read through the configuration file and have been struggling over an hour to do so.
// contract: "timeStamp" deployer: "0x555555" balanceContract: 100 deployContracts: [["0x30005", "User"]] sender: ["0x30005", "0x200005"] balanceAddr: 0x30000 testMode: property testLimit: 500000
Also would echidna happen to have a discord server? I have some question about echidna because I am writing about it on my dissertation and I would not want to spam the github server.
Hi @JacobYiu! We have a Slack workspace you can join, the link is in the readme: https://github.com/crytic/echidna?tab=readme-ov-file#getting-help
You can fund your main contract with enough eth using balanceContract
, and then the constructor function of your main contract can transfer eth to other addresses / contracts to distribute the funds, or deploy extra contracts you may need.
Thank you very much for the reply! I will continue this issue on the slack forum.
Describe the issue:
Hi, I have recently tried using echidna. When I ran echidna on some of my contracts, it was working perfectly, but it did not seem to run for my reentrancy smart contract. This is my code which I obtained from SWC. It gives me this [2024-04-12 14:28:59.08] Compiling reentrancy.sol... Done! (0.225115472s) Multiple contracts found, only analyzing the first Analyzing contract: /home/jacobyiu/ESBMC_Project/contracts/echidna/vuln/reentrancy.sol:Bank echidna: No tests found in ABI. If you are using assert(), use --test-mode assertion
Code example to reproduce the issue:
` pragma solidity ^0.5.0;
contract ModifierEntrancy { mapping (address => uint) public tokenBalance; Bank public bank; bool private locked = false;
}
contract Bank { // Dummy function to emulate external call response function supportsToken() external pure returns(bytes32) { return keccak256(abi.encodePacked("Nu Token")); } } `
Version:
echidna 2.2.3 slither 0.10.1
Relevant log output:
No response