- Introduction
- Running the Tests
- Unit Tests with Hardhat
- Reentrancy POC with Hardhat
- Fuzzing Tests with Echidna
This document provides guidelines for running various tests in our system. These include unit tests, POC and fuzzing tests.
You can find the Audit Report and OpenSea Testnet Report in the report/
directory.
And you can find both POC (Whitelist optimzation and ReentrancyAttack mock) in the report/POC
directory.
The unic testing is present in the test/unit/
folder, and the fuzzing in the report/Echidna
.
The commands mentioned in the following sections will guide you on how to run our automated testing suite.
We use Hardhat for unit testing. To run these tests, simply execute the following command:
npx hardhat test
npx hardhat test --grep "MarAbiertoToken Reentrancy POC"
Echidna is used for performing invariant and fuzzing tests. It checks unusual combinations of function calls to verify if the invariant function, which should always hold true, fails under any circumstances.
Note: These tests are not deterministic, which means they may occasionally fail. The objective here is not to test for authorization but to ensure that the contract is secure against reentrancy attacks, overflows, and similar issues.
Prerequisite: Docker must be installed and running on your machine.
To run the Echidna tests, use the following commands:
docker run -it --rm -v $PWD:/code trailofbits/eth-security-toolbox
cd /code/report/Echidna
echidna-test contracts/TestEchidnaFlatten.sol --contract TestMarAbiertoToken