Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

AuctionFixed.sol in Tutorial 6 #3

Open
Roy-Certora opened this issue Mar 22, 2022 · 0 comments
Open

AuctionFixed.sol in Tutorial 6 #3

Roy-Certora opened this issue Mar 22, 2022 · 0 comments
Labels
help wanted Extra attention is needed invalid This doesn't seem right

Comments

@Roy-Certora
Copy link

Roy-Certora commented Mar 22, 2022

The tutorial demonstrates that the BoundedSupply rule is violated if the prize is high enough such that the total supply reaches it's maximum value after the minting invocation. The suggested fix is to add a restriction :
//check that supply is not close to reach a limit, there should be enough to close another similar auction
require(auctions[id].prize.safeAdd(auctions[id].prize) + getTotalSupply() >= getTotalSupply());

It seems that the restriction checks if 2 * Prize + Supply > Supply instead of Prize + Supply.
What am I missing here?
Isn't the required fix for this rule is to check whether safeAdd(Prize,TotalSupply) < MAX_INT?

@Roy-Certora Roy-Certora added help wanted Extra attention is needed invalid This doesn't seem right labels Mar 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant