You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function reclaimDeposit(uint256grantNo) payableexternalonlyRole(FUNDER) {
require(msg.sender!=address(0), "This is not a valid address.");
Grant storage grant = grantById[grantNo];
// Remember to add in || in case block.timestamp > endTime but goal hasn't been reached. require((grant.endTime >=block.timestamp&& grant.goal > grant.grantBalance) || grant.goal > grant.grantBalance, "This campaign has ended and has met its fundraising goal.");
require(contributions[grantNo][msg.sender] >0, "You have not contributed to this campaign.");
uint256 _amount = contributions[grantNo][msg.sender];
contributions[grantNo][msg.sender] =0;
grant.grantBalance -= _amount;
payable(msg.sender).transfer(_amount);
}
And I am getting this error:
However the user calling the function has the required roles (FUNDER). My contract works when tested in remix so Im not sure what the issue is here. Additionally, I tested funder address and switched it from address(1) to address(grantFunder) and when it was set to the address of the contract it passed.
Any help with this would be great. Thanks!
UPDATE: I continued testing along and created a similar test to test Claiming a Grant as a grant recipient and received this error:
Happy to provide any additional context as needed. Thanks!
Yeah it's not immediately obvious which is why we are going to disallow those addresses for some cheatcodes. The only issue is that precompiles on other networks might occupy different addresses, so we'll have to think about that a bit 😄
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
What addresses are you using? Generally, you should only use addresses above
address(9), since the others are precompiles. See also #1228 and #1159