Commit Graph

7 Commits

Author SHA1 Message Date
Jeff Schroeder 049ca971df ethereum: tighten up some test funcs to pure/view
Fallout from #2956
2023-09-11 14:03:51 -04:00
lucasmt 406a43d03e
ethereum: Add property tests and instructions for running them with KEVM (#2956)
* ethereum: Add Foundry tests written by RV

* ethereum: Add scripts and instructions to run proofs using KEVM

* ethereum: Fix typo on testSetup_after_setup_revert_KEVM

* ethereum: Edit Makefile to skip KEVM tests when running forge test

* ethereum: Fix commented-out lines in Foundry tests

* ethereum: Refactor GovernanceStructs invalid-size tests

* ethereum: Replace assume with bound in Foundry tests

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* ethereum: Apply review suggestions to run-kevm script

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* ethereum: explicit cast to uint8 for some vars

The bound() calls need to be explicitly cast to uint8 from the uint256
that forge-std's bound() returns.

* ethereum: updating some of the RV tests

The definitions don't compile with newer forge/solc.

* ethereum: Add assumption to test that guardian count > 0

Prevents an arithmetic over/underflow error in testCannotVerifySignaturesWithOutOfBoundsSignature, in the expression bound(outOfBoundsGuardian, 0, params.guardianCount - 1)

---------

Co-authored-by: Lucas MT <lucas.tabajara@runtimeverification.com>
Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>
2023-09-06 11:24:00 -04:00
Csongor Kiss 7f7330ddab Revert "ethereum: fix view error with newer version of forge"
This reverts commit 05cec3d729 (#3059)

The commit was erroneously included in anticipation of a forge version
update, but it actually only generates an error with an outdated
forge-stdlib version.

The old version's `vm.addr` function
(see
ddb69063e4/src/Vm.sol (L15))
has no `pure` modifier, thus any function using it can not be `pure` (or `view`).
The new version (see
66bf4e2c92/src/Vm.sol (L55))
on the other hand does. In fact, with the new version, removing the
modifier produces a warning.
2023-06-13 17:29:04 -04:00
Jonathan Claudius 05cec3d729 ethereum: fix view error with newer version of forge 2023-06-13 14:43:12 -04:00
Jeff Schroeder 8605ef0e5f ethereum: kill warning in TokenImplementation.t
Newer versions of forge show this warning:

    [⠊] Compiling...
    [⠢] Compiling 93 files with 0.8.4
    [⠘] Solc 0.8.4 finished in 20.09s
    Compiler run successful (with warnings)
    warning[2018]: Warning: Function state mutability can be restricted to view
    --> forge-test/TokenImplementation.t.sol:76:5:
    |
    |     function simulatePermitSignature(
    |     ^ (Relevant source part starts here and spans across multiple lines).

This change cleans it up.
2023-05-17 12:51:26 -05:00
Karl Kempe 9df96ac666 Fix domain separator and add more tests 2022-09-19 13:42:38 -04:00
Karl Kempe d8adb6a700 Add ERC20 permit 2022-09-19 13:42:38 -04:00