Call Functions With Parameters

Published by Marianne Poser on

1st Step: For checking the mint operations in the constructor, the balanceOf function can be used. Here, an address must be specified as a parameter – in this case, the address of the creator of the contract, which can be copied from the “Account” field.

2nd Step: By expanding the parameters, the address can now be entered, and the parameter id can also be specified. The button “call” triggers the function, and the answer appears again below the line.

3rd Step: As already explained in the theory section, the ERC1155 has batch functions, and these will also be tested here. For the query of the balance of the TokenID 0 and 3 the address (in each case in double quotes, separated by comma!) must be entered twice into the array “accounts” and [0,3] as array into the field ids. As answer you get an array with the number of tokens with ID 0 and the number of tokens with ID 3.

Categories: