In the statement campaign.donations.push(amount); I am getting the following error:
Member "push" not found or not visible after argument-dependent lookup in uint256.
What's the problem and how to fix it please ?
function donateToCampaign(uint256 _id) public payable {
uint256 amount = msg.value;
Campaign storage campaign = campaigns[_id];
campaign.donators.push(msg.sender);
campaign.donations.push(amount);
(bool sent, ) = payable(campaign.owner).call{value: amount}("");
if (sent) {
campaign.amountCollected = campaign.amountCollected + amount;
}
}
Campaign
,donations
. Is it an struct, a contract?