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
A similar discrepancy also exists for addOperator. The smart contract mentions that an operator is added (which makes sense based on the function name).
/// @notice Adds an operator for a delegator./// @param uncmpPubkey 65 bytes uncompressed secp256k1 public key./// @param operator The operator address to add.functionaddOperator(
bytescalldatauncmpPubkey,
addressoperator
) externalpayableverifyUncmpPubkeyWithExpectedAddress(uncmpPubkey, msg.sender) chargesFee {
emitAddOperator(uncmpPubkey, operator);
}
However, in the L1 code, there can only be ever one operator per delegator (stored in the k.DelegatorOperatorAddress map) and the current operator is overwritten whenever a new one is added.
Solution recommendation
If multiple operators should be supported, we recommend changing the L1 code and data structures to store all operators. If not, we recommend changing the smart contracts (function name + documentation for addOperator, removal of unnecessary event for removeOperator).
The text was updated successfully, but these errors were encountered:
Description and context
The smart contracts contain a function removeOperator that removes a specified operator (
story/contracts/src/protocol/IPTokenStaking.sol
Line 179 in f1b194c
However, the
operator
argument of the emitted event is completely ignored when this event is processed (story/client/x/evmstaking/keeper/delegator_address.go
Line 85 in 46dabe3
The code will just remove the current operator.
A similar discrepancy also exists for
addOperator
. The smart contract mentions that an operator is added (which makes sense based on the function name).However, in the L1 code, there can only be ever one operator per delegator (stored in the k.DelegatorOperatorAddress map) and the current operator is overwritten whenever a new one is added.
Solution recommendation
If multiple operators should be supported, we recommend changing the L1 code and data structures to store all operators. If not, we recommend changing the smart contracts (function name + documentation for
addOperator
, removal of unnecessary event forremoveOperator
).The text was updated successfully, but these errors were encountered: