Giter VIP home page Giter VIP logo

contracts-verification-benchmark's People

Contributors

bitbart avatar danielepusceddu avatar fabiofioravanti avatar fsainas avatar giuliamatri avatar petitnau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

contracts-verification-benchmark's Issues

Reference property by key

Reference property by key rather than by position.

Files

Extend the toolchain to support skeletons of the following form:

{
    "name": "Example",
    "specification": "Description.",
    "properties": {
        "foo": "Foo property.",
        "bar": "Bar property."
    }
}

The toolchain should look for specification files and ground truth identified by the property key

solcmc
|---foo.sol
|---bar.sol
certora
|---foo.spec
|---bar.spec
property,version,truth,footnote-md
foo,v1,1,
foo,v2,0,
bar,v1,1,
bar,v2,0,

and should generate the README file accordingly.

# README
...

## Properties
- **foo**: Foo property.
- **bar**: Bar property.

Constraints

ID must be:

  • [a-zA-Z0-9_-]+

Discrepancy in timeouts in SolCMC

The script run_solcmc.py generates command lines with two timeouts, like e.g.:

timeout 600 solc build/contracts/Htlc_reveal-auth-owner_v4.sol --model-checker-engine chc --model-checker-timeout 600 --model-checker-targets assert --model-checker-show-unproved

The problem is that the first timeout is expressed in seconds, while the second one is in milliseconds, so if the Z3 timeout works, the actual timeout is 600ms, which is too short for many experiments.

Fix the script to generate a default command line of the form:

timeout 10m solc build/contracts/Htlc_reveal-auth-owner_v4.sol --model-checker-engine chc --model-checker-timeout 0 --model-checker-targets assert --model-checker-show-unproved

In this way, solc/Z3 run without time constraints, and the actual timeout is that given by the Unix timeout command.

Certora does not distinguish between strong and weak positive/negative

Currently, every result given by Certora is marked as strong:

    if no_errors_found(log.stdout):
        print(contract_path + ", " + spec_path + ": " + utils.STRONG_POSITIVE)
        return (utils.STRONG_POSITIVE, log.stdout+"\n"+log.stderr)
    else:
        print(contract_path + ", " + spec_path + ": " + utils.STRONG_NEGATIVE)
        return (utils.STRONG_NEGATIVE, log.stdout+"\n"+log.stderr)

When running the tool on a Certora specification file, its result should adhere to the following:

  • When using assert and the property results green -> P!
  • When using assert and the property results red -> F
  • When using satisfy and the property results green -> P
  • When using satisfy and the property results red -> F!

Fix timeout issue with solc

The --model-checker-timeout option of solc does not work consistently. For instance:

solc solcmc/build/contracts/VestingWallet_p2_v2.sol --model-checker-engine chc --model-checker-timeout 10000 --model-checker-targets assert --model-checker-show-unproved

does not terminate. This issue seems caused by a related issue of Z3, upon which solc relies.

Instead of using the --model-checker-timeout option of solc, use the Unix timeout command:

timeout <duration> solc solcmc/build/contracts/VestingWallet_p2_v2.sol --model-checker-engine chc --model-checker-targets assert --model-checker-show-unproved

Allow negation of properties

Extend the toolchain to allow the inversion of the results provided by the tools.
This is needed to be able to express all the properties in skeleton.json as the actual properties expected by the contracts.

Allow specification files (of both Certora and SolCMC) to have the preamble

/// @custom:negate

indicating that the specified property is the negation of the property described in the skeleton. Results should be converted as follows:

  • P -> N
  • P! -> N!
  • N -> P
  • N! -> P!

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.