Skip to content
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

Open
wants to merge 29 commits into
base: feat/capped-minter-v2-close
Choose a base branch
from

Conversation

marcomariscal
Copy link

No description provided.

@marcomariscal marcomariscal linked an issue Dec 4, 2024 that may be closed by this pull request
5 tasks
@marcomariscal marcomariscal force-pushed the feat/capped-minter-v2-close branch from 3fcf95b to bceb0f7 Compare December 4, 2024 23:21
// 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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could uint48 work?

Copy link
Author

@marcomariscal marcomariscal Dec 12, 2024

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);
Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Author

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

Copy link
Author

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

and here actually:

70b49f0

Copy link
Author

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:

4b8499f


ZkCappedMinterV2 cappedMinter = createCappedMinter(_admin, _cap);
ZkCappedMinterV2 cappedMinter = _createCappedMinter(_admin, _cap, _startTime, _expirationTime);
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time Controls
2 participants