Skip to content

Commit

Permalink
fix: not set agentToOperator while newAgent is zero address (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosinlink authored Jul 24, 2024
1 parent 01d86d0 commit f11346c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/BC_fusion/StakeHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ contract StakeHub is System, Initializable, Protectable {
}

_validators[operatorAddress].agent = newAgent;
agentToOperator[newAgent] = operatorAddress;

if (newAgent != address(0)) {
agentToOperator[newAgent] = operatorAddress;
}

emit AgentChanged(operatorAddress, oldAgent, newAgent);
}
Expand Down

0 comments on commit f11346c

Please sign in to comment.