I need to create an array of structs for a struct that looks like this:
struct myStruct {
address _address;
uint _num;
}
And I need to create the array from function args.
I'm doing this by using 2 params (address[]
& uint[]
) that represent the 2 struct members, and for looping through them to create the array of structs. Is there a simpler way?
Potentially using
ethers.utils.AbiCoder.prototype.encode(
['address', 'uint'],
[<address>, <number>]
);