New answers tagged

0 votes

SushiSwapRouter. getAmountsOut. 1inch / dai. Incorrect price

I have exact same issue and I just workaround using pancakeswap router.
user avatar
  • 1
0 votes

Testing Uniswap tutorial contracts on local testnet forked from mainnet

Found an answer here: https://github.com/ethers-io/ethers.js/issues/1051 Apparently, you cannot pass as an argument to the constructor as the Contract object itself, rather you have to pass its ...
user avatar
  • 111
0 votes

Testing Uniswap tutorial contracts on local testnet forked from mainnet

You didn't share your contract code, but the code in the tutorial you've linked to uses contract name SwapExamples, and in your Hardhat script you're trying to get swapExample.
user avatar
1 vote

High Gas Flashbots Transaction

The reason for this is generally the last transaction in the bundle is the one that pays the miner tip. Basically, anything in excess of the required gas goes to the miner. It's weird now that Type 2 ...
user avatar
0 votes

Error: Transaction reverted: function call to a non-contract account when adding liquidity through UniswapV2Router

There is an issue with createPair UniswapV2Library function. If UniswapV2Pair ischanged, it will return different pair address, different hex First solution: The purpose of this function is to get the ...
user avatar
  • 1
1 vote

How to send Uniswap V3: Positions NFT to another wallet using Node.js

You can use safeTransferFrom or transferFrom method. https://etherscan.io/address/0xc36442b4a4522e871399cd717abdd847ab11fe88#writeContract
user avatar
1 vote

How to determine whether a pending tx is a result of a swap in Uniswap?

There are two ways a swap can be made. An EOA sends a transaction to a Uniswap router, in which case you query all txs that has the router address in the tx.to field. You just watch the router ...
user avatar
  • 2,435
0 votes

UniSwap V3 API : How to track **unclaimed fees** programmatically?

In order to get the right amount of uncollected fees for each token of your position, you should query the position and do a bunch of math. In the alternative, you can call the smart contract directly ...
user avatar
1 vote
Accepted

Attack on ERC-777 smart contract and UniswapV2Pair resulting in 104 ETH liquidity drain

Seems to me that your error is here. Typically this kind of computation is done using fixed-point arithmetic or using a reflection * totalSupply / reflectedSupply calculation. In the case of ...
user avatar
0 votes

Calculate token amount minimums for Uniswap Router's removeLiquidity function

You need token balances and total supply of the liquidity pair, let's me share - example gist It uses real token addresses from Cronos mainnet.
user avatar
  • 101
0 votes

Returned error: VM Exception while processing transaction: revert when i use UniswapV2router functions

I also wanted to test contracts using test file provided by truffle and got a similar error. here is my test file: const BN = require("bn.js"); const { sendEther, pow } = require("./...
user avatar
0 votes

How can I use UniswapV2 to create my own LP tokens?

uniswap has its own erc20 token if you have seen link here of UniswapV2ERC20.sol you just need to replace it with you token but you it must needed the same functionality to work with uniswapV2. **...
user avatar
  • 13
0 votes

How to get Sushiswap and Uniswap prices from API for WETH/DAI on KOVAN?

You can use chainlink APIs to get the prices of the token pairs. However they are very limited to the Kovan testnet. Link: https://docs.chain.link/docs/ethereum-addresses/
user avatar
0 votes

TRANSFER_FROM_FAILED Adding New Pool to Uniswap

You can try by approving the contract and then do TranasferFrom().
user avatar
0 votes

Is it necessary to our smart contract contains the codes of Sunswap or Uniswap in our contracts?

No. Your token should adhere to the ERC20 standard which allows the DEX to operate with it. You will need the basic exchange functions: transfer - executed during a purchase. LP calls transfer from ...
user avatar
0 votes
Accepted

Is it necessary to our smart contract contains the codes of Sunswap or Uniswap in our contracts?

If you are only creating a token, you only need to create the token code. The standard token code has nothing about such integrations - it only has the minimal functionality for the token to work by ...
user avatar
0 votes

swapping tokens via uniswapv2router on kovan network. but transaction always fails

This is probably due to you not passing value to the call to WETH function in order to deposit ETH and get WETH. If you check the traces here you would see that your contract is contacting the WETH ...
user avatar

Top 50 recent answers are included