try to hook on _funds. fixed required

This commit is contained in:
Aleksander Kryukov 2025-04-06 00:39:55 +01:00 committed by Mark Spanbroek
parent b5ab3869b9
commit ae94d1ebf3
3 changed files with 61 additions and 0 deletions

28
certora/confs/Vault.conf Normal file
View File

@ -0,0 +1,28 @@
{
"files": [
"contracts/Vault.sol",
// "certora/harness/MarketplaceHarness.sol",
// "contracts/Marketplace.sol",
// "contracts/Vault.sol",
// "contracts/Groth16Verifier.sol",
"certora/helpers/ERC20A.sol",
],
"parametric_contracts": ["Vault"],
"link" : [
"Vault:_token=ERC20A",
// "MarketplaceHarness:_vault=Vault",
// "MarketplaceHarness:_verifier=Groth16Verifier"
],
"packages": [
"@openzeppelin/=node_modules/@openzeppelin/",
],
"msg": "Verifying Vault",
"rule_sanity": "basic",
"verify": "Vault:certora/specs/Vault.spec",
// "optimistic_loop": true,
"loop_iter": "3",
// "optimistic_hashing": true,
// "hashing_length_bound": "512",
"solc": "solc8.28",
}

29
certora/specs/Vault.spec Normal file
View File

@ -0,0 +1,29 @@
methods {
}
rule sanity(env e, method f) {
calldataarg args;
f(e, args);
satisfy true;
}
// ghost mapping(Vault.Controller => mapping(Vault.FundId => Vault.Timestamp)) ghostName;
// init_state axiom forall uint256 a. ghostName[a] == 0;
ghost mapping(VaultBase.Controller => mapping(VaultBase.FundId => VaultBase.Timestamp)) ghostName {
init_state axiom forall VaultBase.Controller controller. forall VaultBase.FundId fundId. ghostName[controller][fundId] == 0;
}
// mapping(Controller => mapping(FundId => Fund)) private _funds;
hook Sload VaultBase.Timestamp defaultValue _funds[KEY VaultBase.Controller Controller][KEY VaultBase.FundId FundId] {
require ghostName[Controller][FundId] == require_uint40(defaultValue);
}
// (∀ controller Controller, fundId FundId:
// fund.lockExpiry <= fund.lockMaximum
// where fund = _funds[controller][fundId])
// STATUS - in progress
// invariant lockExpiryLELockMaximum()

4
remappings.txt Normal file
View File

@ -0,0 +1,4 @@
@ensdomains/=node_modules/@ensdomains/
@openzeppelin/=node_modules/@openzeppelin/
hardhat-deploy/=node_modules/hardhat-deploy/
hardhat/=node_modules/hardhat/