@hyperlane-xyz/sdk 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/consts/environments/index.d.ts +18 -8
- package/dist/consts/environments/index.d.ts.map +1 -1
- package/dist/consts/environments/mainnet.json +18 -9
- package/dist/consts/environments/testnet.json +18 -17
- package/dist/consts/multisigIsm.d.ts.map +1 -1
- package/dist/consts/multisigIsm.js +4 -3
- package/dist/consts/multisigIsm.js.map +1 -1
- package/dist/contracts.d.ts +11 -7
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +42 -7
- package/dist/contracts.js.map +1 -1
- package/dist/core/HyperlaneCoreDeployer.d.ts.map +1 -1
- package/dist/core/HyperlaneCoreDeployer.js +8 -6
- package/dist/core/HyperlaneCoreDeployer.js.map +1 -1
- package/dist/deploy/HyperlaneAppChecker.d.ts.map +1 -1
- package/dist/deploy/HyperlaneAppChecker.js +2 -11
- package/dist/deploy/HyperlaneAppChecker.js.map +1 -1
- package/dist/deploy/HyperlaneDeployer.d.ts +8 -6
- package/dist/deploy/HyperlaneDeployer.d.ts.map +1 -1
- package/dist/deploy/HyperlaneDeployer.js +40 -26
- package/dist/deploy/HyperlaneDeployer.js.map +1 -1
- package/dist/gas/HyperlaneIgpDeployer.d.ts.map +1 -1
- package/dist/gas/HyperlaneIgpDeployer.js +11 -6
- package/dist/gas/HyperlaneIgpDeployer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/middleware/account/InterchainAccountDeployer.d.ts.map +1 -1
- package/dist/middleware/account/InterchainAccountDeployer.js +24 -23
- package/dist/middleware/account/InterchainAccountDeployer.js.map +1 -1
- package/dist/providers/MultiProvider.js +2 -2
- package/dist/providers/MultiProvider.js.map +1 -1
- package/dist/router/HyperlaneRouterDeployer.d.ts.map +1 -1
- package/dist/router/HyperlaneRouterDeployer.js +12 -17
- package/dist/router/HyperlaneRouterDeployer.js.map +1 -1
- package/dist/utils/objects.d.ts +7 -2
- package/dist/utils/objects.d.ts.map +1 -1
- package/dist/utils/objects.js.map +1 -1
- package/package.json +4 -4
- package/dist/deploy/utils.d.ts +0 -6
- package/dist/deploy/utils.d.ts.map +0 -1
- package/dist/deploy/utils.js +0 -13
- package/dist/deploy/utils.js.map +0 -1
- package/dist/gas/calculator.d.ts +0 -186
- package/dist/gas/calculator.d.ts.map +0 -1
- package/dist/gas/calculator.hardhat-test.d.ts +0 -2
- package/dist/gas/calculator.hardhat-test.d.ts.map +0 -1
- package/dist/gas/calculator.hardhat-test.js +0 -59
- package/dist/gas/calculator.hardhat-test.js.map +0 -1
- package/dist/gas/calculator.js +0 -301
- package/dist/gas/calculator.js.map +0 -1
- package/dist/gas/calculator.test.d.ts +0 -2
- package/dist/gas/calculator.test.d.ts.map +0 -1
- package/dist/gas/calculator.test.js +0 -197
- package/dist/gas/calculator.test.js.map +0 -1
- package/dist/middleware/MiddlewareRouterChecker.d.ts +0 -8
- package/dist/middleware/MiddlewareRouterChecker.d.ts.map +0 -1
- package/dist/middleware/MiddlewareRouterChecker.js +0 -26
- package/dist/middleware/MiddlewareRouterChecker.js.map +0 -1
- package/dist/middleware/MiddlewareRouterDeployer.d.ts +0 -17
- package/dist/middleware/MiddlewareRouterDeployer.d.ts.map +0 -1
- package/dist/middleware/MiddlewareRouterDeployer.js +0 -62
- package/dist/middleware/MiddlewareRouterDeployer.js.map +0 -1
- package/dist/middleware/accounts.hardhat-test.d.ts +0 -2
- package/dist/middleware/accounts.hardhat-test.d.ts.map +0 -1
- package/dist/middleware/accounts.hardhat-test.js +0 -67
- package/dist/middleware/accounts.hardhat-test.js.map +0 -1
- package/dist/middleware/deploy.d.ts +0 -28
- package/dist/middleware/deploy.d.ts.map +0 -1
- package/dist/middleware/deploy.js +0 -124
- package/dist/middleware/deploy.js.map +0 -1
- package/dist/middleware/queries.hardhat-test.d.ts +0 -2
- package/dist/middleware/queries.hardhat-test.d.ts.map +0 -1
- package/dist/middleware/queries.hardhat-test.js +0 -73
- package/dist/middleware/queries.hardhat-test.js.map +0 -1
- package/dist/proxy.d.ts +0 -24
- package/dist/proxy.d.ts.map +0 -1
- package/dist/proxy.js +0 -39
- package/dist/proxy.js.map +0 -1
- package/dist/router/app.d.ts +0 -14
- package/dist/router/app.d.ts.map +0 -1
- package/dist/router/app.js +0 -31
- package/dist/router/app.js.map +0 -1
- package/dist/test/envSubsetDeployer/app.d.ts +0 -33
- package/dist/test/envSubsetDeployer/app.d.ts.map +0 -1
- package/dist/test/envSubsetDeployer/app.js +0 -72
- package/dist/test/envSubsetDeployer/app.js.map +0 -1
- package/dist/test/envSubsetDeployer/check-single-chain.d.ts +0 -2
- package/dist/test/envSubsetDeployer/check-single-chain.d.ts.map +0 -1
- package/dist/test/envSubsetDeployer/check-single-chain.js +0 -43
- package/dist/test/envSubsetDeployer/check-single-chain.js.map +0 -1
- package/dist/test/envSubsetDeployer/deploy-single-chain.d.ts +0 -2
- package/dist/test/envSubsetDeployer/deploy-single-chain.d.ts.map +0 -1
- package/dist/test/envSubsetDeployer/deploy-single-chain.js +0 -40
- package/dist/test/envSubsetDeployer/deploy-single-chain.js.map +0 -1
- package/dist/test/envSubsetDeployer/deploy.hardhat-test.d.ts +0 -2
- package/dist/test/envSubsetDeployer/deploy.hardhat-test.d.ts.map +0 -1
- package/dist/test/envSubsetDeployer/deploy.hardhat-test.js +0 -83
- package/dist/test/envSubsetDeployer/deploy.hardhat-test.js.map +0 -1
- package/dist/test/envSubsetDeployer/utils.d.ts +0 -4
- package/dist/test/envSubsetDeployer/utils.d.ts.map +0 -1
- package/dist/test/envSubsetDeployer/utils.js +0 -17
- package/dist/test/envSubsetDeployer/utils.js.map +0 -1
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.MiddlewareRouterDeployer = void 0;
|
|
13
|
-
const ethers_1 = require("ethers");
|
|
14
|
-
const HyperlaneRouterDeployer_1 = require("../router/HyperlaneRouterDeployer");
|
|
15
|
-
class MiddlewareRouterDeployer extends HyperlaneRouterDeployer_1.HyperlaneRouterDeployer {
|
|
16
|
-
constructor(multiProvider, configMap, factories, create2salt = 'middlewarerouter') {
|
|
17
|
-
super(multiProvider, configMap, factories);
|
|
18
|
-
this.create2salt = create2salt;
|
|
19
|
-
}
|
|
20
|
-
constructorArgs(_chain, _config) {
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
router(contracts) {
|
|
24
|
-
return contracts[this.routerContractName];
|
|
25
|
-
}
|
|
26
|
-
initializeArgs(chain, config) {
|
|
27
|
-
var _a;
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
// configure owner as signer for additional initialization steps
|
|
30
|
-
// ownership is transferred to config.owner in HyperlaneRouterDeployer.deploy
|
|
31
|
-
const owner = yield this.multiProvider.getSignerAddress(chain);
|
|
32
|
-
return [
|
|
33
|
-
config.mailbox,
|
|
34
|
-
config.interchainGasPaymaster,
|
|
35
|
-
(_a = config.interchainSecurityModule) !== null && _a !== void 0 ? _a : ethers_1.ethers.constants.AddressZero,
|
|
36
|
-
owner,
|
|
37
|
-
];
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
deployContracts(chain, config) {
|
|
41
|
-
const _super = Object.create(null, {
|
|
42
|
-
runIfOwner: { get: () => super.runIfOwner }
|
|
43
|
-
});
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const proxyAdmin = yield this.deployContract(chain, 'proxyAdmin', []);
|
|
46
|
-
const initArgs = yield this.initializeArgs(chain, config);
|
|
47
|
-
const proxiedRouter = yield this.deployProxiedContract(chain, this.routerContractName, this.constructorArgs(chain, config), initArgs, // generic type inference fails here
|
|
48
|
-
proxyAdmin.address, {
|
|
49
|
-
create2Salt: this.create2salt,
|
|
50
|
-
});
|
|
51
|
-
this.logger(`Transferring ownership of proxy admin to ${config.owner}`);
|
|
52
|
-
yield _super.runIfOwner.call(this, chain, proxyAdmin, () => this.multiProvider.handleTx(chain, proxyAdmin.transferOwnership(config.owner)));
|
|
53
|
-
const ret = {
|
|
54
|
-
[this.routerContractName]: proxiedRouter,
|
|
55
|
-
proxyAdmin,
|
|
56
|
-
};
|
|
57
|
-
return ret;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.MiddlewareRouterDeployer = MiddlewareRouterDeployer;
|
|
62
|
-
//# sourceMappingURL=MiddlewareRouterDeployer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MiddlewareRouterDeployer.js","sourceRoot":"","sources":["../../src/middleware/MiddlewareRouterDeployer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAiD;AAIjD,+EAA4E;AAK5E,MAAsB,wBAIpB,SAAQ,iDAAoE;IAC5E,YACE,aAA4B,EAC5B,SAA2C,EAC3C,SAA8B,EACpB,cAAc,kBAAkB;QAE1C,KAAK,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAFjC,gBAAW,GAAX,WAAW,CAAqB;IAG5C,CAAC;IAED,eAAe,CACb,MAAiB,EACjB,OAA+B;QAE/B,OAAO,EAAS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AkB,CAAC,EAAE,aAAa;gBACxC,UAAU;aACX,CAAC;YACF,OAAO,GAA8C,CAAC;QACxD,CAAC;KAAA;CACF;AA7ED,4DA6EC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.hardhat-test.d.ts","sourceRoot":"","sources":["../../src/middleware/accounts.hardhat-test.ts"],"names":[],"mappings":""}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const chai_1 = require("chai");
|
|
13
|
-
const hardhat_1 = require("hardhat");
|
|
14
|
-
const core_1 = require("@hyperlane-xyz/core");
|
|
15
|
-
const chains_1 = require("../consts/chains");
|
|
16
|
-
const TestCoreApp_1 = require("../core/TestCoreApp");
|
|
17
|
-
const TestCoreDeployer_1 = require("../core/TestCoreDeployer");
|
|
18
|
-
const MultiProvider_1 = require("../providers/MultiProvider");
|
|
19
|
-
const testUtils_1 = require("../test/testUtils");
|
|
20
|
-
const objects_1 = require("../utils/objects");
|
|
21
|
-
const deploy_1 = require("./deploy");
|
|
22
|
-
describe('InterchainAccounts', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const localChain = chains_1.Chains.test1;
|
|
24
|
-
const remoteChain = chains_1.Chains.test2;
|
|
25
|
-
let signer;
|
|
26
|
-
let contracts;
|
|
27
|
-
let local;
|
|
28
|
-
let remote;
|
|
29
|
-
let multiProvider;
|
|
30
|
-
let coreApp;
|
|
31
|
-
let config;
|
|
32
|
-
before(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
[signer] = yield hardhat_1.ethers.getSigners();
|
|
34
|
-
multiProvider = MultiProvider_1.MultiProvider.createTestMultiProvider({ signer });
|
|
35
|
-
const coreDeployer = new TestCoreDeployer_1.TestCoreDeployer(multiProvider);
|
|
36
|
-
const coreContractsMaps = yield coreDeployer.deploy();
|
|
37
|
-
coreApp = new TestCoreApp_1.TestCoreApp(coreContractsMaps, multiProvider);
|
|
38
|
-
config = yield (0, testUtils_1.deployTestIgpsAndGetRouterConfig)(multiProvider, signer.address, coreContractsMaps);
|
|
39
|
-
config.test1.interchainSecurityModule =
|
|
40
|
-
coreApp.getContracts('test1').multisigIsm.address;
|
|
41
|
-
}));
|
|
42
|
-
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
-
const deployer = new deploy_1.InterchainAccountDeployer(multiProvider, config);
|
|
44
|
-
contracts = yield deployer.deploy();
|
|
45
|
-
local = contracts[localChain].router;
|
|
46
|
-
remote = contracts[remoteChain].router;
|
|
47
|
-
}));
|
|
48
|
-
it('deploys and sets configured ISMs', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
-
const deployedIsms = yield (0, objects_1.promiseObjAll)((0, objects_1.objMap)(contracts, (_, c) => c.router.interchainSecurityModule()));
|
|
50
|
-
(0, chai_1.expect)(deployedIsms).to.eql((0, objects_1.objMap)(config, (_, c) => { var _a; return (_a = c.interchainSecurityModule) !== null && _a !== void 0 ? _a : hardhat_1.ethers.constants.AddressZero; }));
|
|
51
|
-
}));
|
|
52
|
-
it('forwards calls from interchain account', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
-
const recipientF = new core_1.TestRecipient__factory(signer);
|
|
54
|
-
const recipient = yield recipientF.deploy();
|
|
55
|
-
const fooMessage = 'Test';
|
|
56
|
-
const data = recipient.interface.encodeFunctionData('fooBar', [
|
|
57
|
-
1,
|
|
58
|
-
fooMessage,
|
|
59
|
-
]);
|
|
60
|
-
const icaAddress = yield remote['getLocalInterchainAccount(uint32,address,address,address)'](multiProvider.getDomainId(localChain), signer.address, local.address, hardhat_1.ethers.constants.AddressZero);
|
|
61
|
-
yield local['callRemote(uint32,address,uint256,bytes)'](multiProvider.getDomainId(remoteChain), recipient.address, 0, data);
|
|
62
|
-
yield coreApp.processMessages();
|
|
63
|
-
(0, chai_1.expect)(yield recipient.lastCallMessage()).to.eql(fooMessage);
|
|
64
|
-
(0, chai_1.expect)(yield recipient.lastCaller()).to.eql(icaAddress);
|
|
65
|
-
}));
|
|
66
|
-
}));
|
|
67
|
-
//# sourceMappingURL=accounts.hardhat-test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.hardhat-test.js","sourceRoot":"","sources":["../../src/middleware/accounts.hardhat-test.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,+BAA8B;AAC9B,qCAAiC;AAEjC,8CAG6B;AAE7B,6CAA0C;AAC1C,qDAAkD;AAClD,+DAA4D;AAC5D,8DAA2D;AAE3D,iDAAqE;AAErE,8CAAyD;AAEzD,qCAGkB;AAElB,QAAQ,CAAC,oBAAoB,EAAE,GAAS,EAAE;IACxC,MAAM,UAAU,GAAG,eAAM,CAAC,KAAK,CAAC;IAChC,MAAM,WAAW,GAAG,eAAM,CAAC,KAAK,CAAC;IAEjC,IAAI,MAAyB,CAAC;IAC9B,IAAI,SAA+C,CAAC;IACpD,IAAI,KAA8B,CAAC;IACnC,IAAI,MAA+B,CAAC;IACpC,IAAI,aAA4B,CAAC;IACjC,IAAI,OAAoB,CAAC;IACzB,IAAI,MAA8B,CAAC;IAEnC,MAAM,CAAC,GAAS,EAAE;QAChB,CAAC,MAAM,CAAC,GAAG,MAAM,gBAAM,CAAC,UAAU,EAAE,CAAC;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,CAAC,SAAS,CAAC,WAAW,CAAA,EAAA,CACrE,CACF,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAS,EAAE;QACtD,MAAM,UAAU,GAAG,IAAI,6BAAsB,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;QAC5C,MAAM,UAAU,GAAG,MAAM,CAAC;QAC1B,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE;YAC5D,CAAC;YACD,UAAU;SACX,CAAC,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,MAAM,CAC7B,2DAA2D,CAC5D,CACC,aAAa,CAAC,WAAW,CAAC,UAAU,CAAC,EACrC,MAAM,CAAC,OAAO,EACd,KAAK,CAAC,OAAO,EACb,gBAAM,CAAC,SAAS,CAAC,WAAW,CAC7B,CAAC;QAEF,MAAM,KAAK,CAAC,0CAA0C,CAAC,CACrD,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,EACtC,SAAS,CAAC,OAAO,EACjB,CAAC,EACD,IAAI,CACL,CAAC;QACF,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC;QAChC,IAAA,aAAM,EAAC,MAAM,SAAS,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAA,aAAM,EAAC,MAAM,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC1D,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { InterchainAccountRouter, InterchainQueryRouter } from '@hyperlane-xyz/core';
|
|
2
|
-
import { MultiProvider } from '../providers/MultiProvider';
|
|
3
|
-
import { HyperlaneRouterDeployer } from '../router/HyperlaneRouterDeployer';
|
|
4
|
-
import { ProxiedRouterContracts, ProxiedRouterFactories, RouterConfig } from '../router/types';
|
|
5
|
-
import { ChainMap, ChainName } from '../types';
|
|
6
|
-
export declare type InterchainAccountFactories = ProxiedRouterFactories<InterchainAccountRouter>;
|
|
7
|
-
export declare const interchainAccountFactories: InterchainAccountFactories;
|
|
8
|
-
export declare type InterchainAccountContracts = ProxiedRouterContracts<InterchainAccountRouter>;
|
|
9
|
-
export declare type InterchainQueryFactories = ProxiedRouterFactories<InterchainQueryRouter>;
|
|
10
|
-
export declare const interchainQueryFactories: InterchainQueryFactories;
|
|
11
|
-
export declare type InterchainQueryContracts = ProxiedRouterContracts<InterchainQueryRouter>;
|
|
12
|
-
export declare abstract class MiddlewareRouterDeployer<MiddlewareRouterConfig extends RouterConfig, MiddlewareRouterContracts extends ProxiedRouterContracts, MiddlewareFactories extends ProxiedRouterFactories> extends HyperlaneRouterDeployer<MiddlewareRouterConfig, MiddlewareRouterContracts, MiddlewareFactories> {
|
|
13
|
-
protected create2salt: string;
|
|
14
|
-
constructor(multiProvider: MultiProvider, configMap: ChainMap<MiddlewareRouterConfig>, factories: MiddlewareFactories, create2salt?: string);
|
|
15
|
-
initializeArgs(chain: ChainName, config: MiddlewareRouterConfig): Promise<[string, string, string, string]>;
|
|
16
|
-
deployContracts(chain: ChainName, config: MiddlewareRouterConfig): Promise<MiddlewareRouterContracts>;
|
|
17
|
-
}
|
|
18
|
-
declare type InterchainAccountConfig = RouterConfig;
|
|
19
|
-
export declare class InterchainAccountDeployer extends MiddlewareRouterDeployer<InterchainAccountConfig, InterchainAccountContracts, InterchainAccountFactories> {
|
|
20
|
-
constructor(multiProvider: MultiProvider, configMap: ChainMap<InterchainAccountConfig>, create2Salt?: string);
|
|
21
|
-
deployContracts(chain: ChainName, config: InterchainAccountConfig): Promise<InterchainAccountContracts>;
|
|
22
|
-
}
|
|
23
|
-
declare type InterchainQueryConfig = RouterConfig;
|
|
24
|
-
export declare class InterchainQueryDeployer extends MiddlewareRouterDeployer<InterchainQueryConfig, InterchainQueryContracts, InterchainQueryFactories> {
|
|
25
|
-
constructor(multiProvider: MultiProvider, configMap: ChainMap<InterchainQueryConfig>, create2salt?: string);
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=deploy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/middleware/deploy.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EAEvB,qBAAqB,EAItB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE/C,oBAAY,0BAA0B,GACpC,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;AAElD,eAAO,MAAM,0BAA0B,EAAE,0BAGxC,CAAC;AAEF,oBAAY,0BAA0B,GACpC,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;AAElD,oBAAY,wBAAwB,GAClC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;AAEhD,eAAO,MAAM,wBAAwB,EAAE,wBAGtC,CAAC;AAEF,oBAAY,wBAAwB,GAClC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;AAEhD,8BAAsB,wBAAwB,CAC5C,sBAAsB,SAAS,YAAY,EAC3C,yBAAyB,SAAS,sBAAsB,EACxD,mBAAmB,SAAS,sBAAsB,CAClD,SAAQ,uBAAuB,CAC/B,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,CACpB;IAKG,SAAS,CAAC,WAAW;gBAHrB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,QAAQ,CAAC,sBAAsB,CAAC,EAC3C,SAAS,EAAE,mBAAmB,EACpB,WAAW,SAAqB;IAKtC,cAAc,CAClB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAYtC,eAAe,CACnB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,yBAAyB,CAAC;CAwBtC;AAED,aAAK,uBAAuB,GAAG,YAAY,CAAC;AAE5C,qBAAa,yBAA0B,SAAQ,wBAAwB,CACrE,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,CAC3B;gBAEG,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,QAAQ,CAAC,uBAAuB,CAAC,EAC5C,WAAW,SAAmB;IAU1B,eAAe,CACnB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,0BAA0B,CAAC;CA8DvC;AAED,aAAK,qBAAqB,GAAG,YAAY,CAAC;AAE1C,qBAAa,uBAAwB,SAAQ,wBAAwB,CACnE,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,CACzB;gBAEG,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAC1C,WAAW,SAAiB;CAI/B"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.InterchainQueryDeployer = exports.InterchainAccountDeployer = exports.MiddlewareRouterDeployer = exports.interchainQueryFactories = exports.interchainAccountFactories = void 0;
|
|
13
|
-
const ethers_1 = require("ethers");
|
|
14
|
-
const core_1 = require("@hyperlane-xyz/core");
|
|
15
|
-
const proxy_1 = require("../proxy");
|
|
16
|
-
const HyperlaneRouterDeployer_1 = require("../router/HyperlaneRouterDeployer");
|
|
17
|
-
exports.interchainAccountFactories = {
|
|
18
|
-
router: new core_1.InterchainAccountRouter__factory(),
|
|
19
|
-
proxyAdmin: new core_1.ProxyAdmin__factory(),
|
|
20
|
-
};
|
|
21
|
-
exports.interchainQueryFactories = {
|
|
22
|
-
router: new core_1.InterchainQueryRouter__factory(),
|
|
23
|
-
proxyAdmin: new core_1.ProxyAdmin__factory(),
|
|
24
|
-
};
|
|
25
|
-
class MiddlewareRouterDeployer extends HyperlaneRouterDeployer_1.HyperlaneRouterDeployer {
|
|
26
|
-
constructor(multiProvider, configMap, factories, create2salt = 'middlewarerouter') {
|
|
27
|
-
super(multiProvider, configMap, factories);
|
|
28
|
-
this.create2salt = create2salt;
|
|
29
|
-
}
|
|
30
|
-
initializeArgs(chain, config) {
|
|
31
|
-
var _a;
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
// configure owner as signer for additional initialization steps
|
|
34
|
-
// ownership is transferred to config.owner in HyperlaneRouterDeployer.deploy
|
|
35
|
-
const owner = yield this.multiProvider.getSignerAddress(chain);
|
|
36
|
-
return [
|
|
37
|
-
config.mailbox,
|
|
38
|
-
config.interchainGasPaymaster,
|
|
39
|
-
(_a = config.interchainSecurityModule) !== null && _a !== void 0 ? _a : ethers_1.ethers.constants.AddressZero,
|
|
40
|
-
owner,
|
|
41
|
-
];
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
deployContracts(chain, config) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const proxyAdmin = yield this.deployContract(chain, 'proxyAdmin', []);
|
|
47
|
-
const initArgs = yield this.initializeArgs(chain, config);
|
|
48
|
-
const proxiedRouter = yield this.deployProxiedContract(chain, 'router', [], // generic type inference fails here
|
|
49
|
-
initArgs, // generic type inference fails here
|
|
50
|
-
proxyAdmin.address, {
|
|
51
|
-
create2Salt: this.create2salt,
|
|
52
|
-
});
|
|
53
|
-
return {
|
|
54
|
-
proxyAdmin,
|
|
55
|
-
proxiedRouter,
|
|
56
|
-
router: proxiedRouter.contract, // for backwards compatibility
|
|
57
|
-
}; // generic type inference fails here
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.MiddlewareRouterDeployer = MiddlewareRouterDeployer;
|
|
62
|
-
class InterchainAccountDeployer extends MiddlewareRouterDeployer {
|
|
63
|
-
constructor(multiProvider, configMap, create2Salt = 'accountsrouter') {
|
|
64
|
-
super(multiProvider, configMap, exports.interchainAccountFactories, create2Salt);
|
|
65
|
-
}
|
|
66
|
-
// The OwnableMulticall implementation has an immutable owner address that
|
|
67
|
-
// must be set to the InterchainAccountRouter proxy address. To achieve this, we
|
|
68
|
-
// 1. deploy the proxy first with a dummy implementation
|
|
69
|
-
// 2. deploy the real InterchainAccountRouter and OwnableMulticall implementation with proxy address
|
|
70
|
-
// 3. upgrade the proxy to the real implementation and initialize
|
|
71
|
-
deployContracts(chain, config) {
|
|
72
|
-
const _super = Object.create(null, {
|
|
73
|
-
upgradeAndInitialize: { get: () => super.upgradeAndInitialize },
|
|
74
|
-
changeAdmin: { get: () => super.changeAdmin }
|
|
75
|
-
});
|
|
76
|
-
var _a;
|
|
77
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
const proxyAdmin = yield this.deployContract(chain, 'proxyAdmin', []);
|
|
79
|
-
// manually recover from cache because cannot use HyperlaneDeployer.deployProxiedContract
|
|
80
|
-
const cached = (_a = this.deployedContracts[chain]) === null || _a === void 0 ? void 0 : _a.proxiedRouter;
|
|
81
|
-
if (cached && cached.addresses.proxy && cached.addresses.implementation) {
|
|
82
|
-
this.logger('Recovered full InterchainAccountRouter');
|
|
83
|
-
return {
|
|
84
|
-
proxyAdmin,
|
|
85
|
-
proxiedRouter: cached,
|
|
86
|
-
router: cached.contract,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
const deployer = yield this.multiProvider.getSignerAddress(chain);
|
|
90
|
-
// 1. deploy the proxy first with a dummy implementation (proxy admin contract)
|
|
91
|
-
const proxy = yield this.deployContractFromFactory(chain, new core_1.TransparentUpgradeableProxy__factory(), 'TransparentUpgradeableProxy', [proxyAdmin.address, deployer, '0x'], { create2Salt: this.create2salt });
|
|
92
|
-
// 2. deploy the real InterchainAccountRouter and OwnableMulticall implementation with proxy address
|
|
93
|
-
const domainId = this.multiProvider.getDomainId(chain);
|
|
94
|
-
const implementation = yield this.deployContract(chain, 'router', [
|
|
95
|
-
domainId,
|
|
96
|
-
proxy.address,
|
|
97
|
-
]);
|
|
98
|
-
// 3. upgrade the proxy to the real implementation and initialize
|
|
99
|
-
// adapted from HyperlaneDeployer.deployProxy.useCreate2
|
|
100
|
-
const initArgs = yield this.initializeArgs(chain, config);
|
|
101
|
-
const initData = this.factories.router.interface.encodeFunctionData('initialize', initArgs);
|
|
102
|
-
yield _super.upgradeAndInitialize.call(this, chain, proxy, implementation.address, initData);
|
|
103
|
-
yield _super.changeAdmin.call(this, chain, proxy, proxyAdmin.address);
|
|
104
|
-
const proxiedRouter = new proxy_1.ProxiedContract(implementation.attach(proxy.address), {
|
|
105
|
-
kind: proxy_1.ProxyKind.Transparent,
|
|
106
|
-
implementation: implementation.address,
|
|
107
|
-
proxy: proxy.address,
|
|
108
|
-
});
|
|
109
|
-
return {
|
|
110
|
-
proxyAdmin,
|
|
111
|
-
proxiedRouter,
|
|
112
|
-
router: proxiedRouter.contract,
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
exports.InterchainAccountDeployer = InterchainAccountDeployer;
|
|
118
|
-
class InterchainQueryDeployer extends MiddlewareRouterDeployer {
|
|
119
|
-
constructor(multiProvider, configMap, create2salt = 'queryrouter2') {
|
|
120
|
-
super(multiProvider, configMap, exports.interchainQueryFactories, create2salt);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
exports.InterchainQueryDeployer = InterchainQueryDeployer;
|
|
124
|
-
//# sourceMappingURL=deploy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/middleware/deploy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAgC;AAEhC,8CAO6B;AAG7B,oCAAsD;AACtD,+EAA4E;AAW/D,QAAA,0BAA0B,GAA+B;IACpE,MAAM,EAAE,IAAI,uCAAgC,EAAE;IAC9C,UAAU,EAAE,IAAI,0BAAmB,EAAE;CACtC,CAAC;AAQW,QAAA,wBAAwB,GAA6B;IAChE,MAAM,EAAE,IAAI,qCAA8B,EAAE;IAC5C,UAAU,EAAE,IAAI,0BAAmB,EAAE;CACtC,CAAC;AAKF,MAAsB,wBAIpB,SAAQ,iDAIT;IACC,YACE,aAA4B,EAC5B,SAA2C,EAC3C,SAA8B,EACpB,cAAc,kBAAkB;QAE1C,KAAK,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAFjC,gBAAW,GAAX,WAAW,CAAqB;IAG5C,CAAC;IAEK,cAAc,CAClB,KAAgB,EAChB,MAA8B;;;YAE9B,gEAAgE;YAChE,6EAA6E;YAC7E,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAC/D,OAAO;gBACL,MAAM,CAAC,OAAO;gBACd,MAAM,CAAC,sBAAsB;gB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,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EACpC;gBACE,IAAI,EAAE,iBAAS,CAAC,WAAW;gBAC3B,cAAc,EAAE,cAAc,CAAC,OAAO;gBACtC,KAAK,EAAE,KAAK,CAAC,OAAO;aACrB,CACF,CAAC;YAEF,OAAO;gBACL,UAAU;gBACV,aAAa;gBACb,MAAM,EAAE,aAAa,CAAC,QAAQ;aAC/B,CAAC;;KACH;CACF;AAnFD,8DAmFC;AAID,MAAa,uBAAwB,SAAQ,wBAI5C;IACC,YACE,aAA4B,EAC5B,SAA0C,EAC1C,WAAW,GAAG,cAAc;QAE5B,KAAK,CAAC,aAAa,EAAE,SAAS,EAAE,gCAAwB,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;CACF;AAZD,0DAYC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queries.hardhat-test.d.ts","sourceRoot":"","sources":["../../src/middleware/queries.hardhat-test.ts"],"names":[],"mappings":""}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const chai_1 = require("chai");
|
|
13
|
-
const hardhat_1 = require("hardhat");
|
|
14
|
-
const core_1 = require("@hyperlane-xyz/core");
|
|
15
|
-
const utils_1 = require("@hyperlane-xyz/utils");
|
|
16
|
-
const chainMetadata_1 = require("../consts/chainMetadata");
|
|
17
|
-
const chains_1 = require("../consts/chains");
|
|
18
|
-
const TestCoreApp_1 = require("../core/TestCoreApp");
|
|
19
|
-
const TestCoreDeployer_1 = require("../core/TestCoreDeployer");
|
|
20
|
-
const MultiProvider_1 = require("../providers/MultiProvider");
|
|
21
|
-
const testUtils_1 = require("../test/testUtils");
|
|
22
|
-
const deploy_1 = require("./deploy");
|
|
23
|
-
describe('InterchainQueryRouter', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
const localChain = chains_1.Chains.test1;
|
|
25
|
-
const remoteChain = chains_1.Chains.test2;
|
|
26
|
-
const localDomain = chainMetadata_1.chainMetadata[localChain].chainId;
|
|
27
|
-
const remoteDomain = chainMetadata_1.chainMetadata[remoteChain].chainId;
|
|
28
|
-
let signer;
|
|
29
|
-
let local;
|
|
30
|
-
let remote;
|
|
31
|
-
let multiProvider;
|
|
32
|
-
let coreApp;
|
|
33
|
-
let config;
|
|
34
|
-
let testQuery;
|
|
35
|
-
before(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
[signer] = yield hardhat_1.ethers.getSigners();
|
|
37
|
-
multiProvider = MultiProvider_1.MultiProvider.createTestMultiProvider({ signer });
|
|
38
|
-
const coreDeployer = new TestCoreDeployer_1.TestCoreDeployer(multiProvider);
|
|
39
|
-
const coreContractsMaps = yield coreDeployer.deploy();
|
|
40
|
-
coreApp = new TestCoreApp_1.TestCoreApp(coreContractsMaps, multiProvider);
|
|
41
|
-
config = yield (0, testUtils_1.deployTestIgpsAndGetRouterConfig)(multiProvider, signer.address, coreContractsMaps);
|
|
42
|
-
}));
|
|
43
|
-
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
const InterchainQuery = new deploy_1.InterchainQueryDeployer(multiProvider, config);
|
|
45
|
-
const contracts = yield InterchainQuery.deploy();
|
|
46
|
-
local = contracts[localChain].router;
|
|
47
|
-
remote = contracts[remoteChain].router;
|
|
48
|
-
testQuery = yield new core_1.TestQuery__factory(signer).deploy(local.address);
|
|
49
|
-
}));
|
|
50
|
-
it('completes query round trip and invokes callback', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
const secret = 123;
|
|
52
|
-
const sender = testQuery.address;
|
|
53
|
-
const bytes32sender = utils_1.utils.addressToBytes32(sender);
|
|
54
|
-
const expectedOwner = yield remote.owner();
|
|
55
|
-
yield (0, chai_1.expect)(testQuery.queryRouterOwner(remoteDomain, secret))
|
|
56
|
-
.to.emit(local, 'QueryDispatched')
|
|
57
|
-
.withArgs(remoteDomain, sender);
|
|
58
|
-
const result = yield coreApp.processOutboundMessages(localChain);
|
|
59
|
-
const response = result.get(remoteChain)[0];
|
|
60
|
-
yield (0, chai_1.expect)(response)
|
|
61
|
-
.to.emit(remote, 'QueryExecuted')
|
|
62
|
-
.withArgs(localDomain, bytes32sender);
|
|
63
|
-
const result2 = yield coreApp.processOutboundMessages(remoteChain);
|
|
64
|
-
const response2 = result2.get(localChain)[0];
|
|
65
|
-
yield (0, chai_1.expect)(response2)
|
|
66
|
-
.to.emit(local, 'QueryResolved')
|
|
67
|
-
.withArgs(remoteDomain, sender);
|
|
68
|
-
yield (0, chai_1.expect)(response2)
|
|
69
|
-
.to.emit(testQuery, 'Owner')
|
|
70
|
-
.withArgs(secret, expectedOwner);
|
|
71
|
-
}));
|
|
72
|
-
}));
|
|
73
|
-
//# sourceMappingURL=queries.hardhat-test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queries.hardhat-test.js","sourceRoot":"","sources":["../../src/middleware/queries.hardhat-test.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,+BAA8B;AAC9B,qCAAiC;AAEjC,8CAI6B;AAC7B,gDAA6C;AAE7C,2DAAwD;AACxD,6CAA0C;AAC1C,qDAAkD;AAClD,+DAA4D;AAC5D,8DAA2D;AAE3D,iDAAqE;AAGrE,qCAAmD;AAEn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AAM,EAAC,SAAS,CAAC;aACpB,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC;aAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACrC,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAA,CAAC,CAAC"}
|
package/dist/proxy.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
2
|
-
import { Contract } from 'ethers';
|
|
3
|
-
import type { types } from '@hyperlane-xyz/utils';
|
|
4
|
-
import { Connection } from './types';
|
|
5
|
-
export declare enum ProxyKind {
|
|
6
|
-
Transparent = "Transparent"
|
|
7
|
-
}
|
|
8
|
-
export interface ProxyAddresses<Kind extends ProxyKind> {
|
|
9
|
-
kind: Kind;
|
|
10
|
-
proxy: types.Address;
|
|
11
|
-
implementation: types.Address;
|
|
12
|
-
}
|
|
13
|
-
export declare function isProxyAddresses(addresses: unknown): addresses is ProxyAddresses<any>;
|
|
14
|
-
export declare function getProxyAddress(address: types.Address | ProxyAddresses<any>): string;
|
|
15
|
-
export declare type TransparentProxyAddresses = ProxyAddresses<ProxyKind.Transparent>;
|
|
16
|
-
export declare class ProxiedContract<C extends Contract, A extends ProxyAddresses<any> = TransparentProxyAddresses> {
|
|
17
|
-
readonly contract: C;
|
|
18
|
-
readonly addresses: A;
|
|
19
|
-
constructor(contract: C, addresses: A);
|
|
20
|
-
get address(): string;
|
|
21
|
-
get deployTransaction(): TransactionResponse;
|
|
22
|
-
connect(connection: Connection): ProxiedContract<C, A>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=proxy.d.ts.map
|
package/dist/proxy.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,oBAAY,SAAS;IACnB,WAAW,gBAAgB;CAC5B;AAED,MAAM,WAAW,cAAc,CAAC,IAAI,SAAS,SAAS;IACpD,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;IACrB,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC;CAC/B;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,OAAO,GACjB,SAAS,IAAI,cAAc,CAAC,GAAG,CAAC,CAWlC;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,GAC3C,MAAM,CAER;AAED,oBAAY,yBAAyB,GAAG,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAE9E,qBAAa,eAAe,CAC1B,CAAC,SAAS,QAAQ,EAClB,CAAC,SAAS,cAAc,CAAC,GAAG,CAAC,GAAG,yBAAyB;aAE7B,QAAQ,EAAE,CAAC;aAAkB,SAAS,EAAE,CAAC;gBAAzC,QAAQ,EAAE,CAAC,EAAkB,SAAS,EAAE,CAAC;IAErE,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,iBAAiB,IAAI,mBAAmB,CAE3C;IAED,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;CAMvD"}
|
package/dist/proxy.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProxiedContract = exports.getProxyAddress = exports.isProxyAddresses = exports.ProxyKind = void 0;
|
|
4
|
-
var ProxyKind;
|
|
5
|
-
(function (ProxyKind) {
|
|
6
|
-
ProxyKind["Transparent"] = "Transparent";
|
|
7
|
-
})(ProxyKind = exports.ProxyKind || (exports.ProxyKind = {}));
|
|
8
|
-
function isProxyAddresses(addresses) {
|
|
9
|
-
// The presence of `implementation` is intentionally not checked
|
|
10
|
-
// to allow deploying new implementations by deleting the implementation
|
|
11
|
-
// from the artifacts
|
|
12
|
-
return (addresses !== null &&
|
|
13
|
-
typeof addresses === 'object' &&
|
|
14
|
-
'proxy' in addresses &&
|
|
15
|
-
'kind' in addresses &&
|
|
16
|
-
Object.keys(ProxyKind).includes(addresses.kind));
|
|
17
|
-
}
|
|
18
|
-
exports.isProxyAddresses = isProxyAddresses;
|
|
19
|
-
function getProxyAddress(address) {
|
|
20
|
-
return isProxyAddresses(address) ? address.proxy : address;
|
|
21
|
-
}
|
|
22
|
-
exports.getProxyAddress = getProxyAddress;
|
|
23
|
-
class ProxiedContract {
|
|
24
|
-
constructor(contract, addresses) {
|
|
25
|
-
this.contract = contract;
|
|
26
|
-
this.addresses = addresses;
|
|
27
|
-
}
|
|
28
|
-
get address() {
|
|
29
|
-
return this.contract.address;
|
|
30
|
-
}
|
|
31
|
-
get deployTransaction() {
|
|
32
|
-
return this.contract.deployTransaction;
|
|
33
|
-
}
|
|
34
|
-
connect(connection) {
|
|
35
|
-
return new ProxiedContract(this.contract.connect(connection), this.addresses);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.ProxiedContract = ProxiedContract;
|
|
39
|
-
//# sourceMappingURL=proxy.js.map
|
package/dist/proxy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":";;;AAOA,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,wCAA2B,CAAA;AAC7B,CAAC,EAFW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAEpB;AAQD,SAAgB,gBAAgB,CAC9B,SAAkB;IAElB,gEAAgE;IAChE,wEAAwE;IACxE,qBAAqB;IACrB,OAAO,CACL,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,KAAK,QAAQ;QAC7B,OAAO,IAAI,SAAS;QACpB,MAAM,IAAI,SAAS;QACnB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAE,SAAiB,CAAC,IAAI,CAAC,CACzD,CAAC;AACJ,CAAC;AAbD,4CAaC;AAED,SAAgB,eAAe,CAC7B,OAA4C;IAE5C,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7D,CAAC;AAJD,0CAIC;AAID,MAAa,eAAe;IAI1B,YAA4B,QAAW,EAAkB,SAAY;QAAzC,aAAQ,GAAR,QAAQ,CAAG;QAAkB,cAAS,GAAT,SAAS,CAAG;IAAG,CAAC;IAEzE,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC/B,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACzC,CAAC;IAED,OAAO,CAAC,UAAsB;QAC5B,OAAO,IAAI,eAAe,CACxB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAM,EACtC,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;CACF;AApBD,0CAoBC"}
|
package/dist/router/app.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BigNumber } from 'ethers';
|
|
2
|
-
import { GasRouter } from '@hyperlane-xyz/core';
|
|
3
|
-
import { types } from '@hyperlane-xyz/utils';
|
|
4
|
-
import { HyperlaneApp } from '../HyperlaneApp';
|
|
5
|
-
import { ChainMap, ChainName } from '../types';
|
|
6
|
-
import { RouterContracts } from './types';
|
|
7
|
-
export declare class RouterApp<Contracts extends RouterContracts> extends HyperlaneApp<Contracts> {
|
|
8
|
-
getSecurityModules: () => Promise<ChainMap<types.Address>>;
|
|
9
|
-
getOwners: () => Promise<ChainMap<types.Address>>;
|
|
10
|
-
}
|
|
11
|
-
export declare class GasRouterApp<Contracts extends RouterContracts<GasRouter>> extends RouterApp<Contracts> {
|
|
12
|
-
quoteGasPayment(origin: ChainName, destination: ChainName): Promise<BigNumber>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=app.d.ts.map
|
package/dist/router/app.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/router/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,SAAS,CACpB,SAAS,SAAS,eAAe,CACjC,SAAQ,YAAY,CAAC,SAAS,CAAC;IAC/B,kBAAkB,QAAO,QAAQ,SAAS,MAAM,OAAO,CAAC,CAAC,CAKrD;IAEJ,SAAS,QAAO,QAAQ,SAAS,MAAM,OAAO,CAAC,CAAC,CAG5C;CACL;AAED,qBAAa,YAAY,CACvB,SAAS,SAAS,eAAe,CAAC,SAAS,CAAC,CAC5C,SAAQ,SAAS,CAAC,SAAS,CAAC;IACtB,eAAe,CACnB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,SAAS,GACrB,OAAO,CAAC,SAAS,CAAC;CAKtB"}
|
package/dist/router/app.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GasRouterApp = exports.RouterApp = void 0;
|
|
13
|
-
const HyperlaneApp_1 = require("../HyperlaneApp");
|
|
14
|
-
const objects_1 = require("../utils/objects");
|
|
15
|
-
class RouterApp extends HyperlaneApp_1.HyperlaneApp {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.getSecurityModules = () => (0, objects_1.promiseObjAll)((0, objects_1.objMap)(this.contractsMap, (_, contracts) => contracts.router.interchainSecurityModule()));
|
|
19
|
-
this.getOwners = () => (0, objects_1.promiseObjAll)((0, objects_1.objMap)(this.contractsMap, (_, contracts) => contracts.router.owner()));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.RouterApp = RouterApp;
|
|
23
|
-
class GasRouterApp extends RouterApp {
|
|
24
|
-
quoteGasPayment(origin, destination) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
return this.getContracts(origin).router.quoteGasPayment(this.multiProvider.getDomainId(destination));
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.GasRouterApp = GasRouterApp;
|
|
31
|
-
//# sourceMappingURL=app.js.map
|
package/dist/router/app.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/router/app.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kDAA+C;AAE/C,8CAAyD;AAIzD,MAAa,SAEX,SAAQ,2BAAuB;IAFjC;;QAGE,uBAAkB,GAAG,GAAqC,EAAE,CAC1D,IAAA,uBAAa,EACX,IAAA,gBAAM,EAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CACzC,SAAS,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAC5C,CACF,CAAC;QAEJ,cAAS,GAAG,GAAqC,EAAE,CACjD,IAAA,uBAAa,EACX,IAAA,gBAAM,EAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CACtE,CAAC;IACN,CAAC;CAAA;AAdD,8BAcC;AAED,MAAa,YAEX,SAAQ,SAAoB;IACtB,eAAe,CACnB,MAAiB,EACjB,WAAsB;;YAEtB,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,eAAe,CACrD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,CAC5C,CAAC;QACJ,CAAC;KAAA;CACF;AAXD,oCAWC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { TestRouter, TestRouter__factory } from '@hyperlane-xyz/core';
|
|
2
|
-
import { Chains } from '../../consts/chains';
|
|
3
|
-
import { HyperlaneCore } from '../../core/HyperlaneCore';
|
|
4
|
-
import { MultiProvider } from '../../providers/MultiProvider';
|
|
5
|
-
import { HyperlaneRouterChecker } from '../../router/HyperlaneRouterChecker';
|
|
6
|
-
import { HyperlaneRouterDeployer } from '../../router/HyperlaneRouterDeployer';
|
|
7
|
-
import { RouterApp } from '../../router/RouterApps';
|
|
8
|
-
import { RouterConfig } from '../../router/types';
|
|
9
|
-
import { ChainMap, ChainName } from '../../types';
|
|
10
|
-
export declare const alfajoresChainConfig: Record<Chains.alfajores, import("../../consts/chainMetadata").ChainMetadata>;
|
|
11
|
-
export declare type TestRouterContracts = {
|
|
12
|
-
router: TestRouter;
|
|
13
|
-
};
|
|
14
|
-
export declare type TestRouterFactories = {
|
|
15
|
-
router: TestRouter__factory;
|
|
16
|
-
};
|
|
17
|
-
export declare const testRouterFactories: TestRouterFactories;
|
|
18
|
-
export declare class EnvSubsetApp extends RouterApp<typeof testRouterFactories> {
|
|
19
|
-
router(contracts: TestRouterContracts): TestRouter;
|
|
20
|
-
}
|
|
21
|
-
export declare class EnvSubsetChecker extends HyperlaneRouterChecker<typeof testRouterFactories, EnvSubsetApp, RouterConfig> {
|
|
22
|
-
}
|
|
23
|
-
export declare class EnvSubsetDeployer extends HyperlaneRouterDeployer<RouterConfig, TestRouterFactories> {
|
|
24
|
-
protected core: HyperlaneCore;
|
|
25
|
-
constructor(multiProvider: MultiProvider, configMap: ChainMap<RouterConfig>, core: HyperlaneCore);
|
|
26
|
-
router(contracts: TestRouterContracts): TestRouter;
|
|
27
|
-
initRouter(contractsMap: ChainMap<TestRouterContracts>): Promise<void>;
|
|
28
|
-
deploy(): Promise<ChainMap<TestRouterContracts>>;
|
|
29
|
-
deployContracts(chain: ChainName): Promise<{
|
|
30
|
-
router: TestRouter;
|
|
31
|
-
}>;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=app.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/test/envSubsetDeployer/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,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