1
votes

how can i pass array of 4 addresses manually to function is it possible? What should be syntax in remix function caller [address1,address2,address3,address4]?

[x0100000000000000000000000000000000000000000000000000000000,x0100000000000000000000000000000000000000000000000000000000,x0100000000000000000000000000000000000000000000000000000000,x0100000000000000000000000000000000000000000000000000000000]

function examplefunction(address[] memory array) public onlyOwner{

}

and i get in remix error: transact to Absorber.setTopTransactionsWinners errored: Error encoding arguments: Error: types/values length mismatch

1

1 Answers

1
votes

Your addresses are too long and incorrectly structured. Ethereum address is 20 bytes, so that's 40 hex characters after the 0x.

Example value that is accepted as address[] type in Remix:

["0x1000000000000000000000000000000000000000","0x1000000000000000000000000000000000000000","0x1000000000000000000000000000000000000000","0x1000000000000000000000000000000000000000"]