[Solved] Web3api run contract function unnamed params

how do i pass in params for contract functions with more than 1 unnamed parameter?

for example:

{"constant":true,"inputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"address","name":"","type":"address"}],"name":"rewardSupplySpeeds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}

for functions with only 1 unnamed parameter, we can pass in parameters like this {"": "value"}

you modify the abi so that those parameters have a name

you can try editing the ABI locally and give names to parameters.

But how did you define the contract function without using attribute names?

Modifying the ABI locally worked. thanks for the prompt replies.

@johnversus its pretty common to get unnamed parameters from abi retrieved with scanners. For example. https://snowtrace.io/address/0x5d52300fa52845874f06430c3b0db386aab877f9#code

1 Like