Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmaan-ferrum committed May 13, 2024
1 parent 9896461 commit 920a082
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 20 deletions.
8 changes: 4 additions & 4 deletions constants/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"weth": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"foundry": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"deployments": {
"fiberRouter": "0xDe322fB75fF5D8ef49C300f68B766cCa72153a40",
"fiberRouter": "0xaDE10E8522AeCadBBe02279c133Fc46E45f92194",
"fundManager": "0x5dBF50235fdD9D4D5669E6e0B3Bef3655dEAffe7",
"cctpFundManager": "0x82496D3bDE9168dfeF6bc8dF0439B51790ff42DF",
"multiSwapForge": "0xA4d146afEBccD770b69E5a57145c644EdE985584",
"multiSwapForge": "0x3CAf342BCe0f4c0451184973984DE479EcD16C69",
"forgeFundManager": "0xA2d585247Fa56F6C50E554dBAa732c6fdc31eE9b",
"forgeCCTPFundManager": "0xbefD116064500794fD56f582672e7710217B5A72"
},
Expand Down Expand Up @@ -55,10 +55,10 @@
"weth": "0x4200000000000000000000000000000000000006",
"foundry": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"deployments": {
"fiberRouter": "0x1fBA7287058a62a2f8E4aFC9750ec905eD515eEf",
"fiberRouter": "0x851930502D363D75C4a0C0c8366ADc43980aA048",
"fundManager": "0x1938b36110e4016c54647de123a07F4dB13026C7",
"cctpFundManager": "0x59C1CF95a57F63094637Af70008c55452fFD1b9f",
"multiSwapForge": "0x8397C083eE5fFB778EeC85d494b3704bc866cB33",
"multiSwapForge": "0x62d114BD13a177E80db8a380cB5E83886Fe33783",
"forgeFundManager": "0xC71C76633B21C6367C1364744aace19873407891",
"forgeCCTPFundManager": "0xF7F9b482F3cbF7E9D2cbBCA4a7599Ded76ce8056"
},
Expand Down
2 changes: 1 addition & 1 deletion contracts/multiswap-contracts/FiberRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ contract FiberRouter is Ownable, TokenReceivable, FeeDistributor {
if (cctpType) {
// Proceed with the CCTP swap logic
SafeERC20.safeTransfer(IERC20(token), cctpFundManager, amountOut);
depositNonce = CCTPFundManager(cctpFundManager).swapCCTP(amount, token, sd.targetNetwork);
depositNonce = CCTPFundManager(cctpFundManager).swapCCTP(amountOut, token, sd.targetNetwork);
} else {
// Proceed with the normal swap logic
SafeERC20.safeTransfer(IERC20(token), fundManager, amountOut);
Expand Down
1 change: 0 additions & 1 deletion deploy/addLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import fundManagerArtifact from "../artifacts/contracts/multiswap-contracts/Fund
import erc20abi from "./erc20Abi.json"



export const addLiquidity = async function (
) {
const thisNetwork = hre.network.name
Expand Down
38 changes: 27 additions & 11 deletions deploy/multiswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const multiswap = async function (

// Deploy contracts
let contractInstances = {}
const contractNames = ["FiberRouter", "FundManager", "CCTPFundManager", "MultiSwapForge", "ForgeFundManager", "ForgeCCTPFundManager"]
const contractNames = ["FiberRouter", "MultiSwapForge"]

for (const contractName of contractNames) {
console.log(`Deploying ${contractName}`)
Expand All @@ -39,20 +39,36 @@ 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
const multiswapForgeAddress = addresses.networks[thisNetwork].deployments.multiSwapForge
const forgeFundManagerAddress = addresses.networks[thisNetwork].deployments.forgeFundManager
const cctpFundManagerAddress = addresses.networks[thisNetwork].deployments.cctpFundManager
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 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 filePath = path.join(__dirname, '../constants/addresses.json');
writeJsonToFile(filePath, addresses);
Expand Down
4 changes: 1 addition & 3 deletions deploy/postDeployCctp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import forgeFundManagerArtifact from "../artifacts/contracts/multiswap-contracts
import cctpFundManagerArtifact from "../artifacts/contracts/multiswap-contracts/CCTPFundManager.sol/CCTPFundManager.json"


export const postDeployCctp = async function (
) {
// setTargetCCTPNetwork(uint256 _chainID, uint32 _targetNetworkDomain, address _targetCCTPFundManager)
export const postDeployCctp = async function () {
const cctpNetworks = Object.keys(addresses.networks).filter((network) =>
addresses.networks[network].cctp !== undefined
);
Expand Down

0 comments on commit 920a082

Please sign in to comment.