Huge newb here. I want to create multiple arrays that are fixed size arrays of two addresses, but I want to be able to append to the fixed size array from seperate addresses at different times, i.e. after I've switched accounts in Metamask. So from the UI I would click on the approve function that would add msg.sender to the fixed size array, and then once I switched accounts in metamask and clicked on the approve function again, it would add the new msg.sender to the array, giving me a list of arrays that looks like:
0: [msg.sender(from first appprover), msg.sender(from second approver)]
1: [msg.sender, msg.sender]
My current code looks like:
struct Approver {
uint id;
address approver;
}
Approver[] public approvers;
And the approve function would look like:
function approveTransfer() external {
...
approver.push(Approver(approver.length, msg.sender));
}
function ApproverList() external view returns(Approver[] memory) {
return approver;
}
This returns a list of arrays with one address, but I'm trying to get the two. Any help would be greatly appreciated!
I want to be able to append to the fixed size array
- that's an oxymoron. If it's fixed size, then you cannot append to it!