-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
When I call the function below on otp mainnet, it fails and returns
ContractPanicError: ('Panic error 0x11: Arithmetic operation results in underflow or overflow.', '0x4e487b710000000000000000000000000000000000000000000000000000000000000011')
I think it's because node.operatorFeeCumulativeEarnedRewards is zero (we have none of them in v8), while node.operatorFeeCumulativePaidOutRewards is non-zero (fee were transferred from v6 and i restaked 1 TRAC from them). So the result is negative and it makes the contract sad.
function getNodeOperatorFeesInfo(uint72 identityId) external view returns (uint96, uint96, uint96) {
StakingLib.NodeData memory node = nodes[identityId];
return (
node.operatorFeeBalance,
node.operatorFeeCumulativeEarnedRewards - node.operatorFeeCumulativePaidOutRewards,
node.operatorFeeCumulativePaidOutRewards
);
}
Metadata
Metadata
Assignees
Labels
No labels