Skip to content

Commit

Permalink
Merge pull request #24 from Certora/verification_stakingReward
Browse files Browse the repository at this point in the history
Verification staking reward
  • Loading branch information
kasperpawlowski authored Aug 7, 2024
2 parents 014e65e + 5196622 commit 21db65f
Show file tree
Hide file tree
Showing 15 changed files with 3,709 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ coverage/

# Invariant testing files
crytic-export/
_corpus/
_corpus/

# Certora verrifiction temp files
.certora_internal/
gambit_out/
collect.json
45 changes: 45 additions & 0 deletions certora/conf/StakingRewardStream.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"files": [
"src/StakingRewardStreams.sol",
"certora/harness/ERC20Caller.sol"
],
"packages": [
"evc=lib/ethereum-vault-connector/src",
"openzeppelin-contracts=lib/openzeppelin-contracts/contracts",
"forge-std=lib/forge-std/src"
],
"verify": "StakingRewardStreams:certora/specs/StakingRewardStreams.spec",
"solc": "solc8.23",
"rule_sanity": "basic",
"optimistic_loop": true,
"loop_iter": "3",
"parametric_contracts" : ["StakingRewardStreams","ERC20Caller"],

// Gambit config
"mutations": {
// Automatically generated mutations
"gambit": [
{
"filename": "src/StakingRewardStreams.sol",
"num_mutants": 2
},
{
"filename": "src/BaseRewardStreams.sol",
"num_mutants": 3
}
],
// Manual mutations
"manual_mutants": [
{
"file_to_mutate": "src/StakingRewardStreams.sol",
"mutants_location": "certora/mutations/staking/"
},
{
"file_to_mutate": "src/BaseRewardStreams.sol",
"mutants_location": "certora/mutations/base/"
}
],

"msg": "Mutations example"
}
}
11 changes: 11 additions & 0 deletions certora/harness/ERC20Caller.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pragma solidity ^0.8.20;

import {IERC20} from "openzeppelin-contracts/token/ERC20/IERC20.sol";


contract ERC20Caller {

function externalTransfer(IERC20 token, address to, uint256 amount) public {
token.transferFrom(msg.sender,to,amount);
}
}
Loading

0 comments on commit 21db65f

Please sign in to comment.