diff --git a/scripts/admin/rescueFunds.ts b/scripts/admin/rescueFunds.ts index 21c91667..f16fe016 100644 --- a/scripts/admin/rescueFunds.ts +++ b/scripts/admin/rescueFunds.ts @@ -189,7 +189,7 @@ export const main = async () => { ETH_ADDRESS, signer.address, rescueAmount, - { ...overrides(parseInt(chainSlug)) } + { ...(await overrides(parseInt(chainSlug))) } ); console.log( `Rescuing ${rescueAmount} from ${contractAddr[index]} on ${chainSlug}: ${tx.hash}` diff --git a/scripts/admin/rotate-owner/1-nominate.ts b/scripts/admin/rotate-owner/1-nominate.ts index 2943da86..a77caa51 100644 --- a/scripts/admin/rotate-owner/1-nominate.ts +++ b/scripts/admin/rotate-owner/1-nominate.ts @@ -162,7 +162,7 @@ const checkAndNominate = async ( if (sendTx) { console.log(`✨ ${label}: Nominating`); const tx = await contract.nominateOwner(newOwner, { - ...overrides(parseInt(chainSlug)), + ...(await overrides(parseInt(chainSlug))), }); const receipt = await tx.wait(); console.log(`🚀 ${label}: Done: ${receipt.transactionHash}`); diff --git a/scripts/admin/rotate-owner/2-claim.ts b/scripts/admin/rotate-owner/2-claim.ts index 056ab42f..59432a76 100644 --- a/scripts/admin/rotate-owner/2-claim.ts +++ b/scripts/admin/rotate-owner/2-claim.ts @@ -145,7 +145,9 @@ const checkAndClaim = async ( if (sendTx) { console.log(`✨ ${label}: Claiming`); - const tx = await contract.claimOwner({ ...overrides(parseInt(chainSlug)) }); + const tx = await contract.claimOwner({ + ...(await overrides(parseInt(chainSlug))), + }); const receipt = await tx.wait(); console.log(`🚀 ${label}: Done: ${receipt.transactionHash}`); } else { diff --git a/scripts/admin/setFees.ts b/scripts/admin/setFees.ts index a8101026..bd60a612 100644 --- a/scripts/admin/setFees.ts +++ b/scripts/admin/setFees.ts @@ -39,7 +39,7 @@ const main = async () => { ); const nonce = await switchboard.nextNonce(switchboard.signer.getAddress(), { - ...overrides(chain), + ...(await overrides(chain)), }); const digest = keccak256( defaultAbiCoder.encode( @@ -72,7 +72,7 @@ const main = async () => { switchboardFees, verificationOverheadFees, signature, - { ...overrides(chain) } + { ...(await overrides(chain)) } ); console.log(tx.hash); diff --git a/scripts/admin/tripGlobal.ts b/scripts/admin/tripGlobal.ts index b3e9b6c9..6d391633 100644 --- a/scripts/admin/tripGlobal.ts +++ b/scripts/admin/tripGlobal.ts @@ -126,7 +126,7 @@ const main = async () => { newTripStatus: !tripStatus, signature, nonce, - ...overrides(chain), + ...(await overrides(chain)), }); if (sendTx) { @@ -147,11 +147,11 @@ const sendTxn = async ( let tx; if (trip) tx = await switchboard.tripGlobal(nonce, signature, { - ...overrides(chain), + ...(await overrides(chain)), }); if (untrip) tx = await switchboard.unTrip(nonce, signature, { - ...overrides(chain), + ...(await overrides(chain)), }); console.log(tx.hash); diff --git a/scripts/admin/untripPath.ts b/scripts/admin/untripPath.ts index 6480d1c8..042917d5 100644 --- a/scripts/admin/untripPath.ts +++ b/scripts/admin/untripPath.ts @@ -119,7 +119,7 @@ const main = async () => { newTripStatus: !tripStatus, signature, nonce, - ...overrides(chain), + ...(await overrides(chain)), }); if (sendTx) { @@ -138,7 +138,7 @@ const sendTxn = async ( switchboard: Contract ) => { let tx = await switchboard.unTripPath(nonce, siblingChain, signature, { - ...overrides(chain), + ...(await overrides(chain)), }); console.log(tx.hash); diff --git a/scripts/constants/overrides.ts b/scripts/constants/overrides.ts new file mode 100644 index 00000000..9a51257a --- /dev/null +++ b/scripts/constants/overrides.ts @@ -0,0 +1,125 @@ +import { ChainSlug } from "../../src/enums/chainSlug"; +import { BigNumber, providers } from "ethers"; + +const defaultType = 0; + +export const chainOverrides: { + [chainSlug in ChainSlug]?: { + type?: number; + gasLimit?: number; + gasPrice?: number; + }; +} = { + [ChainSlug.ARBITRUM_SEPOLIA]: { + type: 1, + gasLimit: 50_000_000, + gasPrice: 200_000_000, + }, + [ChainSlug.BSC]: { + gasLimit: 6_000_000, + }, + [ChainSlug.MAINNET]: { + gasLimit: 6_000_000, + // gasPrice: 5_000_000_000, // calculate in real time + }, + + [ChainSlug.POLYGON_MAINNET]: { + // gasPrice: 50_000_000_000, // calculate in real time + }, + [ChainSlug.SEPOLIA]: { + type: 1, + gasLimit: 2_000_000, + // gasPrice: 50_000_000_000, // calculate in real time + }, + [ChainSlug.AEVO_TESTNET]: { + type: 2, + }, + [ChainSlug.LYRA_TESTNET]: { + type: 2, + }, + [ChainSlug.MODE_TESTNET]: { + type: 1, + gasPrice: 100_000_000, + }, + [ChainSlug.MODE]: { + type: 1, + gasLimit: 10_000_000, + gasPrice: 1_000_000, + }, + + [ChainSlug.SYNDR_SEPOLIA_L3]: { + type: 1, + gasLimit: 500_000_000, + gasPrice: 1_000_000, + }, + [ChainSlug.HOOK]: { + gasLimit: 7_000_000, + }, + [ChainSlug.REYA_CRONOS]: { + type: 1, + gasPrice: 100_000_000, + }, + [ChainSlug.REYA]: { + type: 1, + gasPrice: 100_000_000, + }, + [ChainSlug.POLYNOMIAL_TESTNET]: { + gasLimit: 4_000_000, + }, + [ChainSlug.BOB]: { + type: 1, + gasLimit: 4_000_000, + gasPrice: 100_000_000, + }, + [ChainSlug.KINTO]: { + gasLimit: 4_000_000, + }, + [ChainSlug.KINTO_DEVNET]: { + gasLimit: 4_000_000, + }, + [ChainSlug.MANTLE]: { + type: 1, + gasLimit: 100_000_000_000, + gasPrice: 30_000_000, + }, + [ChainSlug.NEOX_TESTNET]: { + type: 1, + gasLimit: 1_000_000, + gasPrice: 212_000_000_000, + }, +}; + +export const getOverrides = async ( + chainSlug: ChainSlug, + provider: providers.StaticJsonRpcProvider +) => { + let overrides = chainOverrides[chainSlug]; + let gasPrice = overrides?.gasPrice; + let gasLimit = overrides?.gasLimit; + let type = overrides?.type; + if (!gasPrice) gasPrice = (await getGasPrice(chainSlug, provider)).toNumber(); + if (type == undefined) type = defaultType; + // if gas limit is undefined, ethers will calcuate it automatically. If want to override, + // add in the overrides object. Dont set a default value + return { gasLimit, gasPrice, type }; +}; + +export const getGasPrice = async ( + chainSlug: ChainSlug, + provider: providers.StaticJsonRpcProvider +): Promise => { + let gasPrice = await provider.getGasPrice(); + + if (chainSlug === ChainSlug.POLYGON_MAINNET) { + return gasPrice.mul(BigNumber.from(115)).div(BigNumber.from(100)); + } + + if ([ChainSlug.MAINNET].includes(chainSlug as ChainSlug)) { + return gasPrice.mul(BigNumber.from(105)).div(BigNumber.from(100)); + } + + if ([ChainSlug.SEPOLIA].includes(chainSlug as ChainSlug)) { + return gasPrice.mul(BigNumber.from(150)).div(BigNumber.from(100)); + } + return gasPrice; +}; diff --git a/scripts/deploy/config/config.ts b/scripts/deploy/config/config.ts index 792e07b0..5494df9c 100644 --- a/scripts/deploy/config/config.ts +++ b/scripts/deploy/config/config.ts @@ -9,6 +9,8 @@ import { } from "../../../src"; import { BigNumberish, utils } from "ethers"; import chainConfig from "../../../chainConfig.json"; +import { getOverrides } from "../../constants/overrides"; +import { getProviderFromChainSlug } from "../../constants"; export const mode = process.env.DEPLOYMENT_MODE as | DeploymentMode @@ -80,10 +82,6 @@ export const capacitorType = 1; export const maxPacketLength = 1; export const initialPacketCount = 0; -export const gasLimit = undefined; -export const gasPrice = undefined; -export const type = 0; - const MSG_VALUE_MAX_THRESHOLD = utils.parseEther("0.001"); export const msgValueMaxThreshold = (chain: ChainSlug): BigNumberish => { if (chainConfig[chain] && chainConfig[chain].msgValueMaxThreshold) @@ -129,188 +127,15 @@ export const hexagateTripRoleOwners = { [DeploymentMode.PROD]: "0x081871d78fe7c35c774ce3b4d4ba6592519db223", }; -export const overrides = ( +export const overrides = async ( chain: ChainSlug | number -): { +): Promise<{ type?: number | undefined; gasLimit?: BigNumberish | undefined; gasPrice?: BigNumberish | undefined; -} => { - if (chain == ChainSlug.ARBITRUM) { - return { - // type, - // gasLimit: 200_000_000, - // gasPrice, - }; - } else if (chain == ChainSlug.ARBITRUM_SEPOLIA) { - return { - type: 1, - gasLimit: 50_000_000, - gasPrice: 200_000_000, - }; - } else if (chain == ChainSlug.OPTIMISM) { - return { - // type, - // gasLimit: 4_000_000, - // gasPrice, - }; - } else if (chain == ChainSlug.BASE) { - return { - // type, - // gasLimit: 2_000_000, - // gasPrice: 2_000_000_000, - }; - } else if (chain == ChainSlug.OPTIMISM_SEPOLIA) { - return { - // type: 1, - // gasLimit: 5_000_000, - // gasPrice: 4_000_000_000, - }; - } else if (chain == ChainSlug.BSC) { - return { - type, - gasLimit: 6_000_000, - gasPrice, - }; - } else if (chain == ChainSlug.MAINNET) { - return { - // type: 1, - gasLimit: 6_000_000, - gasPrice: 5_000_000_000, - }; - } else if (chain == ChainSlug.POLYGON_MAINNET) { - return { - type, - gasLimit, - gasPrice: 50_000_000_000, - }; - } else if (chain == ChainSlug.SEPOLIA) { - return { - type: 1, - gasLimit: 2_000_000, - gasPrice: 50_000_000_000, - }; - } else if (chain == ChainSlug.AEVO_TESTNET) { - return { - type: 2, - // gasLimit, - // gasPrice, - }; - } else if (chain == ChainSlug.AEVO) { - return { - type: 1, - // gasLimit, - gasPrice: 100_000_000, - }; - } else if (chain == ChainSlug.LYRA_TESTNET) { - return { - type: 2, - // gasLimit, - // gasPrice: 100_000_000, - }; - } else if (chain == ChainSlug.LYRA) { - return { - // type: 1, - // gasLimit, - // gasPrice: 100_000_000, - }; - } else if (chain == ChainSlug.SX_NETWORK_TESTNET) { - return { - // type: 1, - // gasLimit, - // gasPrice: 100_000_000, - }; - } else if (chain == ChainSlug.MODE_TESTNET) { - return { - type: 1, - // gasLimit, - gasPrice: 100_000_000, - }; - } else if (chain == ChainSlug.MODE) { - return { - type: 1, - gasLimit: 10_000_000, - gasPrice: 1_000_000, - }; - } else if (chain == ChainSlug.SYNDR_SEPOLIA_L3) { - return { - type: 1, - gasLimit: 500_000_000, - gasPrice: 1_000_000, - }; - } else if (chain == ChainSlug.HOOK) { - return { - // type: 1, - gasLimit: 7_000_000, - // gasPrice: 100000000, - }; - } else if (chain == ChainSlug.REYA_CRONOS) { - return { - type: 1, - // gasLimit: 200000, - gasPrice: 100_000_000, - }; - } else if (chain == ChainSlug.REYA) { - return { - type: 1, - // gasLimit: 20000000, - gasPrice: 100_000_000, - }; - } else if (chain == ChainSlug.POLYNOMIAL_TESTNET) { - return { - type, - gasLimit: 4_000_000, - gasPrice, - }; - } else if (chain == ChainSlug.BOB) { - return { - type: 1, - gasLimit: 4_000_000, - gasPrice: 100_000_000, - }; - } else if (chain == ChainSlug.KINTO) { - return { - type, - gasLimit: 4_000_000, - gasPrice, - }; - } else if (chain == ChainSlug.KINTO_DEVNET) { - return { - type, - gasLimit: 4_000_000, - gasPrice, - }; - } else if (chain == ChainSlug.SIPHER_FUNKI_TESTNET) { - return { - // type, - // gasLimit, - // gasPrice, - }; - } else if (chain == ChainSlug.WINR) { - return { - // type, - // gasLimit, - // gasPrice, - }; - } else if (chain == ChainSlug.BLAST) { - return { - // type, - // gasLimit, - // gasPrice, - }; - } else if (chain == ChainSlug.MANTLE) { - return { - type: 1, - gasLimit: 100_000_000_000, - gasPrice: 30_000_000, - }; - } else if (chain == ChainSlug.NEOX_TESTNET) { - return { - type: 1, - gasLimit: 1_000_000, - gasPrice: 212_000_000_000, - }; - } else if (chainConfig[chain] && chainConfig[chain].overrides) { - return chainConfig[chain].overrides!; - } else return { type, gasLimit, gasPrice }; +}> => { + if (chainConfig[chain]?.overrides) { + return chainConfig[chain].overrides; + } + return await getOverrides(chain, getProviderFromChainSlug(chain)); }; diff --git a/scripts/deploy/scripts/configureSocket.ts b/scripts/deploy/scripts/configureSocket.ts index caac23fb..1762d035 100644 --- a/scripts/deploy/scripts/configureSocket.ts +++ b/scripts/deploy/scripts/configureSocket.ts @@ -64,24 +64,24 @@ export const setManagers = async ( let tx; const currentEM = await socket.executionManager__({ - ...overrides(await socketSigner.getChainId()), + ...(await overrides(await socketSigner.getChainId())), }); if ( currentEM.toLowerCase() !== addr[executionManagerVersion]?.toLowerCase() ) { tx = await socket.setExecutionManager(addr[executionManagerVersion], { - ...overrides(await socketSigner.getChainId()), + ...(await overrides(await socketSigner.getChainId())), }); console.log("updateExecutionManager", tx.hash); await tx.wait(); } const currentTM = await socket.transmitManager__({ - ...overrides(await socketSigner.getChainId()), + ...(await overrides(await socketSigner.getChainId())), }); if (currentTM.toLowerCase() !== addr.TransmitManager?.toLowerCase()) { tx = await socket.setTransmitManager(addr.TransmitManager, { - ...overrides(await socketSigner.getChainId()), + ...(await overrides(await socketSigner.getChainId())), }); console.log("updateTransmitManager", tx.hash); await tx.wait(); @@ -106,7 +106,7 @@ export const configureExecutionManager = async ( let nextNonce = ( await executionManagerContract.nextNonce(socketSigner.address, { - ...overrides(chain), + ...(await overrides(chain)), }) ).toNumber(); @@ -115,7 +115,7 @@ export const configureExecutionManager = async ( siblingSlugs.map(async (siblingSlug) => { let currentValue = await executionManagerContract.msgValueMaxThreshold( siblingSlug, - { ...overrides(chain) } + { ...(await overrides(chain)) } ); if ( @@ -163,7 +163,7 @@ export const configureExecutionManager = async ( let tx = await socketBatcherContract.setExecutionFeesBatch( emAddress, requests, - { ...overrides(chain) } + { ...(await overrides(chain)) } ); console.log("configured EM for ", chain, tx.hash); await tx.wait(); @@ -223,7 +223,7 @@ export const setupPolygonNativeSwitchboard = async (addresses) => { const tx = await sbContract .connect(socketSigner) .setFxChildTunnel(dstSwitchboardAddress, { - ...overrides(await socketSigner.getChainId()), + ...(await overrides(await socketSigner.getChainId())), }); console.log(srcChain, tx.hash); await tx.wait(); @@ -241,7 +241,7 @@ export const setupPolygonNativeSwitchboard = async (addresses) => { const tx = await sbContract .connect(socketSigner) .setFxRootTunnel(dstSwitchboardAddress, { - ...overrides(await socketSigner.getChainId()), + ...(await overrides(await socketSigner.getChainId())), }); console.log(srcChain, tx.hash); await tx.wait(); diff --git a/scripts/deploy/scripts/connect.ts b/scripts/deploy/scripts/connect.ts index 84020a0b..56313799 100644 --- a/scripts/deploy/scripts/connect.ts +++ b/scripts/deploy/scripts/connect.ts @@ -75,7 +75,7 @@ export const connectPlugs = async ( if (!switchboard) continue; const configs = await socket.getPlugConfig(counter.address, sibling, { - ...overrides(chain), + ...(await overrides(chain)), }); if ( configs["siblingPlug"].toLowerCase() === @@ -91,7 +91,7 @@ export const connectPlugs = async ( sibling, siblingCounter, switchboard, - { ...overrides(chain) } + { ...(await overrides(chain)) } ); console.log( diff --git a/scripts/deploy/scripts/deploySocket.ts b/scripts/deploy/scripts/deploySocket.ts index 2d457d3e..33f55e0b 100644 --- a/scripts/deploy/scripts/deploySocket.ts +++ b/scripts/deploy/scripts/deploySocket.ts @@ -172,14 +172,14 @@ export const deploySocket = async ( await getInstance("SocketSimulator", socketSimulator.address) ).connect(deployUtils.signer); let capacitor = await simulatorContract.capacitor({ - ...overrides(chainSlug), + ...(await overrides(chainSlug)), }); if (capacitor == constants.AddressZero) { const tx = await simulatorContract.setup( switchboardSimulator.address, simulatorUtils.address, { - ...overrides(chainSlug), + ...(await overrides(chainSlug)), } ); console.log(tx.hash, "setup for simulator"); @@ -187,7 +187,7 @@ export const deploySocket = async ( } deployUtils.addresses["CapacitorSimulator"] = - await simulatorContract.capacitor({ ...overrides(chainSlug) }); + await simulatorContract.capacitor({ ...(await overrides(chainSlug)) }); deployUtils.addresses.startBlock = deployUtils.addresses.startBlock ? deployUtils.addresses.startBlock : await socketSigner.provider?.getBlockNumber(); diff --git a/scripts/deploy/scripts/registerSwitchboard.ts b/scripts/deploy/scripts/registerSwitchboard.ts index 9dd22a2b..daba6380 100644 --- a/scripts/deploy/scripts/registerSwitchboard.ts +++ b/scripts/deploy/scripts/registerSwitchboard.ts @@ -38,7 +38,7 @@ export default async function registerSwitchboardForSibling( initialPacketCount, siblingSwitchBoardAddress, { - ...overrides(await signer.getChainId()), + ...(await overrides(await signer.getChainId())), } ); console.log( diff --git a/scripts/deploy/scripts/roles.ts b/scripts/deploy/scripts/roles.ts index 69e8e1ae..336c4a32 100644 --- a/scripts/deploy/scripts/roles.ts +++ b/scripts/deploy/scripts/roles.ts @@ -144,7 +144,7 @@ const executeRoleTransactions = async ( let tx = await wallet.sendTransaction({ to: contractAddress, data, - ...overrides(chainSlug), + ...(await overrides(chainSlug)), }); console.log( `chain: ${chainSlug}`, @@ -170,7 +170,7 @@ const executeOtherTransactions = async ( let tx = await wallet.sendTransaction({ to, data, - ...overrides(chainSlug), + ...(await overrides(chainSlug)), }); console.log(`to: ${to}, txHash: ${tx?.hash}`); await tx.wait(); @@ -250,7 +250,7 @@ const checkNativeSwitchboardRoles = async ({ let hasRole = await instance.callStatic["hasRole(bytes32,address)"]( getRoleHash(role), userAddress, - { ...overrides(chainSlug) } + { ...(await overrides(chainSlug)) } ); if (!roleStatus[chainSlug][pseudoContractName]["global"]) @@ -354,7 +354,9 @@ export const checkAndUpdateRoles = async ( return; let hasRole = await instance.callStatic[ "hasRole(bytes32,address)" - ](getRoleHash(role), userAddress, { ...overrides(chainSlug) }); + ](getRoleHash(role), userAddress, { + ...(await overrides(chainSlug)), + }); if (isRoleChanged(hasRole, newRoleStatus)) { if (!roleStatus[chainSlug][contractName!]["global"]) { roleStatus[chainSlug][contractName!]["global"] = []; @@ -409,7 +411,7 @@ export const checkAndUpdateRoles = async ( ]( getChainRoleHash(role, Number(siblingSlug)), userAddress, - { ...overrides(chainSlug) } + { ...(await overrides(chainSlug)) } ); if (isRoleChanged(hasRole, newRoleStatus)) { diff --git a/scripts/deploy/utils/utils.ts b/scripts/deploy/utils/utils.ts index f79af3c5..44979348 100644 --- a/scripts/deploy/utils/utils.ts +++ b/scripts/deploy/utils/utils.ts @@ -89,7 +89,7 @@ export async function deployContractWithArgs( ); // gasLimit is set to undefined to not use the value set in overrides const contract: Contract = await Contract.connect(signer).deploy(...args, { - ...overrides(await signer.getChainId()), + ...(await overrides(await signer.getChainId())), }); await contract.deployed(); return contract; diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index 5783b477..cdae0671 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -1,37 +1,36 @@ import { + arbChains, + arbL3Chains, ChainSlug, - getAddresses, - Integrations, - DeploymentMode, - S3Config, + chainSlugToHardhatChainName, ChainSlugToId, - TestnetIds, - MainnetIds, - getAllAddresses, + ChainSocketAddresses, ChainType, - TxData, - chainSlugToHardhatChainName, + DeploymentAddresses, + DeploymentMode, + getAddresses, + getAllAddresses, getCurrency, + MainnetIds, opStackL2Chain, - arbChains, - arbL3Chains, polygonCDKChains, S3ChainConfig, - FinalityBucket, - DeploymentAddresses, - ChainSocketAddresses, + S3Config, + TestnetIds, + TxData, } from "../../src"; import { getSiblings } from "../common"; +import { chainOverrides } from "../constants/overrides"; import { + batcherSupportedChainSlugs, + disabledDFFeeChains, explorers, + getDefaultFinalityBucket, + getFinality, + getReSyncInterval, icons, - batcherSupportedChainSlugs, rpcs, version, - getFinality, - getReSyncInterval, - getDefaultFinalityBucket, - disabledDFFeeChains, } from "./constants"; import { feesUpdaterSupportedChainSlugs } from "./constants/feesUpdaterChainSlugs"; import { getChainTxData } from "./txdata-builder/generate-calldata"; @@ -101,6 +100,7 @@ const getChainData = async ( finalityInfo: getFinality(chainSlug), defaultFinalityBucket: getDefaultFinalityBucket(chainSlug), icon: icons[chainSlug], + overrides: chainOverrides[chainSlug], }; }; diff --git a/scripts/transmitter/propose.ts b/scripts/transmitter/propose.ts index 93d0ca15..528c71be 100644 --- a/scripts/transmitter/propose.ts +++ b/scripts/transmitter/propose.ts @@ -4,16 +4,16 @@ dotenvConfig(); import { arrayify } from "@ethersproject/bytes"; import { defaultAbiCoder, keccak256 } from "ethers/lib/utils"; import { Contract, Wallet, utils } from "ethers"; -import { version, getAddresses } from "../../src/index"; +import { version, getAddresses, ChainSlug } from "../../src/index"; import { getProviderFromChainSlug } from "../constants/networks"; -import { CORE_CONTRACTS, ChainSlug } from "@socket.tech/dl-core"; +import { CORE_CONTRACTS } from "@socket.tech/dl-core"; import { getInstance } from "../deploy/utils"; import { mode, overrides } from "../deploy/config/config"; export const VERSION_HASH = utils.id(version[mode]); -const chainSlug: ChainSlug = ChainSlug.OPTIMISM_GOERLI; +const chainSlug: ChainSlug = ChainSlug.OPTIMISM_SEPOLIA; const packetId = "0x000138815c83e326c0b4380127dccf01c3b69ff4dd5c16ae0000000000000001"; const root = @@ -54,7 +54,7 @@ export const main = async () => { ).connect(signer); const tx = await socket.propose(packetId, root, signature, { - ...overrides(chainSlug), + ...(await overrides(chainSlug)), }); console.log(`Proposing at tx hash: ${tx.hash}`); diff --git a/src/index.ts b/src/index.ts index c1b28926..83cab07c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import { DeploymentMode } from "./socket-types"; export { getFinality } from "../scripts/rpcConfig/constants/finality"; export { getDefaultFinalityBucket } from "../scripts/rpcConfig/constants/defaultFinalityBucket"; export { getReSyncInterval } from "../scripts/rpcConfig/constants/reSyncInterval"; +export { getOverrides } from "../scripts/constants/overrides"; export * from "./socket-types"; export * from "./enums"; diff --git a/src/socket-types.ts b/src/socket-types.ts index fe23d3de..c63eab83 100644 --- a/src/socket-types.ts +++ b/src/socket-types.ts @@ -258,6 +258,11 @@ export interface S3ChainConfig { icon?: string; finalityInfo?: ChainFinalityInfo; defaultFinalityBucket?: FinalityBucket; + overrides?: { + type?: number; + gasPrice?: number; + gasLimit?: number; + }; } export type S3Config = {