CalcTest.ts 608 B

123456789101112131415
  1. import {web3} from "hardhat";
  2. import fee from "../config/fee";
  3. import contracts from "../config/contracts";
  4. describe('Calc test', () => {
  5. it('Univ3 calc test', async () => {
  6. const CALC_ABI = require('../artifacts/contracts/Calc.sol/Calc.json').abi
  7. let calc = new web3.eth.Contract(CALC_ABI, contracts.CALC)
  8. let inAmount = 1e17.toString()
  9. await calc.methods.getQuote(contracts.WETH, inAmount, contracts.USDT, fee._30_per_10000).call().then(console.log)
  10. await calc.methods.getQuoteHandleFee(contracts.WETH, inAmount, contracts.USDT, fee._30_per_10000).call().then(console.log)
  11. })
  12. })