Skip to content

Commit

Permalink
fix: add paused check and blacklist check for updateAgent (#573)
Browse files Browse the repository at this point in the history
* feat: add paused check and blacklist check for updateAgent

* chores: add comment

* chores: add comment
  • Loading branch information
cosinlink authored Jul 19, 2024
1 parent f1f21ce commit 5ce49d3
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 @@ -325,7 +325,10 @@ contract StakeHub is System, Initializable, Protectable {
}

/*----------------- external functions -----------------*/
function updateAgent(address newAgent) external validatorExist(msg.sender) {
/**
* @param newAgent the new agent address of the validator, updating to address(0) means remove the old agent.
*/
function updateAgent(address newAgent) external validatorExist(msg.sender) whenNotPaused notInBlackList {
if (agentToOperator[newAgent] != address(0)) revert InvalidAgent();
if (_validatorSet.contains(newAgent)) revert InvalidAgent();

Expand Down

0 comments on commit 5ce49d3

Please sign in to comment.