Search code examples
solidityetherscan

Etherscan/Ftmscan input formatting -- address[][]


I'm trying to interact with a contract on the contract tab of Ftmscan. The function accepts an address[][] type as input, and I'm having trouble formatting this type of input. It keeps complaining about array/string formatting and I'm not sure what the correct way to do it is. I've tried the following based on looking at past interactions with the function via ethers.js:

  [
    [
      '<address1>',
      '<address2>'
    ]
  ]

Yet no luck, tried mixing around quote types and still no luck. What is the correct way? I see other unresolved threads about this out there and it's strange that something so simple has no answer?


Solution

  • Found an (unsatisfying) answer:

    Apparently FTMscan/Etherscan and similar don't support multidimensional array input. Source: I was told this by a dev for a prominent Fantom project. If anyone knows any better feel free to pipe up but I'll mark this as answered.

    If you're comfortable using Web3/Ethers.js you can just use their encoders to create a transaction with address[][] inputs.