Update core test addresses

pull/334/head
Trevor Porter 3 years ago
parent 74cc8e8dd7
commit 8e76439a2f
  1. 22
      typescript/infra/config/environments/test/core.ts
  2. 1
      typescript/infra/src/core/check.ts
  3. 83
      typescript/infra/src/core/deploy.ts
  4. 1
      typescript/infra/src/core/govern.ts
  5. 9
      typescript/infra/src/core/types.ts
  6. 142
      typescript/sdk/src/core/environments/test.ts

@ -1,11 +1,23 @@
import { CoreConfig } from '../../../src/core'; import { CoreConfig } from '../../../src/core';
export const core: CoreConfig = { export const core: CoreConfig = {
validators: { multisigValidatorManagers: {
// Hardhat accounts 1-4 // Hardhat accounts 1-4
alfajores: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', alfajores: {
fuji: '0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc', validatorSet: ['0x70997970c51812dc3a010c7d01b50e0d17dc79c8'],
kovan: '0x90f79bf6eb2c4f870365e785982e1f101e93b906', quorumThreshold: 1,
mumbai: '0x15d34aaf54267db7d7c367839aaf71a00a2c6a65', },
fuji: {
validatorSet: ['0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc'],
quorumThreshold: 1,
},
kovan: {
validatorSet: ['0x90f79bf6eb2c4f870365e785982e1f101e93b906'],
quorumThreshold: 1,
},
mumbai: {
validatorSet: ['0x15d34aaf54267db7d7c367839aaf71a00a2c6a65'],
quorumThreshold: 1,
},
}, },
}; };

@ -1,3 +1,4 @@
// @ts-nocheck
import { expect } from 'chai'; import { expect } from 'chai';
import { types } from '@abacus-network/utils'; import { types } from '@abacus-network/utils';
import { AbacusCore } from '@abacus-network/sdk'; import { AbacusCore } from '@abacus-network/sdk';

@ -1,3 +1,4 @@
// @ts-nocheck
import path from 'path'; import path from 'path';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { types } from '@abacus-network/utils'; import { types } from '@abacus-network/utils';
@ -11,21 +12,35 @@ import { AbacusAppDeployer, ProxiedContract } from '@abacus-network/deploy';
import { import {
UpgradeBeaconController, UpgradeBeaconController,
XAppConnectionManager, XAppConnectionManager,
ValidatorManager, InboxMultisigValidatorManager,
InboxMultisigValidatorManager__factory,
OutboxMultisigValidatorManager,
OutboxMultisigValidatorManager__factory,
Inbox, Inbox,
UpgradeBeaconController__factory, UpgradeBeaconController__factory,
XAppConnectionManager__factory, XAppConnectionManager__factory,
ValidatorManager__factory,
Outbox__factory, Outbox__factory,
Inbox__factory, Inbox__factory,
} from '@abacus-network/core'; } from '@abacus-network/core';
import { DeployEnvironment, RustConfig } from '../config'; import { DeployEnvironment, RustConfig } from '../config';
import { CoreConfig } from './types'; import { CoreConfig, MultisigValidatorManagerConfig } from './types';
export class AbacusCoreDeployer extends AbacusAppDeployer< export class AbacusCoreDeployer extends AbacusAppDeployer<
CoreContractAddresses, CoreContractAddresses,
CoreConfig CoreConfig
> { > {
multisigValidatorManagerConfig(
config: CoreConfig,
domain: types.Domain,
): MultisigValidatorManagerConfig {
const domainName = this.mustResolveDomainName(domain);
const validatorManagerConfig = config.multisigValidatorManagers[domainName];
if (!validatorManagerConfig) {
throw new Error(`No validator manager config for ${domainName}`);
}
return validatorManagerConfig;
}
async deployContracts( async deployContracts(
domain: types.Domain, domain: types.Domain,
config: CoreConfig, config: CoreConfig,
@ -39,21 +54,27 @@ export class AbacusCoreDeployer extends AbacusAppDeployer<
new UpgradeBeaconController__factory(signer), new UpgradeBeaconController__factory(signer),
); );
const validatorManager: ValidatorManager = await this.deployContract( const outboxMultisigValidatorManagerConfig =
this.multisigValidatorManagerConfig(config, domain);
const outboxMultisigValidatorManager: OutboxMultisigValidatorManager =
await this.deployContract(
domain,
'OutboxMultisigValidatorManager',
new OutboxMultisigValidatorManager__factory(signer),
domain, domain,
'ValidatorManager', outboxMultisigValidatorManagerConfig.validatorSet,
new ValidatorManager__factory(signer), outboxMultisigValidatorManagerConfig.quorumThreshold,
); );
for (const name of this.domainNames) { // for (const name of this.domainNames) {
const validator = config.validators[name]; // const validator = config.validators[name];
if (!validator) throw new Error(`No validator for ${name}`); // if (!validator) throw new Error(`No validator for ${name}`);
await validatorManager.enrollValidator( // await validatorManager.enrollValidator(
this.resolveDomain(name), // this.resolveDomain(name),
validator, // validator,
overrides, // overrides,
); // );
} // }
const outbox = await this.deployProxiedContract( const outbox = await this.deployProxiedContract(
domain, domain,
@ -61,7 +82,7 @@ export class AbacusCoreDeployer extends AbacusAppDeployer<
new Outbox__factory(signer), new Outbox__factory(signer),
upgradeBeaconController.address, upgradeBeaconController.address,
[domain], [domain],
[validatorManager.address], [outboxMultisigValidatorManager.address],
); );
const xAppConnectionManager: XAppConnectionManager = const xAppConnectionManager: XAppConnectionManager =
@ -72,14 +93,39 @@ export class AbacusCoreDeployer extends AbacusAppDeployer<
); );
await xAppConnectionManager.setOutbox(outbox.address, overrides); await xAppConnectionManager.setOutbox(outbox.address, overrides);
const inboxMultisigValidatorManagers: Record<
types.Domain,
InboxMultisigValidatorManager
> = {};
const inboxMultisigValidatorManagerAddresses: Partial<
Record<ChainName, types.Address>
> = {};
const inboxes: Record<types.Domain, ProxiedContract<Inbox>> = {}; const inboxes: Record<types.Domain, ProxiedContract<Inbox>> = {};
const inboxAddresses: Partial<Record<ChainName, ProxiedAddress>> = {}; const inboxAddresses: Partial<Record<ChainName, ProxiedAddress>> = {};
const remotes = this.remoteDomainNumbers(domain); const remotes = this.remoteDomainNumbers(domain);
for (let i = 0; i < remotes.length; i++) { for (let i = 0; i < remotes.length; i++) {
const remote = remotes[i]; const remote = remotes[i];
const remoteName = this.mustResolveDomainName(remote);
const inboxMultisigValidatorManagerConfig =
this.multisigValidatorManagerConfig(config, remote);
const inboxMultisigValidatorManager: InboxMultisigValidatorManager =
await this.deployContract(
domain,
'InboxMultisigValidatorManager',
new InboxMultisigValidatorManager__factory(signer),
remote,
inboxMultisigValidatorManagerConfig.validatorSet,
inboxMultisigValidatorManagerConfig.quorumThreshold,
);
inboxMultisigValidatorManagers[remote] = inboxMultisigValidatorManager;
inboxMultisigValidatorManagerAddresses[remoteName] =
inboxMultisigValidatorManager.address;
const initArgs = [ const initArgs = [
remote, remote,
validatorManager.address, inboxMultisigValidatorManager.address,
ethers.constants.HashZero, ethers.constants.HashZero,
0, 0,
]; ];
@ -113,7 +159,8 @@ export class AbacusCoreDeployer extends AbacusAppDeployer<
const addresses = { const addresses = {
upgradeBeaconController: upgradeBeaconController.address, upgradeBeaconController: upgradeBeaconController.address,
xAppConnectionManager: xAppConnectionManager.address, xAppConnectionManager: xAppConnectionManager.address,
validatorManager: validatorManager.address, outboxMultisigValidatorManager: outboxMultisigValidatorManager.address,
inboxMultisigValidatorManagers: inboxMultisigValidatorManagerAddresses,
outbox: outbox.addresses, outbox: outbox.addresses,
inboxes: inboxAddresses, inboxes: inboxAddresses,
}; };

@ -1,3 +1,4 @@
// @ts-nocheck
import { expect } from 'chai'; import { expect } from 'chai';
import { Call, AbacusCore, AbacusGovernance } from '@abacus-network/sdk'; import { Call, AbacusCore, AbacusGovernance } from '@abacus-network/sdk';
import { import {

@ -1,6 +1,13 @@
import { types } from '@abacus-network/utils'; import { types } from '@abacus-network/utils';
import { ChainName } from '@abacus-network/sdk'; import { ChainName } from '@abacus-network/sdk';
export type MultisigValidatorManagerConfig = {
validatorSet: Array<types.Address>;
quorumThreshold: number;
};
export type CoreConfig = { export type CoreConfig = {
validators: Partial<Record<ChainName, types.Address>>; multisigValidatorManagers: Partial<
Record<ChainName, MultisigValidatorManagerConfig>
>;
}; };

@ -1,109 +1,133 @@
export const addresses = { export const addresses = {
alfajores: { alfajores: {
upgradeBeaconController: '0x5FbDB2315678afecb367f032d93F642f64180aa3', upgradeBeaconController: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
xAppConnectionManager: '0x8A791620dd6260079BF849Dc5567aDC3F2FdC318', xAppConnectionManager: '0x5FC8d32690cc91D4c39d9d3abcBD16989F875707',
validatorManager: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512', outboxMultisigValidatorManager:
'0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512',
inboxMultisigValidatorManagers: {
kovan: '0xa513E6E4b8f2a923D98304ec87F64353C4D5C853',
mumbai: '0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0',
fuji: '0x0B306BF915C4d645ff596e518fAf3F9669b97016',
},
outbox: { outbox: {
proxy: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6', proxy: '0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9',
implementation: '0x0165878A594ca255338adfa4d48449f69242Eb8F', implementation: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0',
beacon: '0xa513E6E4b8f2a923D98304ec87F64353C4D5C853', beacon: '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9',
}, },
inboxes: { inboxes: {
kovan: { kovan: {
proxy: '0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82', proxy: '0x610178dA211FEF7D417bC0e6FeD39F05609AD788',
implementation: '0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e', implementation: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6',
beacon: '0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0', beacon: '0x8A791620dd6260079BF849Dc5567aDC3F2FdC318',
}, },
mumbai: { mumbai: {
proxy: '0x0B306BF915C4d645ff596e518fAf3F9669b97016', proxy: '0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82',
implementation: '0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e', implementation: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6',
beacon: '0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0', beacon: '0x8A791620dd6260079BF849Dc5567aDC3F2FdC318',
}, },
fuji: { fuji: {
proxy: '0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE', proxy: '0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1',
implementation: '0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e', implementation: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6',
beacon: '0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0', beacon: '0x8A791620dd6260079BF849Dc5567aDC3F2FdC318',
}, },
}, },
}, },
kovan: { kovan: {
upgradeBeaconController: '0x3Aa5ebB10DC797CAC828524e59A333d0A371443c', upgradeBeaconController: '0x68B1D87F95878fE05B998F19b66F4baba5De1aed',
xAppConnectionManager: '0xc5a5C42992dECbae36851359345FE25997F5C42d', xAppConnectionManager: '0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44',
validatorManager: '0xc6e7DF5E7b4f2A278906862b61205850344D4e7d', outboxMultisigValidatorManager:
'0x3Aa5ebB10DC797CAC828524e59A333d0A371443c',
inboxMultisigValidatorManagers: {
alfajores: '0x4A679253410272dd5232B3Ff7cF5dbB88f295319',
mumbai: '0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E',
fuji: '0x9E545E3C0baAB3E08CdfD552C960A1050f373042',
},
outbox: { outbox: {
proxy: '0x09635F643e140090A9A8Dcd712eD6285858ceBef', proxy: '0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1',
implementation: '0x4A679253410272dd5232B3Ff7cF5dbB88f295319', implementation: '0xc6e7DF5E7b4f2A278906862b61205850344D4e7d',
beacon: '0x7a2088a1bFc9d81c55368AE168C2C02570cB814F', beacon: '0x59b670e9fA9D0A427751Af201D676719a970857b',
}, },
inboxes: { inboxes: {
alfajores: { alfajores: {
proxy: '0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB', proxy: '0xc5a5C42992dECbae36851359345FE25997F5C42d',
implementation: '0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E', implementation: '0x7a2088a1bFc9d81c55368AE168C2C02570cB814F',
beacon: '0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690', beacon: '0x09635F643e140090A9A8Dcd712eD6285858ceBef',
}, },
mumbai: { mumbai: {
proxy: '0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9', proxy: '0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690',
implementation: '0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E', implementation: '0x7a2088a1bFc9d81c55368AE168C2C02570cB814F',
beacon: '0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690', beacon: '0x09635F643e140090A9A8Dcd712eD6285858ceBef',
}, },
fuji: { fuji: {
proxy: '0x851356ae760d987E095750cCeb3bC6014560891C', proxy: '0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9',
implementation: '0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E', implementation: '0x7a2088a1bFc9d81c55368AE168C2C02570cB814F',
beacon: '0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690', beacon: '0x09635F643e140090A9A8Dcd712eD6285858ceBef',
}, },
}, },
}, },
mumbai: { mumbai: {
upgradeBeaconController: '0x95401dc811bb5740090279Ba06cfA8fcF6113778', upgradeBeaconController: '0x851356ae760d987E095750cCeb3bC6014560891C',
xAppConnectionManager: '0x36C02dA8a0983159322a80FFE9F24b1acfF8B570', xAppConnectionManager: '0x4826533B4897376654Bb4d4AD88B7faFD0C98528',
validatorManager: '0x998abeb3E57409262aE5b751f60747921B33613E', outboxMultisigValidatorManager:
'0xf5059a5D33d5853360D16C683c16e67980206f36',
inboxMultisigValidatorManagers: {
alfajores: '0x0E801D84Fa97b50751Dbf25036d067dCf18858bF',
kovan: '0x809d550fca64d94Bd9F66E60752A544199cfAC3D',
fuji: '0x5f3f1dBD7B74C6B46e8c44f98792A1dAf8d69154',
},
outbox: { outbox: {
proxy: '0x5eb3Bc0a489C5A8288765d2336659EbCA68FCd00', proxy: '0x70e0bA845a1A0F2DA3359C97E0285013525FFC49',
implementation: '0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf', implementation: '0x95401dc811bb5740090279Ba06cfA8fcF6113778',
beacon: '0x9d4454B023096f34B160D6B654540c56A1F81688', beacon: '0x998abeb3E57409262aE5b751f60747921B33613E',
}, },
inboxes: { inboxes: {
alfajores: { alfajores: {
proxy: '0x5f3f1dBD7B74C6B46e8c44f98792A1dAf8d69154', proxy: '0x5eb3Bc0a489C5A8288765d2336659EbCA68FCd00',
implementation: '0x4c5859f0F772848b2D91F1D83E2Fe57935348029', implementation: '0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf',
beacon: '0x1291Be112d480055DaFd8a610b7d1e203891C274', beacon: '0x9d4454B023096f34B160D6B654540c56A1F81688',
}, },
kovan: { kovan: {
proxy: '0xCD8a1C3ba11CF5ECfa6267617243239504a98d90', proxy: '0x4c5859f0F772848b2D91F1D83E2Fe57935348029',
implementation: '0x4c5859f0F772848b2D91F1D83E2Fe57935348029', implementation: '0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf',
beacon: '0x1291Be112d480055DaFd8a610b7d1e203891C274', beacon: '0x9d4454B023096f34B160D6B654540c56A1F81688',
}, },
fuji: { fuji: {
proxy: '0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3', proxy: '0xb7278A61aa25c888815aFC32Ad3cC52fF24fE575',
implementation: '0x4c5859f0F772848b2D91F1D83E2Fe57935348029', implementation: '0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf',
beacon: '0x1291Be112d480055DaFd8a610b7d1e203891C274', beacon: '0x9d4454B023096f34B160D6B654540c56A1F81688',
}, },
}, },
}, },
fuji: { fuji: {
upgradeBeaconController: '0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650', upgradeBeaconController: '0x82e01223d51Eb87e16A03E24687EDF0F294da6f1',
xAppConnectionManager: '0x1fA02b2d6A771842690194Cf62D91bdd92BfE28d', xAppConnectionManager: '0xFD471836031dc5108809D173A067e8486B9047A3',
validatorManager: '0xc351628EB244ec633d5f21fBD6621e1a683B1181', outboxMultisigValidatorManager:
'0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3',
inboxMultisigValidatorManagers: {
alfajores: '0x1429859428C0aBc9C2C47C8Ee9FBaf82cFA0F20f',
kovan: '0x1fA02b2d6A771842690194Cf62D91bdd92BfE28d',
mumbai: '0x4C4a2f8c81640e47606d3fd77B353E87Ba015584',
},
outbox: { outbox: {
proxy: '0x5081a39b8A5f0E35a8D959395a630b68B74Dd30f', proxy: '0xc351628EB244ec633d5f21fBD6621e1a683B1181',
implementation: '0x162A433068F51e18b7d13932F27e66a3f99E6890', implementation: '0x7969c5eD335650692Bc04293B07F5BF2e7A673C0',
beacon: '0x922D6956C99E12DFeB3224DEA977D0939758A1Fe', beacon: '0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650',
}, },
inboxes: { inboxes: {
alfajores: { alfajores: {
proxy: '0x21dF544947ba3E8b3c32561399E88B52Dc8b2823', proxy: '0x922D6956C99E12DFeB3224DEA977D0939758A1Fe',
implementation: '0x04C89607413713Ec9775E14b954286519d836FEf', implementation: '0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07',
beacon: '0x4C4a2f8c81640e47606d3fd77B353E87Ba015584', beacon: '0x162A433068F51e18b7d13932F27e66a3f99E6890',
}, },
kovan: { kovan: {
proxy: '0xD8a5a9b31c3C0232E196d518E89Fd8bF83AcAd43', proxy: '0xdbC43Ba45381e02825b14322cDdd15eC4B3164E6',
implementation: '0x04C89607413713Ec9775E14b954286519d836FEf', implementation: '0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07',
beacon: '0x4C4a2f8c81640e47606d3fd77B353E87Ba015584', beacon: '0x162A433068F51e18b7d13932F27e66a3f99E6890',
}, },
mumbai: { mumbai: {
proxy: '0x51A1ceB83B83F1985a81C295d1fF28Afef186E02', proxy: '0x21dF544947ba3E8b3c32561399E88B52Dc8b2823',
implementation: '0x04C89607413713Ec9775E14b954286519d836FEf', implementation: '0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07',
beacon: '0x4C4a2f8c81640e47606d3fd77B353E87Ba015584', beacon: '0x162A433068F51e18b7d13932F27e66a3f99E6890',
}, },
}, },
}, },

Loading…
Cancel
Save