You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 10, 2024. It is now read-only.
This directory contains some properties for testing TokenCard contracts where three users are defined:
3
+
This directory contains some properties for testing Solidity contracts where multiple users are defined:
4
4
5
-
*`echidna_owner`: the owner of the contract only used to execute the contract constructor
6
-
*`echidna_attack`: an unprivileged user, used to execute the randomly generated transactions
7
-
*`echidna_user`: another unprivileged user, also used to execute randomly generated transactions in cases where multiple users are necessary
5
+
-`echidna_deployer`: Deployer address used to execute the contract constructor.
8
6
9
-
We test a variety of properties, such as:
10
-
* Whitelist addition and removal operations properly modify the whitelist
11
-
* The owner of a contract cannot be changed.
12
-
* Spending limits are properly bounded by the spend limit values
13
-
* Spending limits do in fact reset daily
14
-
* Differential testing of the different interger parsing functions produce identical results
7
+
-`echidna_owner`: Address of the user that owns an ownable contract.
8
+
9
+
-`echidna_controller`: Controller address assigned to a controllable contract.
10
+
11
+
-`echidna_attacker`: An unprivileged user, used to execute the randomly generated transactions.
12
+
13
+
# Configuration
14
+
15
+
Individual tests can be configured using yaml configuration files.
16
+
17
+
A full list of test configuration options can be found here: [default.yaml](https://github.com/crytic/echidna/blob/master/examples/solidity/basic/default.yaml)
15
18
16
19
# Instructions
17
20
18
-
1. Uncompress this file in the root of [TokenCard's contract repository](https://github.com/tokencard/contracts). We tested this example with version [2.0.0](https://github.com/tokencard/contracts/commit/b99b7d1670f9ad7b90335e8391fe63fd7e20de9b).
19
-
2. Install the latest revision of [Echidna](https://github.com/crytic/echidna/#installation). Note that `ecRecover.sol` requires the `dev-hevm-0.29` branch of Echidna to run.
20
-
3. Execute `echidna-test` with one of the `*.sol` files and its corresponding `*.yaml` config file. For example, an invocation with `spendLimit.sol` would look like:
21
+
Normally the echidna tests run in CircleCI but they can also be invoked locally for development purposes.
22
+
23
+
Run trail of bits security toolbox and mount the contracts directory, you need to make sure that the path is an absolute path:
24
+
25
+
docker run -v $GOPATH/src/github.com/tokencard/contracts:/contracts -it trailofbits/eth-security-toolbox:latest
This will create a new flattened contract at `critic-export/flattening/Wallet.sol` which can then be imported in the test file as `import "crytic-export/flattening/Wallet.sol";`.
0 commit comments