Skip to content

Releases: Consensys/scribble

v0.3.5

26 Feb 01:05
Compare
Choose a tag to compare

This version adds:

  • support for a "instrumented source"-to-"original source" map
  • unifies all instrumentation metadata (the property map and the source-to-source map) into a single InstrumentationMetadata object.
  • the --property-map-file CLI option was removed, in favour of --instrumentation-metadata-file (which contains the property map as well as other metadata).

v0.3.4

18 Feb 07:02
Compare
Choose a tag to compare

This release includes both new language features as well as bug fixes.

New Language Features

Support for user-defined functions (#15). These are loop-free functions defined at the contract level (in the contract doc strings) that are available for all properties in that contract to refer to.

For example consider a toy 'wallet' contract, that keeps internal track of the balances of several tokens per user, in its _balances field:

contract Wallet {
    mapping(address => address => uint) _balances;
    
    function transferFrom(address from, address to, address token, uint amount) public {
       ...
    }
}

One might want to check that after transferFrom, the internal balance equals the 'real' balance in each token. To save on writing, we can add define our own function for getting the real balance and use it as follows:

/// define realBalance(address user, address token) uint = IERC20(token).balanceOf(user);
contract Wallet {
    mapping(address => address => uint) _balances;
    
    /// if_succeeds {:msg "Internal balance matches real balance"}
    ///        realBalance(from, token) == _balances[from][token] &&
    ///        realBalance(to, token) == _balances[to][token];
    function transfer(address from, address to, address token, uint amount) public {
       ...
    }
}

Bug fixes

  • Add logic to handle the various flavours of import statements when re-writing in flat mode #14
  • Fix various edge-cases of shadowing when instrumenting using unique identifiers #13
  • Bump node-js in CI pipeline to 12 #9

v0.3.3

05 Jan 05:45
53fb6f7
Compare
Choose a tag to compare

This release has 2 small fixes:

  • disallow if_succeeds annotations on contracts and invariant annotations on functions
  • fix buggy behavior for identifier paths in user-defined type names in flat mode