-
Notifications
You must be signed in to change notification settings - Fork 181
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
CW-1155 (and royalties extension) #162
Open
dirtyshab
wants to merge
59
commits into
public-awesome:main
Choose a base branch
from
palletexchange:cw1155
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix: batch events that involve multiple tokens will emit 1 event instead of multiple, with a comma delimited list of '{token_id}:{amount}'. fix: remove query IsApprovedForAll - too gas intensive, use query 'ApprovalsFor' instead. fix: verify_approval/s functions. chore: rename 'ApprovedForAll' to 'ApprovalsFor'. chore: TokenAmount struct instead of (token_id, amount) tuple vec. chore: use workspace deps in cargo.
…the standard, was incorrectly removed)
* feat: token_approvals map for approvals on specific tokens on a set amount. feat: removes previously set token approvals when transferring/burning * fix: decrement token approvals instead of removing if not expired and amount transferred is less than approved amount * feat: execute Approve/Revoke single methods * feat: Approvals query for approvals on a token owner
…r resemble standard, adds missing messages (todo - implement)
feat: uses cw_ownable for minter storage and auth.
fix: prev base tests.
… in query BalanceOfBatch
* rename states: tokens -> nft_info, contract_info -> collection_info * renamed structs and deprecate: TokenInfo -> NftInfo, ContractInfo -> CollectionInfo, ContractInfoResponse -> CollectionInfoResponse * cargo schema * change storage keys for collection info and nft info, consider in migration and keep legacy data for backward migration * use PA repo for `cw-ownable` * rename generics and make more readable * CollectionInfoResponse -> CollectionInfo * add CollectionInfoExtension with RoyaltyInfo * cargo schema * typo * cleanup * rename * cargo schema * cleanup * creator and owner changes: - new query GetMinterOwnership and GetCreatorOwnership, deprecated Ownership - new execute UpdateMinterOwnership and UpdateCreatorOwnership, deprecate UpdateOwnership - dedicated stores for minter and creator, where creator usess by default cw_ownable singleton! - new migrate msg allowing to reset creator and minter - cleanup migration and split legacy part to dedicated functions - also make sure using decicated CREATOR and MINTER stores and NOT use cw_ownable::... * refactor and move key logic to cw721 package: - move logic from cw721-base to cw721 - merge cw721-base and cw721-metadata-onchain into one, distinction is: `extension: T` where T for base contract is `type DefaultMetadataExtension = Option<Metadata>` - all logic now in default implementation for traits Cw721Execute and Cw721Query * fix ci * cargo fmt * cargo fmt + clippy * cargo fmt * cargo schema * cargo clippy * undo: do not rename token keys * fix unit test * remove useless generic `TMetadataResponse` * remove response structs to msg.rs * cargo schema * move to dedicated fn * docs * rename * cargo clippy * add build script * undo collection info extension and royalty info additions, will be added in next pr * cleanup * generate schemas for entry points, cleanup * update rustc 1.65 -> 1.71 * update cosmwasm version 1.2 -> 1.5, due to rustc compiler issues see also: CosmWasm/cosmwasm#1727 * update optimizer * update rustc 1.71 -> 1.78 * use optimizer * formatting * install rustup first * set $HOME/.cargo/env * install libgcc * install build-base * cleanup * cleanup * Sync cw1155 with upstream (#5) * wip: sync up cw1155 with upstream improvements from cw-awesome * fix build errors/tests --------- Co-authored-by: mr-t <[email protected]>
dirtyshab
commented
Jul 9, 2024
…ase api but method is available to be added to extensions if required
…k the extension msg? not sure why it was moved to root of query msg, which breaks existing cw2981s)
… returns total count of owners for that token id
… balance / approved balance
dirtyshab
changed the title
cw1155-base, cw1155-metadata-onchain, cw1155-royalties
CW-1155 (and royalties extension)
Aug 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a basic implementation of ERC-1155 Multi Token Standard, along with the following extensions:
References:
Some context on the history and current state of development:
This PR continues where PR #78 left off. That implementation had most of the key parts of the standard implemented but was missing some things and required minor fixes to logic.
This PR includes the following additions to the previous implementation by ALPAC-4:
MintBatch
: mint a batch of tokens.Approve
/Revoke
: grant/revoke approval on specific tokens and token balances (from cw721).ContractInfo
: query name/symbol of collection (from cw721).Ownership
: query contract admin (from cw721).AllTokenInfo
: query for paginated list of token infos (from cw721).Supply
: query total number of tokens minted (from cw721).{action}_single
and{action}_batch
. Batch events will also emit 1 event instead of multiple Single events.Updates to cw721:
TQueryExtensionMsg
added toCw721Contract
and relevant traits to handle query extension message