Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Gateway setup): check admins/owners/operators for address(0) #84

Merged
merged 3 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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