Skip to content

Commit

Permalink
update spec: remove rebalancer and add bridgeLimitAdmin rule
Browse files Browse the repository at this point in the history
  • Loading branch information
nisnislevi committed May 28, 2024
1 parent d711fb3 commit 8250553
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions certora/specs/ccip.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using SimpleERC20 as erc20;
methods {
function getCurrentBridgedAmount() external returns (uint256) envfree;
function getBridgeLimit() external returns (uint256) envfree;
function getRebalancer() external returns (address) envfree;
function owner() external returns (address) envfree;
}


Expand Down Expand Up @@ -54,7 +54,7 @@ rule withdrawLiquidity_correctness(env e) {
withdrawLiquidity(e, amount);
uint256 bal_after = erc20.balanceOf(e, currentContract);
assert e.msg.sender == getRebalancer();
// assert e.msg.sender == getRebalancer();
assert (to_mathint(bal_after) == bal_before - amount);
}

Expand All @@ -73,7 +73,7 @@ rule provideLiquidity_correctness(env e) {
provideLiquidity(e, amount);
uint256 bal_after = erc20.balanceOf(e, currentContract);

assert e.msg.sender == getRebalancer();
// assert e.msg.sender == getRebalancer();
assert (to_mathint(bal_after) == bal_before + amount);
}

Expand Down Expand Up @@ -111,3 +111,15 @@ rule only_releaseOrMint_can_decrease_currentBridged(env e) {
f.selector==sig:releaseOrMint(bytes memory,address,uint256,uint64,bytes memory).selector;
}


/* ==============================================================================
rule: only_releaseOrMint_can_deccrease_currentBridged
============================================================================*/
rule only_bridgeLimitAdmin_or_owner_can_call_setBridgeLimit(env e) {
uint256 newBridgeLimit;

setBridgeLimit(e, newBridgeLimit);

assert e.msg.sender==getBridgeLimitAdmin(e) || e.msg.sender==owner();
}

0 comments on commit 8250553

Please sign in to comment.