updated contracts and deploy scripts

This commit is contained in:
Kevin Peters 2022-01-20 19:32:50 +00:00
parent 41d2267fa7
commit cc5f71983a
4 changed files with 15 additions and 7 deletions

View File

@ -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);
}
}

View File

@ -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}';`
);

View File

@ -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

View File

@ -1,2 +1,2 @@
goerli*.ts
mumbai*.ts
goerli.ts
mumbai.ts