Skip to content
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

SmartContract: An NFT Contract that claim need to aprove by Contract Owner #14

Open
leeduckgo opened this issue May 27, 2022 · 1 comment

Comments

@leeduckgo
Copy link
Contributor

ERC721Enumable

function:

claim(ar_link)

After user claim, need owner to confirmed, to make the NFT is valid.

@kenspirit
Copy link
Contributor

kenspirit commented May 28, 2022

ar_link 是tokenURI

owner approve 后,再实际执行_mint,发行 NFT。

把 transfer方法也改一下,就是namecard 不能 transfer 给别人,只能 burn 到 0x0 地址

用这个ar_link 拼接处一个符合 OpenSea 规范的 JSON,存成 tokenURI

https://github.com/qiwihui/scaffold-eth/blob/loogies-svg-nft/packages/hardhat/contracts/YourCollectible.sol

string(
              abi.encodePacked(
                'data:application/json;base64,',
                Base64.encode(
                    bytes(
                          abi.encodePacked(
                              '{"name":"',
                              name,
                              '", "description":"',
                              description,
                              '", "external_url":"https://burnyboys.com/token/',
                              id.toString(),
                              '", "attributes": [{"trait_type": "color", "value": "#',
                              color[id].toColor(),
                              '"},{"trait_type": "chubbiness", "value": ',
                              uint2str(chubbiness[id]),
                              '}], "owner":"',
                              (uint160(ownerOf(id))).toHexString(20),
                              '", "image": "',
                              'data:image/svg+xml;base64,',
                              image,
                              '"}'
                          )
                        )
                    )
              )
          );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants