Closed larry0x closed 1 year ago
It seems for some reason, using #[serde(untagged)]
(the approach suggested by this PR) introduces float operators into the wasm build. ??
@larry0x I had this issue a while back. It's because serde includes a debug/log function that handles an f64 value in one of the match arms. You can get around it by writing a custom serializer.
@larry0x I had this issue a while back. It's because serde includes a debug/log function that handles an f64 value in one of the match arms. You can get around it by writing a custom serializer.
Yes this is a known issue: https://github.com/CosmWasm/serde-json-wasm/issues/43
This is an alternative approach to #42 and #91 on how to extend the CW-721 contract.
There are three approaches on how a custom NFT contract can inherit/extend the base cw721 contract:
Comparison
In this section, we use an example to compare the three approaches.
Terminology: Let's say the contract being extended is the "parent" contract, while the contract extending it is the "child" contract.
For this example, we use
cw721-base
as the parent, andcw2981-royalties
as the child.cw2981
wants to extendcw721-base
's query message by adding a custom method,royalty_info
.42
cw721-base/src/msg.rs
cw2981-royalties/src/msg.rs
cw2981-royalties/src/contract.rs
90
cw721-base/src/msg.rs
cw2981-royalties/src/msg.rs
cw2981-royalties/src/contract.rs
This PR
The parent does not provide any special arrangement for the child.
cw721-base/src/msg.rs
cw2981-royalties/src/contract.rs
Overall, I feel this PR is the best solution