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

Add first version of PBTRandom #26

Merged
merged 13 commits into from
Nov 3, 2022
Merged

Add first version of PBTRandom #26

merged 13 commits into from
Nov 3, 2022

Conversation

cygaar
Copy link
Collaborator

@cygaar cygaar commented Nov 1, 2022

This implementation of IPBT pseudorandomly selects a tokenId (using the Fisher-Yates shuffle algorithm) to mint to a chip address instead of having the chipAddress => tokenId mapping seeded by the contract owner. This implementation relies on the supply of the token to be set upon contract deploy. All other functionality is identical to PBTSimple.

Gas optimizations will be added in a follow up PR.

src/PBTRandom.sol Outdated Show resolved Hide resolved
src/PBTRandom.sol Show resolved Hide resolved
@cygaar cygaar requested a review from 2pmflow November 1, 2022 05:15
src/PBTRandom.sol Show resolved Hide resolved
src/PBTRandom.sol Outdated Show resolved Hide resolved
src/PBTRandom.sol Show resolved Hide resolved
src/PBTRandom.sol Outdated Show resolved Hide resolved
@cygaar cygaar requested a review from 2pmflow November 2, 2022 03:07
@cygaar cygaar merged commit 6be7b3e into main Nov 3, 2022
@cygaar cygaar deleted the pbtrandom branch November 3, 2022 16:32
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.

2 participants