Skip to content

Commit

Permalink
for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
nisnislevi committed May 27, 2024
1 parent 8596bf8 commit ffbda1f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion certora/confs/ccip.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"files": [
"contracts/src/v0.8/ccip/pools/UpgradeableLockReleaseTokenPool.sol",
"contracts/src/v0.8/ccip/pools/GHO/UpgradeableLockReleaseTokenPool.sol",
"certora/harness/SimpleERC20.sol"
],
"link": [
Expand All @@ -12,6 +12,7 @@
"smt_timeout": "600",
"solc": "solc8.10",
"verify": "UpgradeableLockReleaseTokenPool:certora/specs/ccip.spec",
"rule_sanity": "basic",
"msg": "CCIP"
}

35 changes: 35 additions & 0 deletions certora/specs/ccip.spec
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,38 @@ rule provideLiquidity_correctness(env e) {
assert e.msg.sender == getRebalancer();
assert (to_mathint(bal_after) == bal_before + amount);
}


/* ==============================================================================
rule: only_lockOrBurn_can_increase_currentBridged
============================================================================*/
rule only_lockOrBurn_can_increase_currentBridged(env e) {
method f;
calldataarg args;

uint256 curr_bridge_before = getCurrentBridgedAmount();
f (e,args);
uint256 curr_bridge_after = getCurrentBridgedAmount();

assert
curr_bridge_after > curr_bridge_before =>
f.selector==sig:lockOrBurn(address,bytes calldata,uint256,uint64,bytes calldata).selector;
}


/* ==============================================================================
rule: only_releaseOrMint_can_deccrease_currentBridged
============================================================================*/
rule only_releaseOrMint_can_decrease_currentBridged(env e) {
method f;
calldataarg args;

uint256 curr_bridge_before = getCurrentBridgedAmount();
f (e,args);
uint256 curr_bridge_after = getCurrentBridgedAmount();

assert
curr_bridge_after < curr_bridge_before =>
f.selector==sig:releaseOrMint(bytes memory,address,uint256,uint64,bytes memory).selector;
}

0 comments on commit ffbda1f

Please sign in to comment.