Skip to content

Commit

Permalink
fix(Gateway setup): check admins/owners/operators for address(0) (#84)
Browse files Browse the repository at this point in the history
* fix(Gateway setup): check admins/owners/operators for address(0)

* chore(npm): version bump

* refactor(Gateway): emptiness emphasizes the contents
  • Loading branch information
re1ro authored Apr 7, 2022
1 parent 9e05f46 commit 55d3555
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axelar-network/axelar-cgp-solidity",
"version": "3.1.0",
"version": "3.1.1",
"description": "Ethereum Smart Contracts for Axelar Network",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/AdminMultisigBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ contract AdminMultisigBase is EternalStorage {
// Check that the account wasn't already set as an admin for this epoch.
if (_isAdmin(adminEpoch, account)) revert DuplicateAdmin(account);

if (account == address(0)) revert InvalidAdmins();

// Set this account as the i-th admin in this epoch (needed to we can clear topic votes in `onlyAdmin`).
_setAdmin(adminEpoch, i, account);
_setIsAdmin(adminEpoch, account, true);
Expand Down
4 changes: 3 additions & 1 deletion src/AxelarGatewayMultisig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ contract AxelarGatewayMultisig is IAxelarGatewayMultisig, AxelarGateway {
// Check that the account wasn't already set as an owner for this ownerEpoch.
if (_isOwner(epoch, account)) revert DuplicateOwner(account);

if (account == address(0)) revert InvalidOwners();

// Set this account as the i-th owner in this ownerEpoch (needed to we can get all the owners for `owners`).
_setOwner(epoch, i, account);
_setIsOwner(epoch, account, true);
Expand Down Expand Up @@ -335,7 +337,7 @@ contract AxelarGatewayMultisig is IAxelarGatewayMultisig, AxelarGateway {
// Check that the account wasn't already set as an operator for this operatorEpoch.
if (_isOperator(epoch, account)) revert DuplicateOperator(account);

if (account == address(0)) revert InvalidAddress();
if (account == address(0)) revert InvalidOperators();

// Set this account as the i-th operator in this operatorEpoch (needed to we can get all the operators for `operators`).
_setOperator(epoch, i, account);
Expand Down

0 comments on commit 55d3555

Please sign in to comment.