diff --git a/contracts/contracts/SwapHelper.sol b/contracts/contracts/SwapHelper.sol index ec5662c..60f59f5 100644 --- a/contracts/contracts/SwapHelper.sol +++ b/contracts/contracts/SwapHelper.sol @@ -36,7 +36,8 @@ library SwapHelper { address[2] path; uint256 deadline; uint24 poolFee; - uint8 swapType; + uint8 swapFunctionType; + uint8 swapCurrencyType; } function decodeVaaPayload( @@ -83,6 +84,9 @@ library SwapHelper { decoded.poolFee = encodedVm.payload.toUint16(index); index += 2; - decoded.swapType = encodedVm.payload.toUint8(index); + decoded.swapFunctionType = encodedVm.payload.toUint8(index); + index += 1; + + decoded.swapCurrencyType = encodedVm.payload.toUint8(index); } } \ No newline at end of file diff --git a/contracts/migrations/ethereum/2_deploy_contracts.js b/contracts/migrations/ethereum/2_deploy_contracts.js index 43cfb86..251a0b3 100644 --- a/contracts/migrations/ethereum/2_deploy_contracts.js +++ b/contracts/migrations/ethereum/2_deploy_contracts.js @@ -9,6 +9,7 @@ module.exports = async function (deployer, network) { const routerAddress = "0xE592427A0AEce92De3Edee1F18E0157C05861564"; const feeTokenAddress = "0x36Ed51Afc79619b299b238898E72ce482600568a"; // wUST const tokenBridgeAddress = "0xF890982f9310df57d00f659cf4fd87e65adEd8d7"; + const wrappedEthAddress = "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"; await deployer.deploy(SwapHelper); await deployer.link(SwapHelper, CrossChainSwapV3); @@ -16,14 +17,15 @@ module.exports = async function (deployer, network) { CrossChainSwapV3, routerAddress, feeTokenAddress, - tokenBridgeAddress + tokenBridgeAddress, + wrappedEthAddress ); // save the contract address somewhere await fsp.mkdir(scriptsAddressPath, { recursive: true }); await fsp.writeFile( - `${scriptsAddressPath}/${network}.ts`, + `${scriptsAddressPath}/goerli.ts`, `export const SWAP_CONTRACT_ADDRESS = '${CrossChainSwapV3.address}';` ); diff --git a/contracts/migrations/polygon/2_deploy_contracts.js b/contracts/migrations/polygon/2_deploy_contracts.js index 05faf41..563b13a 100644 --- a/contracts/migrations/polygon/2_deploy_contracts.js +++ b/contracts/migrations/polygon/2_deploy_contracts.js @@ -9,6 +9,7 @@ module.exports = async function (deployer, network) { const routerAddress = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff"; // quickwap const feeTokenAddress = "0xe3a1c77e952b57b5883f6c906fc706fcc7d4392c"; // wUST const tokenBridgeAddress = "0x377D55a7928c046E18eEbb61977e714d2a76472a"; + const wrappedMaticAddress = "0x9c3c9283d3e44854697cd22d3faa240cfb032889"; await deployer.deploy(SwapHelper); await deployer.link(SwapHelper, CrossChainSwapV2); @@ -16,7 +17,8 @@ module.exports = async function (deployer, network) { CrossChainSwapV2, routerAddress, feeTokenAddress, - tokenBridgeAddress + tokenBridgeAddress, + wrappedMaticAddress ); // save the contract address somewhere diff --git a/react/src/addresses/.gitignore b/react/src/addresses/.gitignore index f8c953e..b44d3a4 100644 --- a/react/src/addresses/.gitignore +++ b/react/src/addresses/.gitignore @@ -1,2 +1,2 @@ -goerli*.ts -mumbai*.ts +goerli.ts +mumbai.ts