zeta-chain / protocol-contracts

Protocol contracts implementing the core logic of the protocol, deployed on ZetaChain and on connected chains
MIT License
70 stars 58 forks source link

protocol-contracts v2: Always emit events in setters #257

Open fbac opened 3 months ago

fbac commented 3 months ago

This suggestion applies to all v2 contracts.

When setting configuration parameters in contract, let's make sure an event is emitted.

Example:

  function setCustody(address _custody) external onlyTSS {
      if (custody != address(0)) revert CustodyInitialized();
      if (_custody == address(0)) revert ZeroAddress();

      custody = _custody;
      emit CustodySet(_custody);
  }