Alchemy Week1 Hands-on

Step1 -Use OpenZeppelin to develop contracts

1. Go to the Wizard link of OpenZepplin and see the editor as shown below, similar to remix.

post image

2. Select the ERC721 button, fill in the name and abbreviation of the NFT in Name and Symbol, check Auto Increment Ids, Enumerable, , URI Storageand you can find that the code in the IDE on the right has also changed accordingly.

post image

Step2 -Modify the contract in remix

  1. At the top of OpenZepplin's Wizard editor, click the Open in Remixbutton , and the browser will automatically jump to our old friend remix IDE.

  2. Delete the keyword in line 17 onlyOwner, otherwise only the contract issuer can mint NFT.

post image

3. Fill in line 14 uint256 MAX_SUPPLY = 1000;to specify a maximum number of NFTs.

post image

4. Insert below the 18 lines of code . If require(_tokenIdCounter.current() <= MAX_SUPPLY, "Reached the cap");the number is exceeded, it cannot be mint any more.

post image

Step3 -Apply for an alchemy account and add Metamask's Rinkeby chain

1. Register an account on the alchemy.com website.

https://www.alchemy.com/

2. Go to Dashboard and click create app.

post image

3. Fill in Name, Description, Chain select Ethereum, Network select Rinkeby, and then click CREATE APP.

post image

4. Click VIEW KEY and copy the HTTPS URL

post image

5. Open the metamask wallet, click add network, fill in the relevant fields in sequence and save. This is the network established with its own RPC, which is different from the default RPC on chainlist.org. Those who are interested can also measure the speed of different nodes.

post image

6. Because the interaction needs to consume gas, it is necessary to obtain the test token ETH through the chainlink faucet. Through the link of faucet, you can enter to apply for tokens.

https://faucets.chain.link/rinkeby

Step4 -Deploy smart contracts in remix

1. Go back to the remix editor, in SOLIDITY COMPILER, select solidity version 0.8.4, and click the blue button of Comiple contract.

post image

2. Select the DEPLOY & RUN TRANSACTIONS tab, select Injected Provider - Metamask in ENVIRONMENT (note that the network selected in the metamask is Rinkeby, so remix will automatically recognize Rinkeby(4) Network), then Contract needs to select Alchemy - contract. sol file and click the Deploy button.

post image

3. Metamask dialog box will pop up, which will consume gas. Click OK. If the deployment is complete, you can see the Transaction of Contract Creation in etherscan.

Step5-Upload pictures and metadata to IPFS

The tutorial does not use the familiar IPFS, but uses filebase, so just follow the tutorial.

1. Register a new account on filebase.

https://filebase.com/

2. Select the Buckets tab on the left, and then click the Create Buckets button. The name cannot be repeated. It can only -be , and select IPFS for the network.

post image

3. Click to enter this Buckets, click Upload in the upper right corner, upload a picture, this picture is the picture after mint NFT. After clicking into this image, copy the link to the IPFS Gateway URL.

post image

4. Create a metadata.json file with IDE or txt file, copy the following code, and replace the URL of image with the one you just copied. After saving, also upload to Buckets.

{ 
  "description": "This NFT proves I've deployed an ERC721 smart contract on Rinkeby",
  "external_url": "https://alchemy.com",
  "image": "Imge URL",
  "name": "ERC721 KK", 
  "attributes": [
    {
      "trait_type": "Coolness", 
      "value": "A lot"
    }, 
    {
      "trait_type": "Website", 
      "value": "alchemy.com"
    }, 
    {
      "trait_type": "Token Standard", 
      "value": "ERC721"
    }]
  }

Copy the CID of the metadata.json file, which will be used later to build the NFT URI.

step6 Mint NFT

In the remix IDE, pull down to find the safeMint method, enter the wallet address in to, enter in uri ipfs://metadata.json‘s CID, click transact, and the metamask will pop up and click OK.

post image

step7 View NFT in OpenSea

Log in to the metamask wallet in the OpenSea testnet, and you can see the NFT you just mint, and the first NFT smart contract has been deployed.

step8 Submit the task on the official website and claim NFT

Submit the corresponding information in the official application website.

https://alchemyapi.typeform.com/roadtoweekone?typeform-source=docs.alchemy.com

Claiming Alchemy's NFT in the mintkudos website usually takes one day to one week to get the allowlist qualification.

https://mintkudos.xyz/claim/583

post image