In a similar fashion to grantRewards, a function is needed to refund validator exits. This cannot be the same as grantRewards because it should not increase the value of elastic balance based on the value sent and should account for slashing.
Related to https://github.com/manifoldfinance/mevETH2/issues/27
Solution
Function or receive acceptance of eth from validator exits. e.g.
/// @notice grant validator exit funds (32 eth) refunded to contract
function grantExit() external payable onlyOperator {
if (msg.value == 0) {
revert MevEthErrors.ZeroValue();
}
if (msg.value < 32 ether) {
// assume slashed value so reduce elastic balance accordingly
assetRebase.elastic -= (32 ether - msg.value);
} else {
// account for any unclaimed rewards
assetRebase.elastic += (msg.value - 32 ether);
}
}
This is also related to manifoldfinance/mevETH2#22 (ideally these events are necessary for contract observability outside the EVM and probably used by the mevETH-controller repository).
Problem
In a similar fashion to
grantRewards
, a function is needed to refund validator exits. This cannot be the same as grantRewards because it should not increase the value of elastic balance based on the value sent and should account for slashing. Related to https://github.com/manifoldfinance/mevETH2/issues/27Solution
Function or receive acceptance of eth from validator exits. e.g.