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: init script for xTokens #4838

Merged
merged 2 commits into from
Aug 24, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ export const TESTNET_PRODUCTION_INIT_CONFIG: InitConfig = {
adopted: "0xb6932c8363354df7620a7a7bF3a933A253015cA3",
},
/// MUMBAI
"9991": {
local: "0x3fC9473d9dF84887D483A93a8d207f90D9bE63C4",
adopted: "0x3fC9473d9dF84887D483A93a8d207f90D9bE63C4",
"9991": {
local: "0x3fC9473d9dF84887D483A93a8d207f90D9bE63C4",
adopted: "0x3fC9473d9dF84887D483A93a8d207f90D9bE63C4",
},
},
},
Expand All @@ -167,79 +167,6 @@ export const TESTNET_PRODUCTION_INIT_CONFIG: InitConfig = {
},
},
},
// {
// name: "WETH",
// canonical: {
// domain: "1735353714",
// address: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
// decimals: 18,
// },
// representations: {
// "1735356532": {
// local: "0x39B061B7e41DE8B721f9aEcEB6b3f17ECB7ba63E",
// adopted: "0x74c6FD7D2Bc6a8F0Ebd7D78321A95471b8C2B806",
// },
// "9991": {
// local: "0x1E5341E4b7ed5D0680d9066aac0396F0b1bD1E69",
// adopted: "0xFD2AB41e083c75085807c4A65C0A14FDD93d55A9",
// },
// /// ARBITRUM-GOERLI
// "1734439522": {
// adopted: "0x1346786E6A5e07b90184a1Ba58E55444b99DC4A2",
// },
// /// ZKSYNC-TEST
// "2053862260": {
// local: "0xbef9DE2c456895cdafB0ecB764d2DedFF58ed157",
// adopted: "0xbef9DE2c456895cdafB0ecB764d2DedFF58ed157",
// },
// /// CONSENSYS-ZKEVM-TEST
// "1668247156": {
// local: "0xB706319D37b945727E71ae0d4353699d19112576",
// adopted: "0xB706319D37b945727E71ae0d4353699d19112576",
// },
// /// POLYGON-ZKEVM-TEST
// "1887071092": {
// adopted: "0xeE589e91401066068AF129B0005aC3EF69E3fdB4",
// },
// },
// },
// {
// name: "HARD",
// canonical: {
// domain: "1735353714",
// address: "0x5c8279211C48abb8b2c104b493561e1EcFB9a595",
// decimals: 18,
// cap: utils.parseUnits("10000000", 18).toString(),
// },
// representations: {
// /// OPTIMISM-GOERLI
// "1735356532": {
// adopted: "0x1956831c14d2e193386159837644F193D12b2755",
// local: "0x1956831c14d2e193386159837644F193D12b2755",
// },
// /// MUMBAI
// "9991": {
// adopted: "0xfA2F9cE589b30F1E4C8Bf20BcB496032087baaF0",
// local: "0xfA2F9cE589b30F1E4C8Bf20BcB496032087baaF0",
// },
// /// ARBITRUM-GOERLI
// "1734439522": {
// adopted: "0x0000000000000000000000000000000000000000",
// },
// /// ZKSYNC-TEST
// "2053862260": {
// adopted: "0x0000000000000000000000000000000000000000",
// },
// /// CONSENSYS-ZKEVM-TEST
// "1668247156": {
// adopted: "0x0000000000000000000000000000000000000000",
// },
// /// POLYGON-ZKEVM-TEST
// "1887071092": {
// adopted: "0x0000000000000000000000000000000000000000",
// },
// },
// },
],
agents: {
relayerFeeVaults: {
Expand All @@ -249,6 +176,13 @@ export const TESTNET_PRODUCTION_INIT_CONFIG: InitConfig = {
"1634886255": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"6450786": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"6778479": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"1735353714": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"1735356532": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"1734439522": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"9991": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"2053862260": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"1668247156": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
"1887071092": "0xade09131C6f43fe22C2CbABb759636C43cFc181e",
},
watchers: {
allowlist: ["0x2cfBF3D40F71ceed2997cACbafE9D31e630860CB", "0x54BAA998771639628ffC0206c3b916c466b79c89"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const setupAsset = async (args: {

// Set up all the representational assets on their respective domains.
for (const [domain, representation] of Object.entries(asset.representations)) {
if (!representation) return;
const stableswapPool = constants.AddressZero;

const network = networks.find((n) => n.domain === domain);
Expand Down
4 changes: 3 additions & 1 deletion packages/deployments/contracts/src/cli/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export const sanitizeAndInit = async () => {
const assetDomains = [asset.canonical.domain].concat(Object.keys(asset.representations));

const configuredDomains = domains.filter((domain) => assetDomains.includes(domain));
if (JSON.stringify(configuredDomains.sort()) != JSON.stringify(domains.sort())) {
const isSubset = configuredDomains.every((item) => domains.includes(item));
if (!isSubset) {
throw new Error(
`Not configured asset domains, asset: ${asset.name}, canonical: (${asset.canonical.domain}, ${
asset.canonical.address
Expand Down Expand Up @@ -386,6 +387,7 @@ export const initProtocol = async (protocol: ProtocolStack, apply: boolean, stag
if (!adopteds[key]) {
adopteds[key] = [];
}
if (!value) return;
value.adopted === constants.AddressZero ? "" : adopteds[key].push(value.adopted);
if (!value.local) {
return;
Expand Down