Skip to content

Commit

Permalink
chore: updates to use immutable args
Browse files Browse the repository at this point in the history
  • Loading branch information
0xteddybear committed Oct 31, 2024
1 parent fcd92e5 commit b520ddf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
| 4 | an invalid claim should not be redeemable | State transition | [x] |
| 5 | for each token, token.balanceOf(L1StandardBridge) == initialBalance - sum of claims | High-level | [x] |
| 6 | OptimismPortal.balance == initialBalance - sum of claims | High-level | [x] |
| 7 | balanceClaimer should only be initialized once | Valid state | [x] |


## testing methodology
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ import {IErc20BalanceWithdrawer} from "contracts/L1/interfaces/winddown/IErc20Ba
import {IBalanceClaimer} from "contracts/L1/interfaces/winddown/IBalanceClaimer.sol";

contract BalanceClaimerUnguidedHandlers is BalanceClaimerSetup {
function handler_initialize(address _ethBalanceWithdrawer, address _erc20BalanceWithdrawer, bytes32 _root)
external
{
// prop-id 7
try balanceClaimer.initialize(_ethBalanceWithdrawer, _erc20BalanceWithdrawer, _root) {
assert(false); // balanceClaimer should only be initialized once
} catch {}
}

function handler_claim(
bytes32[] calldata _proof,
address _user,
Expand All @@ -28,7 +19,7 @@ contract BalanceClaimerUnguidedHandlers is BalanceClaimerSetup {
//prop-id 1
assert(ghost_claimInTree[hash]);
//prop-id 2;
assert(!ghost_claimed[_user])
assert(!ghost_claimed[_user]);
ghost_claimed[_user]=true;
} catch {
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,11 @@ contract BalanceClaimerSetup is CommonBase, StdUtils, Claims {
L1ChugSplashProxy l1StandardBridgeProxy = new L1ChugSplashProxy(address(this));
Proxy optimismPortalProxy = new Proxy(address(this));

BalanceClaimer balanceClaimerImpl = new BalanceClaimer();
BalanceClaimer balanceClaimerImpl =
new BalanceClaimer(address(optimismPortalProxy), address(l1StandardBridgeProxy), tree[0]);

// Set BalanceClaimer implementation
balanceClaimerProxy.upgradeToAndCall(
address(balanceClaimerImpl),
abi.encodeWithSelector(
balanceClaimerImpl.initialize.selector,
address(optimismPortalProxy),
address(l1StandardBridgeProxy),
tree[0]
)
);
balanceClaimerProxy.upgradeTo(address(balanceClaimerImpl));
optimismPortalProxy.upgradeTo(address(optimismPortalImpl));
l1StandardBridgeProxy.setCode(address(l1StandardBridgeImpl).code);

Expand All @@ -65,9 +58,9 @@ contract BalanceClaimerSetup is CommonBase, StdUtils, Claims {
/// @custom:prop sanity checks for setup
function property_setup() external {
assert(address(optimismPortal.BALANCE_CLAIMER()) == address(balanceClaimer));
assert(address(balanceClaimer.ethBalanceWithdrawer()) == address(optimismPortal));
assert(address(balanceClaimer.erc20BalanceWithdrawer()) == address(l1StandardBridge));
assert(address(balanceClaimer.ETH_BALANCE_WITHDRAWER()) == address(optimismPortal));
assert(address(balanceClaimer.ERC20_BALANCE_WITHDRAWER()) == address(l1StandardBridge));
assert(address(l1StandardBridge.BALANCE_CLAIMER()) == address(balanceClaimer));
assert(balanceClaimer.root() == tree[0]);
assert(balanceClaimer.ROOT() == tree[0]);
}
}

0 comments on commit b520ddf

Please sign in to comment.