diff --git a/odos.js b/odos.js index dab3067..b6de95e 100644 --- a/odos.js +++ b/odos.js @@ -2,39 +2,34 @@ const axios = require("axios"); const getOdosSwapPath = async (tokenIn, amountIn, tokenOut, account) => { - const data = { - chainId: 43114, - gasPrice: 30, - inputTokens: [ - { - amount: amountIn, - tokenAddress: tokenIn - } - ], - outputTokens: [ - { - proportion: 1, - tokenAddress: tokenOut, - } - ], - slippageLimitPercent: 0.3, - userAddr: account - }; - const res = await axios.post("https://api.odos.xyz/sor/quote", data); - // console.log("quote"); / - // console.log(res.data); - const res2 = await axios.post("https://api.odos.xyz/sor/assemble", { pathId: res.data.pathId, simulate: false, userAddr: account }); - return res2.data; + const data = { + chainId: 43114, + gasPrice: 30, + inputTokens: [ + { + amount: amountIn, + tokenAddress: tokenIn + } + ], + outputTokens: [ + { + proportion: 1, + tokenAddress: tokenOut, + } + ], + slippageLimitPercent: 0.3, + userAddr: account + }; + const res = await axios.post("https://api.odos.xyz/sor/quote", data); + const res2 = await axios.post("https://api.odos.xyz/sor/assemble", { pathId: res.data.pathId, simulate: false, userAddr: account }); + return res2.data; } const main = async () => { - const [tokenIn, amountIn, tokenOut, account] = process.argv.slice(-4); - // console.log({tokenIn, amountIn, tokenOut, account}); - - // console.log(res2.data); - const ret = await getOdosSwapPath(tokenIn, amountIn, tokenOut, account); - console.log(JSON.stringify(ret)); + const [tokenIn, amountIn, tokenOut, account] = process.argv.slice(-4); + const ret = await getOdosSwapPath(tokenIn, amountIn, tokenOut, account); + console.log(JSON.stringify(ret)); } main(); diff --git a/script/Unwind.s.sol b/script/Unwind.s.sol index b4e1521..d33af29 100644 --- a/script/Unwind.s.sol +++ b/script/Unwind.s.sol @@ -17,7 +17,6 @@ contract UnwindScript is Script, Test { vm.startBroadcast(); Unwind unwind = new Unwind(); aAvaUSDC.approve(address(unwind), type(uint).max); - // Unwind unwind = Unwind(0xB7DEA8552B2555082fdd65455570f4F2cF669C99); uint usdtAmount = 15600e6; uint usdcAmount = 15750e6;