forked from safe-global/safe-smart-account
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change Safe spec to Hash spec for more accurate naming
- Loading branch information
Derek Sorensen
authored and
Derek Sorensen
committed
Dec 19, 2024
1 parent
e15d1a2
commit 43f4cb1
Showing
3 changed files
with
46 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* A specification for the Safe setup function */ | ||
|
||
|
||
// ---- Methods block ---------------------------------------------------------- | ||
methods { | ||
function getThreshold() external returns (uint256) envfree; | ||
|
||
function SecuredTokenTransfer.transferToken(address token, address receiver, uint256 amount) internal returns (bool) => NONDET ; | ||
} | ||
|
||
// ---- Functions and ghosts --------------------------------------------------- | ||
|
||
|
||
// ---- Invariants ------------------------------------------------------------- | ||
|
||
|
||
// ---- Rules ------------------------------------------------------------------ | ||
|
||
/// @dev setup can only be called if threshold = 0 and setup sets threshold > 0 | ||
/// @status Done: https://prover.certora.com/output/39601/7849e9a464e042ea89bfe68fc226edbc?anonymousKey=5c1387afecb8bc86f23df3be5eb886a5cd82787f | ||
|
||
rule setupThresholdZeroAndSetsPositiveThreshold( | ||
address[] _owners, | ||
uint256 _threshold, | ||
address to, | ||
bytes data, | ||
address fallbackHandler, | ||
address paymentToken, | ||
uint256 payment, | ||
address paymentReceiver) { | ||
env e; | ||
|
||
uint256 old_threshold = getThreshold(); | ||
|
||
// a successful call to setup | ||
setup(e,_owners,_threshold,to,data,fallbackHandler, | ||
paymentToken,payment,paymentReceiver); | ||
|
||
uint256 new_threshold = getThreshold(); | ||
|
||
assert ( | ||
new_threshold > 0 && | ||
old_threshold == 0 | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.