diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 5a347533..10342c50 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1 with: version: nightly diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index f881dbd5..b63bb53e 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -1,11 +1,11 @@ { "5": { - "SignatureVerifier": "0xB5E683CFe38Ea721CadE0eD9783E44C2D920B337", - "Hasher": "0x3c9dA57D7879182Cc51BA0c22d2382B55E56774c", - "CapacitorFactory": "0xd6901Aaf406792280C9Ff28E8482BF84254E54a4", - "Socket": "0xe37D028a77B4e6fCb05FC75EBa845752cD62A0AA", - "ExecutionManager": "0x9E8196C8BF4789C21Af9E2BFc54177FFfE28e005", - "TransmitManager": "0x3e66DC90D1f2914d58beab17a19D910d85112cA5", + "SignatureVerifier": "0x9c86a27B5943676c5c64709266e3b61e4245525b", + "Hasher": "0x79Dc67853cab8FB77f14A76116cAa7B4478B53Da", + "CapacitorFactory": "0x0e0CD33ed677a14CB134C9048a59Fc3799312404", + "Socket": "0xF0FB8faAf17EE870Fc9296E369F64F92E8eAc6D8", + "ExecutionManager": "0x718826B533DF29C30f2d3f30E585e405eeF22784", + "TransmitManager": "0x9834194474E979fB47eF6814Eb4C0BCF0Aea0c3A", "integrations": { "420": { "NATIVE_BRIDGE": { diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index ed38b6da..e69de29b 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,252 +0,0 @@ -{ - "5": [ - [ - "0x1eaf2ee60D952ECc5D1397F8D94a950DA632B29c", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ], - [ - "0xD2F16F574c7B4022192C53af9570b4b3C9B42f73", - "FastSwitchboard", - "contracts/switchboard/default-switchboards/FastSwitchboard.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - "0xe37D028a77B4e6fCb05FC75EBa845752cD62A0AA", - 5, - 7200, - "0xB5E683CFe38Ea721CadE0eD9783E44C2D920B337" - ] - ] - ], - "420": [ - [ - "0xc07216D0e55044572d6E3C08d8a8a86BD3D909e3", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ] - ], - "901": [ - [ - "0x6F1912DC9631E8aFC89e7D95Afd7e467845FF6F2", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ], - [ - "0x501fCBa3e6F92b2D1d89038FeD56EdacaaF5f7c2", - "FastSwitchboard", - "contracts/switchboard/default-switchboards/FastSwitchboard.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - "0xa5b593aE839b3fe47983Fc28da602a6dEEfBBc9D", - 901, - 7200, - "0x47140353947Bc127c9cf36fabd61112C8Fb8db2A" - ] - ] - ], - "80001": [ - [ - "0xB08C44cF4b4cD0Cb343e73f3A7f0be20cCF0517D", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ] - ], - "421613": [ - [ - "0xcf1A2FD5428f6f48f9170fcb81E41B13ab67AF9d", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ] - ], - "11155112": [ - [ - "0xd42DbD058bE3F4230E8b5d51e7548fb4E082acC5", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ] - ], - "1399904803": [ - [ - "0xE593288228d17a6D057D9a61a35F32166A6B4191", - "Counter", - "contracts/examples/Counter.sol", - ["0x6F1912DC9631E8aFC89e7D95Afd7e467845FF6F2"] - ], - [ - "0xBc3Ff3923b36F1590C16363b09c4759654d7B6d4", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ], - [ - "0xd84fabe06806270Fb2dDFC2255102206e3B36865", - "OptimisticSwitchboard", - "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - "0x6F1912DC9631E8aFC89e7D95Afd7e467845FF6F2", - 1399904803, - 7200, - "0xF90462427f6fB8948483D06d90a0324E9A6eFF2E" - ] - ], - [ - "0x05501406bCC171b543db0A2C547b7cB68D9D69E3", - "FastSwitchboard", - "contracts/switchboard/default-switchboards/FastSwitchboard.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - "0x6F1912DC9631E8aFC89e7D95Afd7e467845FF6F2", - 1399904803, - 7200, - "0xF90462427f6fB8948483D06d90a0324E9A6eFF2E" - ] - ], - [ - "0xB42BBBd8f725186BBC74AFF6A5e0f15F1c786db2", - "TransmitManager", - "contracts/TransmitManager.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - 1399904803, - "0x6F1912DC9631E8aFC89e7D95Afd7e467845FF6F2", - "0xF90462427f6fB8948483D06d90a0324E9A6eFF2E" - ] - ], - [ - "0x818C8977Eed2Dd55A591672e18c9446090057881", - "ExecutionManager", - "contracts/ExecutionManager.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - 1399904803, - "0x6F1912DC9631E8aFC89e7D95Afd7e467845FF6F2", - "0xF90462427f6fB8948483D06d90a0324E9A6eFF2E" - ] - ], - [ - "0x6F1912DC9631E8aFC89e7D95Afd7e467845FF6F2", - "Socket", - "contracts/socket/Socket.sol", - [ - 1399904803, - "0x6E6BC965FA8897b7531322461A65f016E8Be1c30", - "0x501fCBa3e6F92b2D1d89038FeD56EdacaaF5f7c2", - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - "IMLI" - ] - ], - [ - "0x501fCBa3e6F92b2D1d89038FeD56EdacaaF5f7c2", - "CapacitorFactory", - "contracts/CapacitorFactory.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", 10] - ], - [ - "0x6E6BC965FA8897b7531322461A65f016E8Be1c30", - "Hasher", - "contracts/utils/Hasher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ], - [ - "0xF90462427f6fB8948483D06d90a0324E9A6eFF2E", - "SignatureVerifier", - "contracts/utils/SignatureVerifier.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ], - [ - "0x30DaDbc1D9EdF62f5E7491439c78bD6502c6c22B", - "Counter", - "contracts/examples/Counter.sol", - ["0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91"] - ], - [ - "0x918ECe20236B9d8C2AA1742540246D6F9a9eB081", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ], - [ - "0xA53185E856916228505372F1E3333BbbB4AC2063", - "OptimisticSwitchboard", - "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - "0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91", - 1399904803, - 7200, - "0x85778A90ec60249f10d7AEe06484ffC290d5Efd8" - ] - ], - [ - "0xaE51c633fb58df92FCcBb0694EA22E060d29F5F7", - "FastSwitchboard", - "contracts/switchboard/default-switchboards/FastSwitchboard.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - "0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91", - 1399904803, - 7200, - "0x85778A90ec60249f10d7AEe06484ffC290d5Efd8" - ] - ], - [ - "0xaDDaC77B80C990A87906C4273902be5EC7f25B42", - "TransmitManager", - "contracts/TransmitManager.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - 1399904803, - "0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91", - "0x85778A90ec60249f10d7AEe06484ffC290d5Efd8" - ] - ], - [ - "0x0f8F4E665221528e6a444458dd098216E9ec7807", - "ExecutionManager", - "contracts/ExecutionManager.sol", - [ - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - 1399904803, - "0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91", - "0x85778A90ec60249f10d7AEe06484ffC290d5Efd8" - ] - ], - [ - "0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91", - "Socket", - "contracts/socket/Socket.sol", - [ - 1399904803, - "0xB9EDe9aaEaA40e35033ABBC872D141950d08cc4d", - "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd", - "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", - "IMLI" - ] - ], - [ - "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd", - "CapacitorFactory", - "contracts/CapacitorFactory.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa", 10] - ], - [ - "0xB9EDe9aaEaA40e35033ABBC872D141950d08cc4d", - "Hasher", - "contracts/utils/Hasher.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ], - [ - "0x85778A90ec60249f10d7AEe06484ffC290d5Efd8", - "SignatureVerifier", - "contracts/utils/SignatureVerifier.sol", - ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] - ] - ] -} diff --git a/package.json b/package.json index 6713ab77..819511b5 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@arbitrum/sdk": "^3.0.0", - "@eth-optimism/sdk": "^1.6.11", + "@eth-optimism/sdk": "^3.1.4", "@ethersproject/bytes": "^5.7.0", "@fxportal/maticjs-fxportal": "^1.1.1", "@maticnetwork/maticjs": "^3.5.0", diff --git a/scripts/deploy/connect.ts b/scripts/deploy/connect.ts index ffdb0ca5..9b137d15 100644 --- a/scripts/deploy/connect.ts +++ b/scripts/deploy/connect.ts @@ -63,12 +63,18 @@ export const main = async () => { for (let index = 0; index < siblingSlugs.length; index++) { const sibling = siblingSlugs[index]; const siblingCounter = addresses?.[sibling]?.["Counter"]; - const switchboard = getSwitchboardAddress( - chain, - sibling, - siblingIntegrationtype[index], - mode - ); + let switchboard; + try { + switchboard = getSwitchboardAddress( + chain, + sibling, + siblingIntegrationtype[index], + mode + ); + } catch (error) { + console.log(error, " continuing"); + } + if (!switchboard) continue; const configs = await socket.getPlugConfig(counter.address, sibling); if ( diff --git a/scripts/deploy/scripts/allPathTest.ts b/scripts/deploy/scripts/allPathTest.ts index e40ab07e..0b766516 100644 --- a/scripts/deploy/scripts/allPathTest.ts +++ b/scripts/deploy/scripts/allPathTest.ts @@ -229,3 +229,5 @@ main() console.error(error); process.exit(1); }); + +// npx ts-node scripts/deploy/scripts/allPathTest.ts diff --git a/scripts/deploy/scripts/capacitorCount.ts b/scripts/deploy/scripts/capacitorCount.ts index e5ecda01..4757deea 100644 --- a/scripts/deploy/scripts/capacitorCount.ts +++ b/scripts/deploy/scripts/capacitorCount.ts @@ -1,26 +1,16 @@ -import { ContractFactory } from "ethers"; -import { network, ethers, run } from "hardhat"; - -import { DeployParams, getOrDeploy, storeAddresses } from "../utils"; +import { utils } from "ethers"; +import { ethers } from "hardhat"; import { - CORE_CONTRACTS, - ChainSocketAddresses, - DeploymentMode, - ChainSlugToKey, version, DeploymentAddresses, getAllAddresses, ChainSlug, IntegrationTypes, } from "../../../src"; -import deploySwitchboards from "./deploySwitchboard"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { socketOwner, executionManagerVersion, mode, chains } from "../config"; -import { - getProviderFromChainSlug, - maxAllowedPacketLength, -} from "../../constants"; +import { mode, chains } from "../config"; +import { getProviderFromChainSlug } from "../../constants"; +import { encodePacketId } from "../utils/packetId"; const main = async ( srcChains: ChainSlug[], @@ -28,6 +18,8 @@ const main = async ( integrationTypes: IntegrationTypes[] ) => { try { + let data: any[] = []; + let addresses: DeploymentAddresses; try { addresses = getAllAddresses(mode); @@ -63,24 +55,40 @@ const main = async ( "SingleCapacitor" ); let instance = Contract.attach(capacitor).connect(provider); - let result = await instance.getNextPacketToBeSealed(); - console.log( + let nextSealedPacket = await instance.getNextPacketToBeSealed(); + let lastFilledPacket = await instance.getLastFilledPacket(); + + let digest = utils.keccak256( + utils.defaultAbiCoder.encode( + ["bytes32", "uint32", "bytes32", "bytes32"], + [ + utils.id(version[mode]), + siblingChain, + encodePacketId( + chainSlug, + capacitor, + nextSealedPacket[1].toNumber() + ), + nextSealedPacket[0].toString(), + ] + ) + ); + data.push({ chainSlug, - " ", - Number(siblingChain), - " ", + siblingChain, integrationType, - " ", - result[1].toNumber(), - " ", - result[0].toString() - ); + lastFilledPacket: lastFilledPacket.toNumber(), + nextSealedPacketCount: nextSealedPacket[1].toNumber(), + root: nextSealedPacket[0].toString(), + digest: digest, + }); }) ); }) ); }) ); + console.table(data); } catch (error) { console.log(error); } diff --git a/scripts/deploy/scripts/checkBalance.ts b/scripts/deploy/scripts/checkBalance.ts index bb26589d..0a48a4d7 100644 --- a/scripts/deploy/scripts/checkBalance.ts +++ b/scripts/deploy/scripts/checkBalance.ts @@ -6,7 +6,7 @@ import { ChainSlugToKey } from "../../../src"; import { utils } from "ethers"; import { chains, mode } from "../config"; -import { getProviderFromChainName } from "../../constants/networks"; +import { getProviderFromChainSlug } from "../../constants/networks"; // check balance of owner address on all chains export const checkBalance = async () => { @@ -14,9 +14,7 @@ export const checkBalance = async () => { // parallelize chains await Promise.all( chains.map(async (chainSlug) => { - const provider = await getProviderFromChainName( - ChainSlugToKey[chainSlug] - ); + const provider = await getProviderFromChainSlug(chainSlug); // let ownerAddress = process.env.SOCKET_OWNER_ADDRESS; let ownerAddress = "0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"; if (!ownerAddress) throw Error("owner address not present"); diff --git a/scripts/deploy/scripts/fastSwitchboards.ts b/scripts/deploy/scripts/fastSwitchboards.ts index dfd8db76..804ff57d 100644 --- a/scripts/deploy/scripts/fastSwitchboards.ts +++ b/scripts/deploy/scripts/fastSwitchboards.ts @@ -1,4 +1,4 @@ -import { ContractFactory } from "ethers"; +import { ContractFactory, utils } from "ethers"; import { network, ethers, run } from "hardhat"; import { DeployParams, getOrDeploy, storeAddresses } from "../utils"; @@ -31,6 +31,8 @@ const main = async (srcChains: ChainSlug[], dstChains: ChainSlug[]) => { addresses = {} as DeploymentAddresses; } let srcChainSlugs = srcChains ?? chains; + let dstChainSlugs = dstChains ?? chains; + let data: any[] = []; await Promise.all( srcChainSlugs.map(async (chainSlug) => { @@ -38,7 +40,7 @@ const main = async (srcChains: ChainSlug[], dstChains: ChainSlug[]) => { addresses[chainSlug as ChainSlug]?.FastSwitchboard2; if (!fastSwitchboardAddress) return; - let siblingChains = dstChains ?? chains.filter((s) => chainSlug !== s); + let siblingChains = dstChainSlugs.filter((s) => chainSlug !== s); await Promise.all( siblingChains.map(async (siblingChain) => { @@ -49,11 +51,28 @@ const main = async (srcChains: ChainSlug[], dstChains: ChainSlug[]) => { ); // console.log(instance);÷\ let result = await instance["totalWatchers(uint32)"](siblingChain); + + let digest = utils.keccak256( + utils.defaultAbiCoder.encode( + ["address", "uint32", "bytes32", "uint256"], + // ["address", "uint32", "bytes32", "uint256", "bytes32"], + [ + fastSwitchboardAddress?.toLowerCase(), + chainSlug, + "0x00aa36a841667f3df292b3ed613d66b39dd2d8327d2ef5a80000000000000000", + 0, + // "0x80b582422ec90d907e218c10e879241ddf21d3274e03÷18de902f4abece0ac6c5" + ] + ) + ); + // console.log(result); data.push({ chainSlug, siblingChain, totalWatchers: result.toNumber(), + digest, + fastSwitchboardAddress, }); }) ); diff --git a/scripts/deploy/scripts/outbound.ts b/scripts/deploy/scripts/outbound.ts index 36d05ae9..b81e3e32 100644 --- a/scripts/deploy/scripts/outbound.ts +++ b/scripts/deploy/scripts/outbound.ts @@ -16,8 +16,8 @@ export const main = async () => { const chainSlug = await getChainSlug(); const amount = 100; const msgGasLimit = "19000000"; - const gasLimit = 200485; - const fees = "20000000000000000"; + const gasLimit = "200485"; + const fees = "2000000000000"; const config: any = JSON.parse( fs.readFileSync(deployedAddressPath(mode), "utf-8") @@ -30,21 +30,22 @@ export const main = async () => { "Counter", config[chainSlug]["Counter"] ); - await counter + const tx = await counter .connect(signer) .remoteAddOperation( remoteChainSlug, amount, msgGasLimit, constants.HashZero, + constants.HashZero, { - gasLimit, value: fees, } ); + await tx.wait(); console.log( - `Sent remoteAddOperation with ${amount} amount and ${msgGasLimit} gas limit to counter at ${remoteChainSlug}` + `Sent remoteAddOperation with ${amount} amount and ${msgGasLimit} gas limit to counter at ${remoteChainSlug}, tx hash: ${tx.hash.toLowerCase()}` ); } catch (error) { console.log("Error while sending transaction", error); diff --git a/scripts/deploy/utils/packetId.ts b/scripts/deploy/utils/packetId.ts index 2e5cbb05..ea74158b 100644 --- a/scripts/deploy/utils/packetId.ts +++ b/scripts/deploy/utils/packetId.ts @@ -44,3 +44,18 @@ export const packPacketId = ( return BigNumber.from(id).toString(); }; + +export function encodePacketId( + chainSlug: number, + capacitorAddress: string, + packetCount: number +) { + const encodedValue = + (BigInt(chainSlug) << BigInt(224)) | + (BigInt(capacitorAddress) << BigInt(64)) | + BigInt(packetCount); + + // Ensure the result is a 32-byte hex string (bytes32 in Solidity) + const resultHex = encodedValue.toString(16).padStart(64, "0"); + return "0x" + resultHex; +} diff --git a/scripts/native-bridge-helpers/optimism/l2tol1Relay.ts b/scripts/native-bridge-helpers/optimism/l2tol1Relay.ts index 20a1eb27..39069d08 100644 --- a/scripts/native-bridge-helpers/optimism/l2tol1Relay.ts +++ b/scripts/native-bridge-helpers/optimism/l2tol1Relay.ts @@ -1,12 +1,13 @@ import { providers, Wallet } from "ethers"; import { CrossChainMessenger, MessageStatus } from "@eth-optimism/sdk"; import { getJsonRpcUrl } from "../../constants"; +import { ChainKey } from "../../../src"; // get providers for source and destination -const localChain = "optimism-goerli"; -const remoteChain = "goerli"; +const localChain = ChainKey.GOERLI; +const remoteChain = ChainKey.OPTIMISM_GOERLI; -const walletPrivateKey = process.env.SOCKET_SIGNER_KEY; +const walletPrivateKey = process.env.SOCKET_SIGNER_KEY!; const l1Provider = new providers.JsonRpcProvider(getJsonRpcUrl(localChain)); const l1Wallet = new Wallet(walletPrivateKey, l1Provider); @@ -24,11 +25,18 @@ export const main = async () => { const status = await crossChainMessenger.getMessageStatus(sealTxHash); - if (MessageStatus.READY_FOR_RELAY === status) { + if (MessageStatus.READY_TO_PROVE === status) { + const tx = await crossChainMessenger.proveMessage(sealTxHash); + await tx.wait(); + console.log("Message proved", tx.hash); + } else if (MessageStatus.READY_FOR_RELAY === status) { const tx = await crossChainMessenger.finalizeMessage(sealTxHash); await tx.wait(); + console.log("Message finalized", tx.hash); + } else if (MessageStatus.RELAYED === status) { + console.log("Message relayed"); } else { - console.log("Message not confirmed yet!"); + console.log(`Message is in ${status} status`); } }; diff --git a/src/types.ts b/src/types.ts index 0d1cbc7d..464ff3d9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -68,6 +68,27 @@ export enum ChainSlug { XAI_TESTNET = 1399904803, } +export const ChainSlugToId = { + [ChainSlug.AVALANCHE]: ChainId.AVALANCHE, + [ChainSlug.BSC]: ChainId.BSC, + [ChainSlug.GOERLI]: ChainId.GOERLI, + [ChainSlug.SEPOLIA]: ChainId.SEPOLIA, + [ChainSlug.HARDHAT]: ChainId.HARDHAT, + [ChainSlug.MAINNET]: ChainId.MAINNET, + [ChainSlug.BSC_TESTNET]: ChainId.BSC_TESTNET, + [ChainSlug.ARBITRUM]: ChainId.ARBITRUM, + [ChainSlug.ARBITRUM_GOERLI]: ChainId.ARBITRUM_GOERLI, + [ChainSlug.OPTIMISM]: ChainId.OPTIMISM, + [ChainSlug.OPTIMISM_GOERLI]: ChainId.OPTIMISM_GOERLI, + [ChainSlug.POLYGON_MAINNET]: ChainId.POLYGON_MAINNET, + [ChainSlug.POLYGON_MUMBAI]: ChainId.POLYGON_MUMBAI, + [ChainSlug.AEVO_TESTNET]: ChainId.AEVO_TESTNET, + [ChainSlug.LYRA_TESTNET]: ChainId.LYRA_TESTNET, + [ChainSlug.LYRA]: ChainId.LYRA, + [ChainSlug.AEVO]: ChainId.AEVO, + [ChainSlug.XAI_TESTNET]: ChainId.XAI_TESTNET, +}; + export const hardhatChainNameToSlug = { [HardhatChainName.ARBITRUM]: ChainSlug.ARBITRUM, [HardhatChainName.ARBITRUM_GOERLI]: ChainSlug.ARBITRUM_GOERLI, diff --git a/test/Setup.t.sol b/test/Setup.t.sol index 90241d4f..6f07601f 100644 --- a/test/Setup.t.sol +++ b/test/Setup.t.sol @@ -22,7 +22,7 @@ import "../contracts/capacitors/HashChainCapacitor.sol"; import "../contracts/decapacitors/HashChainDecapacitor.sol"; contract Setup is Test { - uint256 internal c = 1; + uint256 internal c = 1000; uint32 internal aChainSlug = uint32(uint256(0x2013AA262)); uint32 internal bChainSlug = uint32(uint256(0x2013AA263)); uint32 internal cChainSlug = uint32(uint256(0x2013AA264)); diff --git a/test/socket/SocketSrc.t.sol b/test/socket/SocketSrc.t.sol index 68aaa9ab..156e69ff 100644 --- a/test/socket/SocketSrc.t.sol +++ b/test/socket/SocketSrc.t.sol @@ -70,8 +70,8 @@ contract SocketSrcTest is Setup { address switchboard = address(uint160(c++)); address siblingSwitchboard_ = address(uint160(c++)); - address expectedCapacitor = 0xC03b41d3947f3974978680061B15a736DF5346Cf; - address expectedDecapacitor = 0xf787702c0F39b8A70d4F8A6C99C3dB0a87275087; + address expectedCapacitor = 0x069B4B6deECf1352726B90c47C88d024595c033D; + address expectedDecapacitor = 0xB166304f5613cb56C8E8Ce7316dd51067388302D; hoax(switchboard); vm.expectEmit(false, false, false, true); diff --git a/test/utils/AccessControl.t.sol b/test/utils/AccessControl.t.sol index 139202ea..8b77f5b2 100644 --- a/test/utils/AccessControl.t.sol +++ b/test/utils/AccessControl.t.sol @@ -5,7 +5,7 @@ import "forge-std/Test.sol"; import "../../contracts/mocks/MockAccessControl.sol"; contract AccessControlTest is Test { - uint256 internal c = 1; + uint256 internal c = 1000; address immutable _owner = address(uint160(c++)); address immutable _giraffe_0 = address(uint160(c++)); address immutable _giraffe_1 = address(uint160(c++)); diff --git a/test/utils/Ownable.t.sol b/test/utils/Ownable.t.sol index e750c472..b66885de 100644 --- a/test/utils/Ownable.t.sol +++ b/test/utils/Ownable.t.sol @@ -5,7 +5,7 @@ import "forge-std/Test.sol"; import "../../contracts/mocks/MockOwnable.sol"; contract OwnableTest is Test { - uint256 internal c = 1; + uint256 internal c = 1000; address immutable _bob = address(uint160(c++)); address immutable _owner = address(uint160(c++)); address immutable _newOwner = address(uint160(c++)); diff --git a/yarn.lock b/yarn.lock index c423f3e8..bb111031 100644 --- a/yarn.lock +++ b/yarn.lock @@ -67,30 +67,24 @@ resolved "https://registry.npmjs.org/@ensdomains/resolver/-/resolver-0.2.4.tgz" integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== -"@eth-optimism/contracts-bedrock@0.9.1": - version "0.9.1" - resolved "https://registry.npmjs.org/@eth-optimism/contracts-bedrock/-/contracts-bedrock-0.9.1.tgz" - integrity sha512-r+AUgPRBnZ0fGNskrjKdeenWQswx7NowAyLZ719+tmy3bQXBcV9vN/ArdNn8qotXBq9fHXOeJVzDzzM17YHkZw== - dependencies: - "@eth-optimism/core-utils" "^0.11.0" - "@openzeppelin/contracts" "4.7.3" - "@openzeppelin/contracts-upgradeable" "4.7.3" - ethers "^5.7.0" - hardhat "^2.9.6" - -"@eth-optimism/contracts@0.5.38": - version "0.5.38" - resolved "https://registry.npmjs.org/@eth-optimism/contracts/-/contracts-0.5.38.tgz" - integrity sha512-VvPvTD6AKFIPZVwGRK1eDuhRS+WyUGemIiu7h9txpKitkXKpTqb4DscR6cul5Dl+JhonX36ZvnJmDIfF+KBY5A== - dependencies: - "@eth-optimism/core-utils" "0.11.0" +"@eth-optimism/contracts-bedrock@0.16.2": + version "0.16.2" + resolved "https://registry.yarnpkg.com/@eth-optimism/contracts-bedrock/-/contracts-bedrock-0.16.2.tgz#065ad561c3c8b942e4e0dd3d0ea6ed7e00a0f8f0" + integrity sha512-a2+f7soDbrd6jV74U02EpyMwQt2iZeDZ4c2ZwgkObcxXUZLZQ2ELt/VRFBf8TIL3wYcBOGpUa1aXAE2oHQ7oRA== + +"@eth-optimism/contracts@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@eth-optimism/contracts/-/contracts-0.6.0.tgz#15ae76222a9b4d958a550cafb1960923af613a31" + integrity sha512-vQ04wfG9kMf1Fwy3FEMqH2QZbgS0gldKhcBeBUPfO8zu68L61VI97UDXmsMQXzTsEAxK8HnokW3/gosl4/NW3w== + dependencies: + "@eth-optimism/core-utils" "0.12.0" "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" -"@eth-optimism/core-utils@0.11.0", "@eth-optimism/core-utils@^0.11.0": - version "0.11.0" - resolved "https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.11.0.tgz" - integrity sha512-/oTyC1sqZ/R97pRk+7cQJpZ6qwmJvqcym9coy9fZaqmIuFaZkjXQKz04lWUPL0zzh9zTN+2nMSB+kZReccmong== +"@eth-optimism/core-utils@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@eth-optimism/core-utils/-/core-utils-0.12.0.tgz#6337e4599a34de23f8eceb20378de2a2de82b0ea" + integrity sha512-qW+7LZYCz7i8dRa7SRlUKIo1VBU8lvN0HeXCxJR+z+xtMzMQpPds20XJNCMclszxYQHkXY00fOT6GvFw9ZL6nw== dependencies: "@ethersproject/abi" "^5.7.0" "@ethersproject/abstract-provider" "^5.7.0" @@ -109,16 +103,36 @@ bufio "^1.0.7" chai "^4.3.4" -"@eth-optimism/sdk@^1.6.11": - version "1.6.11" - resolved "https://registry.npmjs.org/@eth-optimism/sdk/-/sdk-1.6.11.tgz" - integrity sha512-vbhqixN9lPaMFnw4YvpskifWq7ooKKMQ/Gbn4uDnAEpkwrqlTsVOHsVDQY7HOFzHcQ/pWRzyy16seE2A+5x4Kg== +"@eth-optimism/core-utils@0.13.1": + version "0.13.1" + resolved "https://registry.yarnpkg.com/@eth-optimism/core-utils/-/core-utils-0.13.1.tgz#f15ec207a629c9bbf1a10425c1b4a4c0be544755" + integrity sha512-1FvzbUmCEy9zSKPG1QWg2VfA2Cy90xBA9Wkp11lXXrz91zUPCNCNSRTujXWYIC86ketNsZp7p4njSf6lTycHCw== dependencies: - "@eth-optimism/contracts" "0.5.38" - "@eth-optimism/contracts-bedrock" "0.9.1" - "@eth-optimism/core-utils" "0.11.0" + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/contracts" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/web" "^5.7.1" + chai "^4.3.9" + ethers "^5.7.2" + node-fetch "^2.6.7" + +"@eth-optimism/sdk@^3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@eth-optimism/sdk/-/sdk-3.1.4.tgz#96f5573ace11a727e3e1beaa8c526527711a58ed" + integrity sha512-gqbw/7KAwXSiFF7KN57oe3iz0kcOuSUTfnkAf0aZImmSbegPY5AWszxYvnQCIXcWRY0kaDf3LpXrHKur4TdgGA== + dependencies: + "@eth-optimism/contracts" "0.6.0" + "@eth-optimism/contracts-bedrock" "0.16.2" + "@eth-optimism/core-utils" "0.13.1" lodash "^4.17.21" - merkletreejs "^0.2.27" + merkletreejs "^0.3.10" rlp "^2.2.7" "@ethereum-waffle/chai@^3.4.4": @@ -535,7 +549,7 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/wordlists" "^5.7.0" -"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": +"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0", "@ethersproject/web@^5.7.1": version "5.7.1" resolved "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz" integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== @@ -850,16 +864,6 @@ "@types/sinon-chai" "^3.2.3" "@types/web3" "1.0.19" -"@openzeppelin/contracts-upgradeable@4.7.3": - version "4.7.3" - resolved "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz" - integrity sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A== - -"@openzeppelin/contracts@4.7.3": - version "4.7.3" - resolved "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz" - integrity sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw== - "@resolver-engine/core@^0.3.3": version "0.3.3" resolved "https://registry.npmjs.org/@resolver-engine/core/-/core-0.3.3.tgz" @@ -2637,6 +2641,19 @@ chai@^4.3.4, chai@^4.3.6: pathval "^1.1.1" type-detect "^4.0.5" +chai@^4.3.9: + version "4.3.10" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.10.tgz#d784cec635e3b7e2ffb66446a63b4e33bd390384" + integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" + pathval "^1.1.1" + type-detect "^4.0.8" + chalk@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" @@ -2670,6 +2687,13 @@ check-error@^1.0.2: resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== +check-error@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" + integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== + dependencies: + get-func-name "^2.0.2" + checkpoint-store@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz" @@ -3143,6 +3167,13 @@ deep-eql@^4.1.2: dependencies: type-detect "^4.0.0" +deep-eql@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + deep-equal@~1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz" @@ -3945,7 +3976,7 @@ ethereumjs-wallet@0.6.5: utf8 "^3.0.0" uuid "^3.3.2" -ethers@^5.0.1, ethers@^5.0.2, ethers@^5.1.0, ethers@^5.5.1, ethers@^5.5.2, ethers@^5.5.3, ethers@^5.6.6, ethers@^5.7.0: +ethers@^5.0.1, ethers@^5.0.2, ethers@^5.1.0, ethers@^5.5.1, ethers@^5.5.2, ethers@^5.5.3, ethers@^5.6.6, ethers@^5.7.2: version "5.7.2" resolved "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -4473,6 +4504,11 @@ get-func-name@^2.0.0: resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== +get-func-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== + get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz" @@ -4663,7 +4699,7 @@ hardhat-preprocessor@^0.1.4: dependencies: murmur-128 "^0.2.1" -hardhat@^2.9.5, hardhat@^2.9.6: +hardhat@^2.9.5: version "2.12.2" resolved "https://registry.npmjs.org/hardhat/-/hardhat-2.12.2.tgz" integrity sha512-f3ZhzXy1uyQv0UXnAQ8GCBOWjzv++WJNb7bnm10SsyC3dB7vlPpsMWBNhq7aoRxKrNhX9tCev81KFV3i5BTeMQ== @@ -5838,7 +5874,7 @@ loose-envify@^1.0.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" -loupe@^2.3.1: +loupe@^2.3.1, loupe@^2.3.6: version "2.3.6" resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz" integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== @@ -6034,10 +6070,10 @@ merkle-patricia-tree@^4.2.4: readable-stream "^3.6.0" semaphore-async-await "^1.5.1" -merkletreejs@^0.2.27: - version "0.2.32" - resolved "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.32.tgz" - integrity sha512-TostQBiwYRIwSE5++jGmacu3ODcKAgqb0Y/pnIohXS7sWxh1gCkSptbmF1a43faehRDpcHf7J/kv0Ml2D/zblQ== +merkletreejs@^0.3.10: + version "0.3.10" + resolved "https://registry.yarnpkg.com/merkletreejs/-/merkletreejs-0.3.10.tgz#b9abdfc5e3aadaf9eb8b0a35c4b87aea33f5d4b7" + integrity sha512-lin42tKfRdkW+6iE5pjtQ9BnH+1Hk3sJ5Fn9hUUSjcXRcJbSISHgPCfYvMNEXiNqZPhz/TyRPEV30qgnujsQ7A== dependencies: bignumber.js "^9.0.1" buffer-reverse "^1.0.1" @@ -8176,7 +8212,7 @@ tweetnacl@^1.0.0, tweetnacl@^1.0.3: resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== -type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==