Giter VIP home page Giter VIP logo

Comments (3)

ggrieco-tob avatar ggrieco-tob commented on June 9, 2024

Hi!,

The correct command is echidna, not echidna-test. Besides that, the crytic-compile issue should be reported in their issue tracker. Let's close this one.

from echidna.

elopez avatar elopez commented on June 9, 2024

Hi! You should also specify the contract name with --contract, e.g. echidna solution.sol --contract TestToken

The first error is unintuitive, but it's usually seen when the specified file does not exist. Check that you are in the correct directory and that you can see your file with ls

from echidna.

0xneves avatar 0xneves commented on June 9, 2024

The echidna command seems to only work when you are in the folder of the test file and having solc-select installed and using the correct version is a must.

Although using this method will still find errors when importing solidity files from other folders

echidna TestSwapFactory.sol --contract TestSwapFactory     
[2023-11-29 17:23:37.81] Compiling TestSwapFactory.sol... Done! (0.337096s)
echidna: Couldn't compile given file
stdout:
stderr:
INFO:CryticCompile:'solc --version' running
INFO:CryticCompile:'solc TestSwapFactory.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/Users/redacted/Documents/Solidity/redacted/swaplace-contracts/contracts/audit' running
ERROR:CryticCompile:Invalid solc compilation Error: Source "SwapFactory.sol" not found: File not found. Searched the following locations: "".
 --> TestSwapFactory.sol:4:1:
  |
4 | import "../SwapFactory.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "../SwapFactory.sol";

contract TestSwapFactory is SwapFactory {
    function echidna_alwaystrue() public returns (bool) {
        return (true);
    }

    function echidna_revert_always() public returns (bool) {
        revert();
    }
}

When using the following command on the main hardhat folder, I manage to run the tests above. But notice that the contract file with .sol extension was not mentioned...

echidna . --contract TestSwapFactory

from echidna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.