You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
950 B
29 lines
950 B
import "erc20.spec"
|
|
|
|
methods {
|
|
onFlashLoan(address, address, uint256, uint256, bytes) => HAVOC_ALL
|
|
|
|
_burn(address account, uint256 amount) returns(bool) => specBurn(account, amount);
|
|
}
|
|
|
|
ghost mapping(address => uint256) trackedBurnAmount;
|
|
|
|
function specBurn(address account, uint256 amount) returns bool { // retuns needed to overcome current CVL limitations: "could not type expression "specBurn(account,amount)", message: A summary must return a simple type, but specBurn(account,amount) returns 'void'"
|
|
trackedBurnAmount[account] = amount;
|
|
return true;
|
|
}
|
|
|
|
|
|
// STATUS - verified
|
|
// fee + flashLoan amount is burned
|
|
rule letsWatchItBurns(env e){
|
|
address receiver; address token; uint256 amount; bytes data;
|
|
|
|
uint256 feeBefore = flashFee(e, token, amount);
|
|
|
|
flashLoan(e, receiver, token, amount, data);
|
|
|
|
uint256 burned = trackedBurnAmount[receiver];
|
|
|
|
assert to_mathint(amount + feeBefore) == burned, "cheater";
|
|
} |