used https://wizard.openzeppelin.com/#erc1155 to create erc1155 contract
then clicked the button Open in Remix
Compiled it without problems
then did Deploy & run transactions
contract was deployed
when I click on the orange Mint button what do I need to enter for id, amount, data fields? please see the attached
thanks
ID is the token ID that you want to mint, OZ by default doesn't have any checks for maximum mint, you can add your custom logic about who can mint or how much can be minted.
Amount is the number of tokens of that particular ID to be minted.
For example you pass:
account : your address
id : 1
amount: 23
This means your address will get 23 tokens of ID 1.
The data field is there for any additional functionality that you can ignore if you don't have any use case. By ignore I meant passing an empty bytes, like 0x
Thanks for ur reply.
the problem was I was not entering a valid value like 0x that u mentioned in the data field
No problems minting, For burnBatch I get the error below, what would be valid values for ids and values fields?
transact to Scorpy1155.burnBatch errored: Error encoding arguments: Error: expected array value (argument=null, value="1", code=INVALID_ARGUMENT, version=abi/5.7.0)
You are calling the burnBatch
function. This is supposed to handle the burning of multiple token IDs at once, and this function accepts arrays as arguments not single uint values.
in this case ids would be [1]
and values would be [25]
.
But I would suggest you to use the burn
function instead when you are burning a single token id.
thanks
For burnBatch how do u enter arrays in fields ids & values? to burn multiple token IDs
Just like I wrote above.
For example:
ids = [1,2,3]
values = [25,18,17]
make sure the serial of values matches with the ids and the array length is same.
In the above example, 25 tokens of id 1
, 18 tokens of id 2
and 17 tokens of id 3
will be burned.
alright, thanks for ur help