cosmwasm
cosmwasm copied to clipboard
research: how to get another contract's code id / how to approve contract with admin in cw721
In cw721 (https://github.com/CosmWasm/cw-nfts/blob/main/packages/cw721/README.md), users can approve that some contracts operate some tokens. But the admin of a specified contract can change the contract code (logic) by migrating the contract. In other words, approving a contract to operate a token by its logic means approving the owner to operate a token at their will by migration.
So,
- if a contract can get another contract's code id info, make cw721 to approve (contract address, code id) instead of contract address.
- If contracts cannot get the code id of another contract, consider how to solve it