OpenZeppelin / openzeppelin-contracts

OpenZeppelin Contracts is a library for secure smart contract development.
https://openzeppelin.com/contracts
MIT License
24.72k stars 11.75k forks source link

Write invariant testing for Heap.sol #5120

Open Amxx opened 1 month ago

Amxx commented 1 month ago
          I tried testing these invariants with [Foundry Invariant Testing](https://book.getfoundry.sh/forge/invariant-testing) without success. The reason is that we need a mock to deploy within the setup function so that it acts as the target contract to validate the invariant against.

I don't think that's needed but we may want to reconsider invariant tests

_Originally posted by @ernestognw in https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5084#discussion_r1687475372_

Amxx commented 1 month ago

Ref: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5084#discussion_r1687475978