Skip to content

Commit

Permalink
env fix in Governance. passing run link in checkLiquidation_healthy_r…
Browse files Browse the repository at this point in the history
…everts
  • Loading branch information
andrew-certora committed Aug 12, 2024
1 parent 4f06340 commit ff0705c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions certora/specs/Governance.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ methods {
function _.transfer(address,uint256) external => DISPATCHER(true);
function _.transferFrom(address,address,uint256) external => DISPATCHER(true);

function checkAccountMagicValueMemory() external returns (bytes memory) envfree;
function checkVaultMagicValueMemory() external returns (bytes memory) envfree;

// Harness
function getAccountBalance(address) external returns (GovernanceHarness.Shares) envfree;
function getGovernorReceiver() external returns (address) envfree;
Expand All @@ -28,8 +31,8 @@ methods {
// We can't handle the low-level call in
// EthereumVaultConnector.checkAccountStatusInternal
// and so reroute it to RiskManager's status check with this summary.
function EthereumVaultConnector.checkVaultStatusInternal(address vault) internal returns (bool, bytes memory) with(env e) =>
CVLCheckVaultStatusInternal(e);
function EthereumVaultConnector.checkVaultStatusInternal(address vault) internal returns (bool, bytes memory) =>
CVLCheckVaultStatusInternal();

function _.invokeHookTarget(address caller) internal => NONDET;

Expand All @@ -43,9 +46,13 @@ function CVLCheckVaultStatusInternalBool(env e) returns bool {
return !lastReverted;
}

function CVLCheckVaultStatusInternal(env e) returns (bool, bytes) {
function CVLCheckVaultStatusInternal() returns (bool, bytes) {
// We need a new env for the first function.
// Since the vault calls the EVC, otherwise msg.sender
// would become the vault unless we declare a fresh environment.
env e;
return (CVLCheckVaultStatusInternalBool(e),
checkVaultMagicValueMemory(e));
checkVaultMagicValueMemory());
}


Expand Down
1 change: 1 addition & 0 deletions certora/specs/Liquidation.spec
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ rule checkLiquidation_healthy() {
assert maxYield == 0;
}

// passing run: https://prover.certora.com/output/65266/ed9699a14a114c0dbad76526a55ad493/?anonymousKey=f1f0a74c2c72ede7ce77f50fbf66541e8c4f03d7
rule checkLiquidation_healthy_reverts() {
env e;
address account;
Expand Down

0 comments on commit ff0705c

Please sign in to comment.