I am trying to get the output array 'stakings' from the TokenFarm.sol file, using the following way
const tx = await tokenFarm
.connect(address1)
.stakeTokens({ value: ethers.utils.parseEther("1.0") });
const stakings = await tokenFarm.stakings();
console.log(stakings)
Here is the stakings array defined in my contract
struct Stake {
uint256 id;
address person;
uint256 amount;
uint256 createdAt;
}
mapping (uint256 => Stake) public idToStake;
mapping(address => Stake[]) public userToStakes;
Stake[] public stakings;
address[] public stakers;
IERC20 public gvToken;
But I am not able to get the expected array value as output in my js file, I am getting this following error:
missing argument: passed to contract (count=0, expectedCount=1, code=MISSING_ARGUMENT, version=contracts/5.6.0)