Complete the code to declare the ERC-1155 contract inheritance.
contract MyToken is [1] {
// contract code
}The ERC-1155 standard contract inherits from ERC1155 in Solidity.
Complete the code to mint a new token with a specific ID and amount.
function mintToken(address to, uint256 id, uint256 amount) public {
_mint(to, id, [1], "");
}The _mint function requires the amount of tokens to mint as the third argument.
Fix the error in the transfer function call by completing the missing argument.
safeTransferFrom(msg.sender, to, id, amount, [1]);The last argument is a bytes data parameter, usually an empty string "" when no data is sent.
Fill both blanks to create a mapping for balances of token IDs per address.
mapping(address => mapping(uint256 => [1])) private [2];
address or bool as the value type.The balances mapping stores the amount (uint256) of each token ID per address.
Fill all three blanks to implement a function that returns the URI for a given token ID.
function uri(uint256 [1]) public view override returns (string memory) { return string(abi.encodePacked([2], Strings.[3]([1]), ".json")); }
The function takes tokenId, concatenates baseURI with the string version of tokenId using toString, and adds the .json extension.