Skip to content

Commit

Permalink
feat: fraxtal config
Browse files Browse the repository at this point in the history
  • Loading branch information
prathmeshkhandelwal1 committed Apr 1, 2024
1 parent e8a2965 commit 87980ea
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/agents/sdk/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ export const domainsToChainNames: Record<string, string> = {
"1935897199": "scroll",
"1936027759": "sepolia",
"1869640549": "optimism-sepolia",
"1633842021": "arbitrum-sepolia"
"1633842021": "arbitrum-sepolia",
"1718772088": "fraxtal",
};

// Need to add more domains here.
Expand All @@ -216,7 +217,8 @@ export const XERC20REGISTRY_DOMAIN_ADDRESS: Record<string, string> = {
"1935897199": "0x397aEEEDd44f40326f9eB583a1DFB8A7A673C40B", // scroll
"1936027759": "0x2a3fe9a49fb50536f1ed099192c2ae2404de7bb5", // sepolia
"1869640549": "0x18b5b08b10a2e351180f07e31f4fef94d14e28f6", // op-sepolia
"1633842021": "0x343d827d5109e8038bbb71e9ba4f3fd0d546b9ff" // arb-sepolia
"1633842021": "0x343d827d5109e8038bbb71e9ba4f3fd0d546b9ff", // arb-sepolia
"1718772088": "", // fraxtal
};

// Need to add more domains here.
Expand All @@ -234,5 +236,6 @@ export const LOCKBOX_ADAPTER_DOMAIN_ADDRESS: Record<string, string> = {
"1935897199": "", // scroll (TODO)
"1936027759": "0xcF021fCFB9bd72E5aA7ab390cFA4fCfDF895c7Cf", // sepolia
"1869640549": "0x20b4789065DE09c71848b9A4FcAABB2c10006FA2", // op-sepolia
"1633842021": "0x0f4Fe4903d01E0deb067A7297453fBEFdC36D189" // arb-sepolia
"1633842021": "0x0f4Fe4903d01E0deb067A7297453fBEFdC36D189", // arb-sepolia
"1718772088": "", // fraxtal
};
29 changes: 29 additions & 0 deletions packages/deployments/contracts/deployConfig/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const BLOCKS_PER_MINUTE: Record<number, number> = {
84531: 30, // base-goerli
195: 60, // x1-testnet
534351: 14, // scroll sepolia l2
252: 30, // Fraxtal
};

const THIRTY_MINUTES_IN_BLOCKS = Object.fromEntries(
Expand Down Expand Up @@ -770,6 +771,34 @@ export const MESSAGING_PROTOCOL_CONFIGS: Record<string, MessagingProtocolConfig>
},
},
},
252: {
prefix: "Optimism",
networkName: "Fraxtal",
ambs: {
// L1CrossDomainMessenger
// https://docs.frax.com/fraxtal/addresses/fraxtal-contracts#ethereum-mainnet
hub: "0x126bcc31Bc076B3d515f60FBC81FddE0B0d542Ed",
// L2CrossDomainMessenger
spoke: "0x4200000000000000000000000000000000000007",
},
processGas: DEFAULT_PROCESS_GAS,
reserveGas: DEFAULT_RESERVE_GAS,
delayBlocks: THIRTY_MINUTES_IN_BLOCKS[252],
disputeBlocks: THIRTY_MINUTES_IN_BLOCKS[252],
minDisputeBlocks: THIRTY_MINUTES_IN_BLOCKS[252],
custom: {
hub: {
// OptimismPortal
// https://docs.frax.com/fraxtal/addresses/fraxtal-contracts#ethereum-mainnet
// https://etherscan.io/address/0x36cb65c1967A0Fb0EEE11569C51C2f2aA1Ca6f6D#code
optimismPortal: "0x36cb65c1967A0Fb0EEE11569C51C2f2aA1Ca6f6D",
gasCap: DEFAULT_PROCESS_GAS,
},
spoke: {
gasCap: DEFAULT_PROCESS_GAS,
},
},
},
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const SUPPORTED_DOMAINS = {
1835101812, // Mantle
1836016741, // Mode
1935897199, // Scroll
1718772088, // Fraxtal
],
testnet: [
1735353714, // goerli
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const MAINNET_PRODUCTION_INIT_CONFIG: InitConfig = {
"1835101812", // Mantle
"1836016741", // Mode
"1935897199", // Scroll
"1718772088", // Fraxtal
],
// NOTE: ENSURE LPTOKEN AND BRIDGETOKEN NAMES ARE GENERATED CORRECTLY BASED
// ON THE NAME GIVEN IN EACH ASSET ENTRY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const MAINNET_STAGING_INIT_CONFIG: InitConfig = {
"1835101812", // Mantle
"1836016741", // Mode
"1935897199", // Scroll
"1718772088", // Fraxtal
],
// NOTE: ENSURE LPTOKEN AND BRIDGETOKEN NAMES ARE GENERATED CORRECTLY BASED
// ON THE NAME GIVEN IN EACH ASSET ENTRY
Expand Down
15 changes: 15 additions & 0 deletions packages/deployments/contracts/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,19 @@ export const hardhatNetworks = {
},
},
},
fraxtal: {
accounts: { mnemonic: mainnetMnemonic ?? mnemonic },
chainId: 252,
url: urlOverride || process.env.FRAXTAL_PROVIDER_URL || "https://rpc.frax.com",
companionNetworks: {
hub: "mainnet",
},
gasPrice: utils.parseUnits("1.5", "gwei").toNumber(),
verify: {
etherscan: {
apiKey: process.env.FRAXTAL_EXPLORER_API_KEY!,
apiUrl: "https://fraxscan.com/",
},
},
},
};
1 change: 1 addition & 0 deletions packages/utils/src/helpers/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const mainnetChainIdToDomainMapping: Map<number, number> = new Map([
[5000, 0x6d616e74], // Mantle (mantle interpreted as int) 1835101812
[34443, 0x6d6f6465], // Mode (mode interpreted as int) 1836016741
[534352, 0x7363726f], // Scroll (scroll interpreted as int) 1935897199
[252, 0x66726178], // Fraxtal (fraxtal interpreted as int) 1718772088
]);

const testnetChainIdToDomainMapping: Map<number, number> = new Map([
Expand Down

0 comments on commit 87980ea

Please sign in to comment.