-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: capped minter v2 time controls #13
base: feat/capped-minter-v2-close
Are you sure you want to change the base?
feat: capped minter v2 time controls #13
Conversation
3fcf95b
to
bceb0f7
Compare
// Using uint32 for time controls to prevent overflows in the ZkToken contract regarding block numbers needing to be | ||
// casted to uint32. | ||
_startTime = bound(_startTime, vm.getBlockTimestamp(), type(uint32).max - 1); | ||
_expirationTime = bound(_expirationTime, _startTime + 1, type(uint32).max); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could uint48 work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried, but doesn't work cuz of the block num casting
uint256 _invalidExpirationTime | ||
) public { | ||
_cap = bound(_cap, 0, MAX_MINT_SUPPLY); | ||
_startTime = bound(_startTime, vm.getBlockTimestamp() + 1, type(uint256).max - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would warp to a random time and then make startTime block.timestamp + 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And apply a similar idea to the next test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would warp to a random time and then make startTime block.timestamp + 1
i reworked this test to be more clear: d1a7306
lemme know how that works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here i made updates too:
|
||
ZkCappedMinterV2 cappedMinter = createCappedMinter(_admin, _cap); | ||
ZkCappedMinterV2 cappedMinter = _createCappedMinter(_admin, _cap, _startTime, _expirationTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example where maybe moving this to a helper could make things a little cleaner
No description provided.