Commit f370113e authored by AgusDuha's avatar AgusDuha Committed by GitHub

test: fix superchain erc20 invariants (#11688)

---------
Co-authored-by: default avatar0xDiscotech <131301107+0xDiscotech@users.noreply.github.com>
parent d520441b
# `OptimismSuperchainERC20` Invariants # `OptimismSuperchainERC20` Invariants
## Calls to sendERC20 should always succeed as long as the actor has enough balance. Actor's balance should also not increase out of nowhere but instead should decrease by the amount sent. ## Calls to sendERC20 should always succeed as long as the actor has enough balance. Actor's balance should also not increase out of nowhere but instead should decrease by the amount sent.
**Test:** [`OptimismSuperchainERC20.t.sol#L194`](../test/invariants/OptimismSuperchainERC20.t.sol#L194) **Test:** [`OptimismSuperchainERC20.t.sol#L196`](../test/invariants/OptimismSuperchainERC20.t.sol#L196)
## Calls to relayERC20 should always succeeds when a message is received from another chain. Actor's balance should only increase by the amount relayed. ## Calls to relayERC20 should always succeeds when a message is received from another chain. Actor's balance should only increase by the amount relayed.
**Test:** [`OptimismSuperchainERC20.t.sol#L212`](../test/invariants/OptimismSuperchainERC20.t.sol#L212) **Test:** [`OptimismSuperchainERC20.t.sol#L214`](../test/invariants/OptimismSuperchainERC20.t.sol#L214)
...@@ -62,6 +62,8 @@ contract OptimismSuperchainERC20_User is StdUtils { ...@@ -62,6 +62,8 @@ contract OptimismSuperchainERC20_User is StdUtils {
return; return;
} }
if (_chainId == block.chainid) return;
// Bound send amount to our ERC20 balance. // Bound send amount to our ERC20 balance.
_amount = bound(_amount, 0, superchainERC20.balanceOf(address(this))); _amount = bound(_amount, 0, superchainERC20.balanceOf(address(this)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment