crytic / building-secure-contracts

Guidelines and training material to write secure smart contracts
https://secure-contracts.com/
GNU Affero General Public License v3.0
2.21k stars 345 forks source link

Error: Deploying the contract failed #243

Closed darkerego closed 1 year ago

darkerego commented 1 year ago

Hi. I have an issue.

Bug: my contracts fails to build when I run

$ echidna-test   echidna_test.sol

It does however compile with both brownie, critic-compile, and also slither. The specific error is:

"echidna-test: Deploying the contract 0x00a329c0648769A73afAc7F9381E08FB43dBEA72 failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.):"

Exepected behavior: The contract should compile. Documentation says I should open an issue. Thanks.

elopez commented 1 year ago

Hi! can you share your contract code here? Have you checked if any of the conditions in the error message apply to your contract? (usually it's something simple like e.g. your contract constructor reverts, or sends ether to another address, but you've not funded your contract with ether)

darkerego commented 1 year ago

Ah, thanks for the quick reply! You are right, it was totally my fault.

ggrieco-tob commented 1 year ago

Hi,

Just to clarify: compiling an contract and deploying it without a revert are two different things. Your contract may compile properly, but always fail in the deployment. This is determined during runtime.

ggrieco-tob commented 1 year ago

This seems to be fixed