-
Notifications
You must be signed in to change notification settings - Fork 142
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
Remaining Audit Fixes & Factory Pattern #750
Conversation
0b90b8e
to
c20cce1
Compare
Needed for workspace optimizer as we are now using test contract binaries with tests
c20cce1
to
d64fbeb
Compare
# This is the 1st commit message: Simpler NFT factory test # The commit message #2 will be skipped: # f
Context: after speaking with the team, they want all NFTs on the platform to utilize the fairburn mechanism. In addition, many artists creating new collections on Stargaze also want to create a minter for that collection to allow for sales. The factory pattern now allows for both.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## development #750 +/- ##
===============================================
- Coverage 96.65% 96.35% -0.30%
===============================================
Files 186 203 +17
Lines 48253 49499 +1246
===============================================
+ Hits 46637 47697 +1060
- Misses 1616 1802 +186
☔ View full report in Codecov by Sentry. |
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
…add tests We now validate supply regardless of what ActiveThreshold is set to.
Ownship transfer process is two steps now, so the DAO needs to accept the ownership transfer.
75c6d56
to
9cd3ee6
Compare
- Extends dao-test-custom-factory to mint NFTs - Validate ActiveThreshold in NFT factory test contract - Add ModuleInstantiateCallback to nft factory call backs - Fix transfer ownership in factory test contract - Add ModuleInstantiateCallback to nft factory callbacks - Test ownership set correctly in token factory factory - Test for module instantiate callback in NFT factory - Include note that custom factory contracts MUST handle validation logic The most important change here is the that both `dao-voting-cw721-staked` and `dao-voting-token-staked` implement ModuleInstantiateCallback now, which allows for more complicated setup possibilities.
9cd3ee6
to
ced780c
Compare
ced780c
to
6f40ceb
Compare
5a046ee
to
ac1667c
Compare
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.
NOICE
Addresses a few of the remaining audit fixes, but more importantly solves a blocker for both Stargaze NFT DAOs as well as potentially future Token Factory DAOs. The Stargaze team requested that NFT creation honor would honor the fairburn mechanism.
This is made possible by the factory pattern: creating Token or NFT DAO tokens by calling into a factory contract that does validation as well as returning required information to implement the voting module.
For example, as a user I want to sell a collection on Stargaze and use that collection and the proceeds from it to create and fund a DAO (with the DAO as the creator of the collection).
This "factory pattern" feature is intended to work with minters such as Stargaze minters or the WIP Augmented Bonding Curve tokens (or potentially other tokens such as LP tokens) which require a more complicated setup process. For these types of projects, the token is created through another contract that manages its issuance, the factory pattern is designed to support this. Factory contracts MUST set
TokenFactoryCallback
orNftFactoryCallback
in the response.An important note on security: as validation SHOULD happen in the factory contracts, it's important to rely only trusted factory contracts.
Overview of changes:
ModuleInstantiateInfo
now takes afunds
argument so that factories that require funds (such as one using Stargaze fairburn) can be supported.dao-test-custom-factory
has been created for testing factory patterns as well as demonstrating how to build a custom factory.test-contracts
have been moved inside thecontracts/test
folder so they can be built with theworkspace-optimizer
dao-voting-cw721-staked
, and fix a bug whereby one could update the threshold to be greater than supply