diff --git a/constants/addresses.json b/constants/addresses.json index e7b8bef..a27a927 100644 --- a/constants/addresses.json +++ b/constants/addresses.json @@ -120,9 +120,9 @@ "deployments": { "fiberRouter": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", "fundManager": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318", - "multiSwapForge": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", - "forgeFundManager": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0", - "cctpFundManager": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", + "multiSwapForge": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", + "forgeFundManager": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", + "cctpFundManager": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0", "forgeCCTPFundManager": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82" }, "cctp": { diff --git a/contracts/multiswap-contracts/FiberRouter.sol b/contracts/multiswap-contracts/FiberRouter.sol index 56f6b56..7f151b7 100644 --- a/contracts/multiswap-contracts/FiberRouter.sol +++ b/contracts/multiswap-contracts/FiberRouter.sol @@ -653,4 +653,10 @@ contract FiberRouter is Ownable, TokenReceivable, FeeDistributor { } } } -} \ No newline at end of file + + function isCctp(uint256 cdPtr) public pure returns (bool cctp) { + assembly { + cctp := shr(252, calldataload(cdPtr)) + } + } +} diff --git a/deploy/multiswap.ts b/deploy/multiswap.ts index 3aeb154..904379f 100644 --- a/deploy/multiswap.ts +++ b/deploy/multiswap.ts @@ -28,7 +28,7 @@ export const multiswap = async function ( // Deploy contracts let contractInstances = {} - const contractNames = ["FiberRouter", "MultiSwapForge"] + const contractNames = ["FiberRouter", "FundManager", "MultiSwapForge", "ForgeFundManager", "CCTPFundManager", "ForgeCCTPFundManager"] for (const contractName of contractNames) { console.log(`Deploying ${contractName}`) @@ -39,20 +39,20 @@ export const multiswap = async function ( } const fiberRouter = contractInstances['FiberRouter'] - // const fundManager = contractInstances['FundManager'] + const fundManager = contractInstances['FundManager'] const multiswapForge = contractInstances['MultiSwapForge'] - // const forgeManager = contractInstances['ForgeFundManager'] - // const cctpFundManager = contractInstances['CCTPFundManager'] - // const forgeCctpFundManager = contractInstances['ForgeCCTPFundManager'] + const forgeManager = contractInstances['ForgeFundManager'] + const cctpFundManager = contractInstances['CCTPFundManager'] + const forgeCctpFundManager = contractInstances['ForgeCCTPFundManager'] addresses.networks[thisNetwork].deployments.fiberRouter = fiberRouter.target - // addresses.networks[thisNetwork].deployments.fundManager = fundManager.target + addresses.networks[thisNetwork].deployments.fundManager = fundManager.target addresses.networks[thisNetwork].deployments.multiSwapForge = multiswapForge.target - // addresses.networks[thisNetwork].deployments.forgeFundManager = forgeManager.target - // if (isCctp) { - // addresses.networks[thisNetwork].deployments.cctpFundManager = cctpFundManager.target - // addresses.networks[thisNetwork].deployments.forgeCCTPFundManager = forgeCctpFundManager.target - // } + addresses.networks[thisNetwork].deployments.forgeFundManager = forgeManager.target + if (isCctp) { + addresses.networks[thisNetwork].deployments.cctpFundManager = cctpFundManager.target + addresses.networks[thisNetwork].deployments.forgeCCTPFundManager = forgeCctpFundManager.target + } const fiberRouterAddress = addresses.networks[thisNetwork].deployments.fiberRouter const fundManagerAddress = addresses.networks[thisNetwork].deployments.fundManager @@ -62,11 +62,11 @@ export const multiswap = async function ( const forgeCctpFundManagerAddress = addresses.networks[thisNetwork].deployments.forgeCCTPFundManager // const fiberRouter = new hre.ethers.Contract(fiberRouterAddress, fiberRouterArtifact.abi, signer[0]) - const fundManager = new hre.ethers.Contract(fundManagerAddress, fundManagerArtifact.abi, signer[0]) + // const fundManager = new hre.ethers.Contract(fundManagerAddress, fundManagerArtifact.abi, signer[0]) // const multiswapForge = new hre.ethers.Contract(multiswapForgeAddress, multiswapForgeArtifact.abi, signer[0]) - const forgeManager = new hre.ethers.Contract(forgeFundManagerAddress, forgeFundManagerArtifact.abi, signer[0]) - const cctpFundManager = new hre.ethers.Contract(cctpFundManagerAddress, cctpFundManagerArtifact.abi, signer[0]) - const forgeCctpFundManager = new hre.ethers.Contract(forgeCctpFundManagerAddress, forgeCctpFundManagerArtifact.abi, signer[0]) + // const forgeManager = new hre.ethers.Contract(forgeFundManagerAddress, forgeFundManagerArtifact.abi, signer[0]) + // const cctpFundManager = new hre.ethers.Contract(cctpFundManagerAddress, cctpFundManagerArtifact.abi, signer[0]) + // const forgeCctpFundManager = new hre.ethers.Contract(forgeCctpFundManagerAddress, forgeCctpFundManagerArtifact.abi, signer[0])