Skip to content

Commit

Permalink
feat: initial Certora development
Browse files Browse the repository at this point in the history
  • Loading branch information
QGarchery committed Aug 8, 2023
1 parent 7a7b0f3 commit 930fb5f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ docs/
# Node modules
/node_modules

# Certora
.certora**

# Hardhat
/types
/cache_hardhat
Expand Down
12 changes: 12 additions & 0 deletions certora/scripts/verifyBlue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

certoraRun \
src/Blue.sol \
--verify Blue:certora/specs/Blue.spec \
--solc_allow_path src \
--solc solc \
--loop_iter 3 \
--optimistic_loop \
--msg "Blue" \
--send_only \
"$@"
17 changes: 17 additions & 0 deletions certora/specs/Blue.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
methods {
function supply(Blue.Market, uint256 amount) external;


function _.borrowRate(Blue.Market) external returns (uint256) => DISPATCH(true);

function _.safeTransfer(address, uint256) internal returns (bool) envfree => DISPATCH(true);
function _.safeTransferFrom(address, address, uint256) internal returns (bool) envfree => DISPATCH(true);
}

rule supplyRevertZero(Blue.Market market) {
env e;

supply@withrevert(market, 0);

assert lastReverted;
}

0 comments on commit 930fb5f

Please sign in to comment.