mirror of
https://github.com/vacp2p/staking-reward-streamer.git
synced 2026-01-08 20:48:00 -05:00
test(certora): Karma.totalDistributorAllocation can only increase (#166)
This commit is contained in:
@@ -2,10 +2,10 @@ using Karma as karma;
|
||||
|
||||
methods {
|
||||
function owner() external returns (address) envfree;
|
||||
function totalDistributorAllocation() external returns (uint256) envfree;
|
||||
}
|
||||
|
||||
// TODO:
|
||||
// totalDistributorAllocation can only increase
|
||||
// totalDistributorAllocation == sum of all distributor allocations
|
||||
// sum of external supply <= total supply
|
||||
|
||||
@@ -44,3 +44,20 @@ rule ownableFuncsOnlyCallableByOwner(method f) {
|
||||
|
||||
assert isOwnableFunction(f) && !isOwner => isReverted;
|
||||
}
|
||||
|
||||
rule totalDistributorAllocationCanOnlyIncrease(method f) filtered { f ->
|
||||
f.selector != sig:karma.upgradeToAndCall(address, bytes).selector
|
||||
&& !isERC20TransferFunction(f)
|
||||
} {
|
||||
env e;
|
||||
calldataarg args;
|
||||
|
||||
|
||||
uint256 totalDistributorAllocationBefore = totalDistributorAllocation();
|
||||
|
||||
f(e, args);
|
||||
|
||||
uint256 totalDistributorAllocationAfter = totalDistributorAllocation();
|
||||
|
||||
assert totalDistributorAllocationAfter >= totalDistributorAllocationBefore;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user