CalcTest.ts 772 B

1234567891011121314151617181920212223
  1. import {web3} from "hardhat";
  2. import fee from "../config/fee";
  3. import contracts from "../config/contracts";
  4. describe('Calc test', () => {
  5. it('Univ3 swap test', async () => {
  6. const Calc_ABI = require('../abi/Calc_ABI').default
  7. let calc = new web3.eth.Contract(Calc_ABI, contracts.CALC)
  8. // 1334059008
  9. await calc.methods.getQuote(contracts.WETH, 1e15, contracts.HEX, fee._30_per_10000).call().then(console.log)
  10. })
  11. it('Univ3 calc test', async () => {
  12. const Calc_ABI = require('../abi/Calc_ABI').default
  13. let calc = new web3.eth.Contract(Calc_ABI, contracts.CALC)
  14. await calc.methods.calc1(1375318565, fee._30_per_10000).call().then(console.log)
  15. await calc.methods.calc2(1375318565, fee._30_per_10000).call().then(console.log)
  16. })
  17. })