-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add crosschain properties #24
Conversation
uint256 _totalSupplyBefore = optimismSuperchainERC20.totalSupply(); | ||
uint256 _fromBalanceBefore = optimismSuperchainERC20.balanceOf(_from); | ||
uint256 _totalSupplyBefore = sourceToken.totalSupply(); | ||
uint256 _fromBalanceBefore = sourceToken.balanceOf(_from); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit> assert for to
too
packages/contracts-bedrock/test/properties/halmos/MockL2ToL2Messenger.sol
Show resolved
Hide resolved
@@ -28,23 +42,24 @@ contract MockL2ToL2Messenger is IL2ToL2CrossDomainMessenger { | |||
address _target, | |||
bytes calldata _message | |||
) | |||
external | |||
public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know why, will undo
608e74a
to
2239e0f
Compare
* refactor: allow for atomicity on mock messenger * refactor: cross domain sender logic on mock messenger * refactor: l2 to l2 caller and messenge sender logic * chore: remove assumes for removed checks on mock messenger
2239e0f
to
773a1d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments + properties should be marked as tested in PROPERTIES.md
@@ -89,21 +114,18 @@ contract SymTest_OptimismSuperchainERC20 is SymTest, HalmosBase { | |||
vm.assume(_to != address(0)); | |||
// Deploying a new messenger because of an issue of not being able to etch the storage layout of the mock | |||
// contract. So needed to a new one setting the symbolic immutable variable for the crossDomainSender. | |||
vm.etch(address(MESSENGER), address(new MockL2ToL2Messenger(_crossDomainSender)).code); | |||
// Used 0 address on source token so when the `soureToken` calls it if returns the symbolic `_crossDomainSender` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debugging this must've been the opposite of fun 😁
@@ -5,6 +5,7 @@ import { Test } from "forge-std/Test.sol"; | |||
|
|||
contract HalmosBase is Test { | |||
uint256 internal constant CURRENT_CHAIN_ID = 1; | |||
uint256 internal constant DESTINATION_CHAIN_ID = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old variable isn't used anymore
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
The symbolic tests will be written and proved using Kontrol instead |
refactor: allow for atomicity on mock messenger
refactor: cross domain sender logic on mock messenger
refactor: l2 to l2 caller and messenge sender logic
chore: remove assumes for removed checks on mock messenger
On the mock messenger, I had to return immutable vars on cross domain sender function due to the same problem with the storage layout. The same happens with the destination chain value on
sendMessage
.To run the files:
just test-halmos-all
CLOSES FUZZ-32