- Represent the identity of a connected device, such as a scooter, a drone or a charging station.
- Run DID whitelists where each person or machine is one token, which makes onboarding, access control and lifecycle management easier to track.
- Tokenize machine activity or certificates that attest to a capability.
Prerequisites
- You know what the EVM and smart contracts are, and you have deployed an ERC-20 token in Remix before (see Deploying ERC-20 Token).
- Remix is open in your browser and you know your way around it.
- MetaMask or another Web3 wallet is installed and connected to agung, or to a local chain such as Hardhat or Anvil.
Instructions
1. Obtain an ERC-721 Boilerplate
- Open the OpenZeppelin ERC-721 implementation.
- Your own contract imports it and inherits from it.
2. Create a New File in Remix
- In Remix, click on the File explorer icon (the first icon on the left) and create a new file named, for example,
MyFirstNFT.sol. - Paste this boilerplate ERC-721 contract into the file:
3. Fill in Relevant Details
Within the constructor and contract parameters, you can set:- Contract Name & Symbol: Choose a name that represents your NFT collection (e.g.,
MyFirstNFT) and a symbol (e.g.,MFN). - Base URI: OpenZeppelin’s
ERC721buildstokenURI(tokenId)from the internal_baseURI()function, which returns an empty string by default. Override it to point at where your metadata lives, for examplehttps://my-nft-metadata-api.com/metadata/. IPFS services such as Pinata can host that metadata off-chain. - Minting: the public
mintfunction has to be part of the contract before you deploy it. Add access control, for example OpenZeppelin’sOwnable, if not everyone should be able to mint.
4. Compile the Contract
- Click on the Solidity Compiler icon (usually the second icon on the left).
- Select Solidity 0.8.24 or later, which the OpenZeppelin 5
ERC721contracts require. - Click the Compile MyFirstNFT.sol button. Ensure there are no compilation errors.
5. Deploy the Contract
- Click on the Deploy & Run Transactions icon (usually the third icon on the left).
- In the Environment dropdown, select Browser Extension and pick MetaMask, which uses the network MetaMask is on.
- Click Deploy.
- Confirm the transaction in MetaMask. Once it is mined, the contract address appears in Remix’s deployed contracts section.
6. Minting and Interacting
- In Remix’s deployed contracts section, call your
mintfunction with the address that should receive the token. - After minting, read the token details with
ownerOf(tokenId)andtokenURI(tokenId)in Remix.
7. Testing & Next Steps
- Deploy on agung first and check that the token shows up on Subscan (agung).
- When the contract behaves the way you want, deploy the same contract on peaq mainnet and look it up on Subscan (peaq).

