Check IGP ownership, transfer IGP ownership in the initializer (#1895)

### Description

* Adds the IGP & DefaultIsmIgp to the HyperlaneCoreChecker's list of
ownables
* Transfers ownership in the `initialize` function of the IGP - this way
we won't ever get in a scenario where the proxy admin is the owner for
fresh deploys

### Drive-by changes

* The provided default mumbai rpc `https://rpc-mumbai.maticvigil.com`
was giving problems for eth_getStorageAt, so changed it
* Removed the DefaultIsmInterchainGasPaymaster from the list of proxies
because it's not proxied (this is in #1765, but made this change in here
too)

### Related issues

n/a

### Backward compatibility

_Are these changes backward compatible?_

Yes

_Are there any infrastructure implications, e.g. changes that would
prohibit deploying older commits using this infra tooling?_

None


### Testing

_What kind of testing have these changes undergone?_

Unit Tests
pull/1922/head
Trevor Porter 2 years ago committed by GitHub
parent 406d365e03
commit cd75c25f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      solidity/contracts/igps/InterchainGasPaymaster.sol
  2. 2
      solidity/test/igps/InterchainGasPaymaster.t.sol
  3. 2
      typescript/sdk/src/consts/chainMetadata.ts
  4. 2
      typescript/sdk/src/deploy/core/HyperlaneCoreChecker.ts
  5. 3
      typescript/sdk/src/deploy/core/HyperlaneCoreDeployer.ts

@ -53,13 +53,21 @@ contract InterchainGasPaymaster is
// ============ Constructor ============
constructor(address _beneficiary) {
initialize(_beneficiary); // allows contract to be used without proxying
initialize(msg.sender, _beneficiary); // allows contract to be used without proxying
}
// ============ External Functions ============
function initialize(address _beneficiary) public initializer {
/**
* @param _owner The owner of the contract.
* @param _beneficiary The beneficiary.
*/
function initialize(address _owner, address _beneficiary)
public
initializer
{
__Ownable_init();
_transferOwnership(_owner);
_setBeneficiary(_beneficiary);
}

@ -44,7 +44,7 @@ contract InterchainGasPaymasterTest is Test {
function testInitializeRevertsIfCalledTwice() public {
vm.expectRevert("Initializable: contract is already initialized");
igp.initialize(beneficiary);
igp.initialize(address(this), beneficiary);
}
// ============ payForGas ============

@ -472,7 +472,7 @@ export const mumbai: ChainMetadata = {
nativeToken: maticToken,
publicRpcUrls: [
{
http: 'https://rpc-mumbai.maticvigil.com',
http: 'https://rpc.ankr.com/polygon_mumbai',
pagination: {
// eth_getLogs and eth_newFilter are limited to a 10,000 blocks range
blocks: 10000,

@ -62,6 +62,8 @@ export class HyperlaneCoreChecker extends HyperlaneAppChecker<
contracts.proxyAdmin,
contracts.mailbox.contract,
contracts.multisigIsm,
contracts.interchainGasPaymaster.contract,
contracts.defaultIsmInterchainGasPaymaster,
];
return this.checkOwnership(chain, config.owner, ownables);
}

@ -69,13 +69,14 @@ export class HyperlaneCoreDeployer extends HyperlaneDeployer<
): Promise<
ProxiedContract<InterchainGasPaymaster, TransparentProxyAddresses>
> {
const owner = this.configMap[chain].owner;
const beneficiary = this.configMap[chain].igp.beneficiary;
const igp = await this.deployProxiedContract(
chain,
'interchainGasPaymaster',
[beneficiary],
proxyAdmin,
[beneficiary],
[owner, beneficiary],
deployOpts,
);

Loading…
Cancel
Save