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

Full review #13

Closed
wants to merge 63 commits into from
Closed

Full review #13

wants to merge 63 commits into from

Conversation

TomiOhl
Copy link
Collaborator

@TomiOhl TomiOhl commented Nov 3, 2023

The whole codebase on main up until e7b5914 + #12. This should be the final form of the contract for v1.3.0.

Note: this branch should not be merged. Any change should go into a separate PR.

This should be reverted when I solve the upgradeability of ChainlinkClient.sol
Needed until there is no official upgradeable version of ChainlinkClient
To be added in follow-up commits:
- oracle fee compensation
- proper tests
- updated docs
- updated deploy addresses
If the access is false, we still keep the fee - everything should be validated on frontend, so this shouldn't happen unintentionally.
Minimizes the risk of someone draining the contract's link balance - it will cost more for them to make unsuccessful requests.
Plus some refactor
TomiOhl added 25 commits May 5, 2023 11:24
* Add metadata-storage doc

* Adjust wording
* Generate metadata in the contract, update signing

* Add ranking

* Revert changes to the deploy script

* Document the process we are doing

* Abitility to change name and symbol on upgrade
With a test

* Rename current metadata update function

* Fix tests

* Handle/upgrade existing metadata

* Deploy new version to mumbai

* Rank should be a string
To appear better on Opensea

* Update test

* Rename to Guild Pin

* Remove deployment on Sepolia
It wasn't the same as v1 on other chains anyways

* Update on Mumbai

* Backfill all metadata

* Upgrade on Mumbai

* Improve documentation

* Improve post stealth launch doc

* Add migration plan

* Update formatting

* Initialize totalMintedPerGuild

* Test deploy

* Add test for pretty strings

* Remove log
* Add chainId and contract address to the signature

* Improve docs

* Deploy to Mumbai

* Upgrade OpenZeppelin contracts
npm audit fix

* Update docs

* Deploy to Arbitrum

* Deploy to BSC

* Upgrade on Polygon
* Disallow claiming tokens twice for the same userId

* Update docs

* Really test what we intended
And rename mainnet to ethereum
* Implement EIP-5192

* Add tests

* Locked function should throw for non-existent tokens

* Update docs
Copy link

@seanmc9 seanmc9 left a comment

Choose a reason for hiding this comment

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

Looking really great! A lot of the same code as guildxyz/nft-reward-factory#5, so still looking good there. Just have this one comment on making error catching more explicit/immediately visible in the code but otherwise looks great!

}

function burn(uint256 userId, GuildAction guildAction, uint256 guildId) external {
uint256 tokenId = claimedTokens[msg.sender][guildAction][guildId];
Copy link

Choose a reason for hiding this comment

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

Might want to consider having an explicit check or error here to make it clear what went wrong if someone tries to erroneously burn a token.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wrote a test to see better what happens here: 79d5059
I could revert with a custom error here (I already have a NonExistentToken error in the codebase, or come up with a new one), however, I don't think that would really be an improvement over the current situation (and not worth the ~8k gas extra).
You might say that since the revert comes from the underlying dependency, it might change just from a dependency update, but I will notice that now thanks to the test. Thanks for bringing this to my attention!

Copy link

Choose a reason for hiding this comment

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

Yeah, that makes sense! And for sure!

@TomiOhl
Copy link
Collaborator Author

TomiOhl commented Nov 14, 2023

Closing the review session, thanks Sean!

@TomiOhl TomiOhl closed this Nov 14, 2023
@TomiOhl TomiOhl deleted the review branch November 14, 2023 23:48
@TomiOhl TomiOhl mentioned this pull request Nov 15, 2023
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