Closed taitruong closed 1 year ago
Question, why exactly is there a different repo for sg721 implementation? Seems like we have the base ics721 repo, but if the only difference between sg721 and cw721 implementation of ics721 is just the one line for instantiate message does it warrant an entire other repo?
Question, why exactly is there a different repo for sg721 implementation? Seems like we have the base ics721 repo, but if the only difference between sg721 and cw721 implementation of ics721 is just the one line for instantiate message does it warrant an entire other repo?
Good point. Was thinking about anyways putting sg-ics721-bridge
contract somewhere else. Not sure it should be in this repo, or rather in some other SG managed repo. Just let me know. For now I will move it here.
@humanalgorithm, sg-ics721-bridge
now moved to this repo. Description above updated:
Now there is the
sg-ics721-bridge
contract, only difference is, it uses sg721-base: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/contracts/sg-ics721-bridge/src/lib.rs#L80-L95Covered by this test: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/contracts/sg-ics721-bridge/src/testing/integration_tests.rs#L373-L404
This PR basically adopts design from cw721
and cw721-base
. Have a look for traits here:
https://github.com/CosmWasm/cw-nfts/blob/main/packages/cw721/src/traits.rs#L11-L18
Only difference here is, traits in ics721
package have default implementations.
This PR basically adopts design from
cw721
andcw721-base
. Have a look for traits here: https://github.com/CosmWasm/cw-nfts/blob/main/packages/cw721/src/traits.rs#L11-L18Only difference here is, traits in
ics721
package have default implementations.
We should consider renaming and follow same conventions as for:
cw721
packagecw721-base
contract.So we may want:
ics721
packageics721-base
contract (instead of cw-ics721-bridge
)All tests passed. Except e2e (not covered in CI) - as noted here: https://github.com/public-awesome/ics721/pull/67#discussion_r1312363232 Would be great if some Go expert may look into it. Wasm file for ics721-base is 507kB whilst cw721-base is 307 kB.
Main ICS721 logic has been moved to
ics721
package. Main changes are by defining a struct and 2 traits:Ics721Execute
: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/packages/ics721/src/execute.rs#L18Ics721Query
: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/packages/ics721/src/query.rs#L14Both traits provides default implementations. Especially this one is noteworthy - since it uses by default
cw721-base
: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/packages/ics721/src/execute.rs#L287-L295As a result the
ics721-base
contract itself is pretty simple, withlib.rs
using default trait implementations: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/contracts/ics721-base/src/lib.rsCovered by this test: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/packages/ics721/src/testing/integration_tests.rs#L327-L339
Now there is the
sg-ics721
contract, only difference is, it uses sg721-base: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/contracts/sg-ics721/src/execute.rs#L7-L22Covered by this test: https://github.com/arkprotocol/ark-ics721/blob/ics721-package/contracts/sg-ics721/src/testing/integration_tests.rs#L358-L375