
Subscribe to zhijie

Subscribe to zhijie
Share Dialog
Share Dialog
<100 subscribers
<100 subscribers
It has been 3yr+ since my last time when I played with smart contract. Ethereum dev toolchain has been evolved so much. I want to refresh my memory of how to create and deploy a contract.
I chose to create my CC0 Moonbirds contract on the testnet:
Why Moonbirds? See my logo, lol.
Why could it be a CC0 moonbirds contract? See this tweet.
Download moonbirds.sol from Etherscan (surprisingly found Etherscan can now show the contract code directly), and copy it into remix.ethereum.org. I made following changes to the code:
I changed the order of inheritance list, ERC2981 needs to be the first to be able compile (nah, you know solidity has problems).
contract Moonbirds is
ERC2981,
ERC721ACommon,
BaseTokenURI,
FixedPriceSeller,
AccessControlEnumerable
Remove the proof contract dependency, and remove the restriction of minting a token.
Set mint prices and loyalties all to 0, and simply constructor/public methods to use msg.sender as much as possible.
Now I have my CC0 Moonbirds contract (complete code here).
Now I can use Remix to deploy the contract to a testnet. I chose Rinkeby, but it should the same for other testnets. One prerequisite thing to do is to get test token from faucet:
In Remix, I compile the contract, and deploy it by choosing Injected Provider - Metamask.
After successful deployment, I need also set base URI for tokens. The URI could be copied from official Moonbirds contract. I reuse this URI for my contract and set the URI of my contract via Remix.
Another special thing about Moonbirds contract is nesting. This needs to be enabled in the contract.
Now we have a ready contract for people to mint NFTs.
I switch to another account, and mint twice (1, 2). In Remix, you could execute read API call to peek the token URI.
https://live---metadata-5covpqijaa-uc.a.run.app/images/0
https://live---metadata-5covpqijaa-uc.a.run.app/images/1
Then I nest both birds. Hoot hoot!
I’m happy that I still remember most steps of building a smart contract. With the involved toolchain, making a ERC-721 contract wouldn’t take more than an hour. However, all the heavy lifted work will be building the ecosystem around the PFPs. Let’s see how well Proof team could do:-)
It has been 3yr+ since my last time when I played with smart contract. Ethereum dev toolchain has been evolved so much. I want to refresh my memory of how to create and deploy a contract.
I chose to create my CC0 Moonbirds contract on the testnet:
Why Moonbirds? See my logo, lol.
Why could it be a CC0 moonbirds contract? See this tweet.
Download moonbirds.sol from Etherscan (surprisingly found Etherscan can now show the contract code directly), and copy it into remix.ethereum.org. I made following changes to the code:
I changed the order of inheritance list, ERC2981 needs to be the first to be able compile (nah, you know solidity has problems).
contract Moonbirds is
ERC2981,
ERC721ACommon,
BaseTokenURI,
FixedPriceSeller,
AccessControlEnumerable
Remove the proof contract dependency, and remove the restriction of minting a token.
Set mint prices and loyalties all to 0, and simply constructor/public methods to use msg.sender as much as possible.
Now I have my CC0 Moonbirds contract (complete code here).
Now I can use Remix to deploy the contract to a testnet. I chose Rinkeby, but it should the same for other testnets. One prerequisite thing to do is to get test token from faucet:
In Remix, I compile the contract, and deploy it by choosing Injected Provider - Metamask.
After successful deployment, I need also set base URI for tokens. The URI could be copied from official Moonbirds contract. I reuse this URI for my contract and set the URI of my contract via Remix.
Another special thing about Moonbirds contract is nesting. This needs to be enabled in the contract.
Now we have a ready contract for people to mint NFTs.
I switch to another account, and mint twice (1, 2). In Remix, you could execute read API call to peek the token URI.
https://live---metadata-5covpqijaa-uc.a.run.app/images/0
https://live---metadata-5covpqijaa-uc.a.run.app/images/1
Then I nest both birds. Hoot hoot!
I’m happy that I still remember most steps of building a smart contract. With the involved toolchain, making a ERC-721 contract wouldn’t take more than an hour. However, all the heavy lifted work will be building the ecosystem around the PFPs. Let’s see how well Proof team could do:-)
No activity yet