Skip to content

Commit

Permalink
feat: change ownable to sdk implementation (#34)
Browse files Browse the repository at this point in the history
Co-authored-by: Dean Amiel <[email protected]>
Co-authored-by: Milap Sheth <[email protected]>
Co-authored-by: npty <[email protected]>
  • Loading branch information
4 people authored Aug 22, 2023
1 parent e031b47 commit c506fde
Show file tree
Hide file tree
Showing 5 changed files with 273 additions and 245 deletions.
9 changes: 3 additions & 6 deletions contracts/InterchainProposalExecutor.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol';
import { Ownable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/Ownable.sol';
import { AxelarExecutable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol';
import { IInterchainProposalExecutor } from './interfaces/IInterchainProposalExecutor.sol';
import { InterchainCalls } from './lib/InterchainCalls.sol';
Expand All @@ -25,11 +26,7 @@ contract InterchainProposalExecutor is IInterchainProposalExecutor, AxelarExecut
// Whitelisted proposal senders. The proposal sender is the `InterchainProposalSender` contract address at the source chain.
mapping(string => mapping(string => bool)) public whitelistedSenders;

constructor(address _gateway, address _owner) AxelarExecutable(_gateway) {
if (_owner == address(0)) revert InvalidAddress();

transferOwnership(_owner);
}
constructor(address _gateway, address _owner) AxelarExecutable(_gateway) Ownable(_owner) {}

/**
* @dev Executes the proposal. The source address must be a whitelisted sender.
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/TestProposalExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

pragma solidity ^0.8.0;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/Ownable.sol';
import '@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol';
import '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarExecutable.sol';
import '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/AddressString.sol';
import '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/AddressString.sol';
import '../InterchainProposalExecutor.sol';
import '../lib/InterchainCalls.sol';

Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@
},
"dependencies": {
"@axelar-network/axelar-cgp-solidity": "^4.5.0",
"@axelar-network/axelar-gmp-sdk-solidity": "^3.6.1",
"@axelar-network/axelar-gmp-sdk-solidity": "^5.0.0",
"@axelar-network/axelar-local-dev": "^2.0.1",
"@openzeppelin/contracts": "^4.8.3",
"cross-env": "^7.0.3",
"dotenv": "^16.0.3"
},
Expand All @@ -57,7 +56,7 @@
"minimatch": "^3.0.5",
"protobufjs": "^7.2.4",
"tough-cookie": "^4.1.3",
"@0xpolygonhermez/zkevm-commonjs": "git+https://github.com/0xpolygonhermez/zkevm-commonjs.git#ee86b868a0e2432d762bccf249016bd2051db892",
"@polygon-hermez/vm": "5.7.34"
"@polygon-hermez/zkevm-commonjs": "git+https://github.com/0xpolygonhermez/zkevm-commonjs.git#34f72fe",
"@polygon-hermez/vm": "5.7.30"
}
}
2 changes: 1 addition & 1 deletion test/unit/interchain-proposal-executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('InterchainProposalExecutor', function () {
contracts[chains.hardhat].gateway,
ethers.constants.AddressZero,
),
).to.be.revertedWithCustomError(executor, 'InvalidAddress');
).to.be.revertedWithCustomError(executor, 'InvalidOwnerAddress');
});
});

Expand Down
Loading

0 comments on commit c506fde

Please sign in to comment.