CRYPTO NEWS

Roole Locates Stolen Vehicles Globally via Nodle Network’s On-Chain Services

San Francisco, United States / California, 20th September, 2022, Chainwire If a Roole vehicle is reported stolen, millions of Nodle-enabled smartphones will work together to find the lost vehicle Vehicle…

Swap ETH to DAI on Velodrome

I forked optimism mainnet. I wanna swap ETH to DAI using Velodrome router. This is my test scripts. import { expect } from "chai"; import { ethers } from "hardhat"; import { Contract } from "ethers"; import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; describe("LPPriceOracle", function () { let StablePriceOracle: Contract; let DaiContract: Contract; let Router: Contract;::Listen

I forked optimism mainnet. I wanna swap ETH to DAI using Velodrome router. This is my test scripts.

import { expect } from "chai"; import { ethers } from "hardhat"; import { Contract } from "ethers"; import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";  describe("LPPriceOracle", function () {   let StablePriceOracle: Contract;   let DaiContract: Contract;   let Router: Contract;   let UsdcContract: Contract;   let owner: SignerWithAddress,     account1: SignerWithAddress,     account2: SignerWithAddress;   const percent = 0.5 / 100;    const ROUTER_ADDRESS = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f";   const DAI = "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1";   const USDC = "0x7F5c764cBc14f9669B88837ca1490cCa17c31607";   const DAI_USD_FEED = "0x8dBa75e83DA73cc766A7e5a0ee71F656BAb470d6";   const USDC_USD_FEED = "0x16a9FA2FDa030272Ce99B29CF780dFA30361E0f3";    beforeEach(async () => {     [owner, account1, account2] = await ethers.getSigners();      const RouterAbi = require("./Router.json");     Router = new ethers.Contract(ROUTER_ADDRESS, RouterAbi, owner);      const DaiAbi = require("./Dai.json");     DaiContract = new ethers.Contract(DAI, DaiAbi, owner);      const UsdcAbi = require("./Dai.json");     UsdcContract = new ethers.Contract(USDC, UsdcAbi, owner);      let priceOracle = await ethers.getContractFactory("StableLPPriceOracle");     StablePriceOracle = await priceOracle.deploy();     await StablePriceOracle.deployed();   });    describe("Stable Test", () => {     beforeEach(async () => {       const WETH = await Router.weth();       await Router.swapExactETHForTokens(         0,         [{ from: WETH, to: DAI, stable: true }],         owner.address,         Date.now() + 100000,         { value: ethers.utils.parseEther("500") }       );       // await DaiContract.approve(Router.address, ethers.utils.parseEther("100"));     });      it("getSafePrice test - Swap DAI to USDC", async () => {       await StablePriceOracle.setFeedAddress(DAI_USD_FEED, USDC_USD_FEED);       const priceBeforeSwap = await StablePriceOracle.getSafePrice(DAI, USDC);       // await Router.swapExactTokensForTokens(       //   "1000000000000000000",       //   1,       //   [DAI, USDC],       //   owner.address,       //   Date.now() + 100000       // );     });   }); }); 

But I get the following error. enter image description here

Please someone help me.

Roole Locates Stolen Vehicles Globally via Nodle Network’s On-Chain Services

Shopping cart
There are no products in the cart!
Continue shopping
0