Search code examples
javascriptethereumsolidityetherscan

How to pass array of structs as argument on etherscan (tuple[])?


I'm trying to pass the format of array of structs as argument on smart contract write function on etherscan,

This is solidity example:

Info[] public info;

struct Info { 
    address userAddress;
    uint256 amount;   
    bool active; 
} 

enter image description here Javascript example:

const data = [{0x0000, 10000000000, false},{0x11111, 20000000000, true}]

Can anyone convert this data example to tuple[] and provide it? Thanks in advance


Solution

  • You must add the value in Etherscan input like this:

    [["0x0000", "10000000000", false],["0x11111", "20000000000", true]]