Questions tagged [uniswap]

Uniswap is a decentralized finance protocol that is used to exchange cryptocurrencies.

Filter by
Sorted by
Tagged with
0
votes
1answer
94 views

Why include UniSwapRouterV2 in Erc20 Contract?

Many ERC20 coins like SafeMoon include UniSwapRouterV2 in their contract. What are the benefits of this? Is it ok not to include a router? e.g. SafeMoon's Router code: interface IUniswapV2Router01 { ...
0
votes
1answer
142 views

What's the relationship between LP reserves and Swap rate?

This transaction transaction describes Swap event: amount0_in=14067900000000 amount1_out=393017164305296368 This means that the effective trade rate is: trade_rate=round(amount1_out/amount0_in)=27,...
0
votes
1answer
90 views

Why do we need to deploy a smart contract to swap tokens on Uniswap?

I didn't get why do we need to deploy a smart contract to call a router function? Why not just send a transaction to the router via web3 or ethers?
0
votes
0answers
19 views

How to calculate new reserve values after a Swap?

Let's use this transaction as an example. Here 1 BUSD was transferred to Zombie / BUSD LP in exchange for 172054109197 Zombie tokens. (3511308350 (2%) Zombie tokens were burned as part of the ...
0
votes
0answers
38 views

Hardhat not catching exception from external contracts on forknet

I am testing a function that involves a buying transaction on PancakeSwap. This involves a series of internal function calls which is not shown here for simplicity sake. here is my test snippet: ...
0
votes
2answers
384 views

Call swapExactETHForTokens from contract and pay with contract balance

I am starting to learn solidity so this is probably a very basic question, but I couldn't find enough clarification only. My goal is to purchase a token on PancakeSwap/UniSwap using the ETH balance of ...
0
votes
0answers
12 views

How to get List of Etherscan Lable for each contract address and identify contract transfer token event

I use Etherscan API to get list of ERC20 tranfer token event of a specified address, but I want to get transactions which are sent FROM Uniswap or contract symbol address like this, but I don't know ...
0
votes
0answers
149 views

Can someone help me take a look at this smart contract

I keep getting a transaction revert error when i call the startSwap function. Please what am i doing wrong? error Warning! Error encountered during contract execution [execution reverted] code pragma ...
0
votes
0answers
22 views

How do I swap a low amount of Monero for ETH?

I wish to swap 0.0175 XMR to ETH. I tried everywhere online, but it is below the minimum amount. Morphtoken's XMR exchange has been down for maintenance. Next, I tried crypto wallets with built-in ...
0
votes
1answer
274 views

Uniswap Approve Succeeded But No ETH Returned in “Swap”

I attempted to swap some eMax (using the Uniswap Swap feature) for ETH and the Approve went through, in the end I received another token (old version of token before hard fork). It seems to be the ...
0
votes
0answers
102 views

Unable to Add Liquidity from ERC20 Token Contract

I am trying to include the Uniswap addLiquidityEth() function in this simple ERC20 token that I am deploying via Remix. When calling the addLiq() function, I get the rather unhelpful error message ...
0
votes
0answers
45 views

Uniswap V3 Pool Connection

I created my own liquidity pool on Uniswap V3. Now I'm trying to add liquidity to my pool with my smart contract. Which Uniswap contract including addLiquidity() or increaseLiquidity() methods? What ...
0
votes
0answers
42 views

How to convert BigInteger to a decimal in Nethereum / Web3

I need to read and write some Uniswap Transactions using Nethereum/Web3. The uniswap methds expect BigInteger data types, but the UI expects so called Display unit types, which essentially convert ...
0
votes
1answer
880 views

“Price Impact Too High” swapping tokens back to ETH on basic contract with liquidity (Uniswap)

I created this basic smart contract on Rinkeby (uses OpenZeppelin ERC20PresetMinterPauser preset), minted 1m FOO, then added liquidity on Uniswap v2 with 10 ETH and 1m FOO. I then swapped 1 ETH for 90,...
0
votes
1answer
32 views

Lost Coins on Uniswap

I tried to swap HOKK coin for SEPA coin last night and the transaction did not go through. My coinbase wallet still shows the HOKK coins but when I look at the transaction it says success even though ...
0
votes
1answer
152 views

How can I swap a token across different liquidity pools in a single transaction?

im pretty new to solidity, and i was wondering how you can 1 ERC token by another across different liquidity pools. Example: I have 1 DAI and I change it for eth in the ETH-DAI Uniswap pool then I ...
0
votes
1answer
138 views

What unit are the Uniswap/PancakeSwap router functions expecting?

I'm looking at this transaction in BSCScan: https://bscscan.com/tx/0x09a19072b2374340de10dc6ac235fcd0ba229ff1eba41e155f5b0a60f9c2e2cd When looking at Input Data for the method call, the caller ...
0
votes
0answers
88 views

How to change uniswap router address after deployment of contract?

I deployed a contract with the wrong router address hardcoded like this: IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F); Now I can't remove ...
0
votes
0answers
298 views

Uniswap: Insufficient Input Amount

When I attempt to add V2 liquidity to Uniswap ETH/Token, the button stays grayed out and is titled "Insufficient Input Amount" (no matter what I set for the token values). When I attempt to ...
0
votes
1answer
295 views

Calculation of Uniswap Pair address

I want to know the address of an Uniswap pair contract with Solidity, even if the pair doesn't exist yet. I can't use the function getPair of the factory contract because it return 0 when the pair ...
0
votes
0answers
138 views

How to get rid of UniswapV2 K error?

I am writing a fairly simple smartcontract unising flash swap: function uniswapV2Call( address _sender, uint _amount0, uint _amount1, bytes calldata _data ) external { address[] ...
0
votes
0answers
388 views

UniSwap Error - “Fail with error 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT”

https://etherscan.io/tx/0x42bdd38783123a21ff831a5a92f12142fc568d92bae9ac02834ed87ff687b97f When you buy more than 0.005 ETH worth of DOGI you get the error "Fail with error 'UniswapV2Router: ...
0
votes
0answers
95 views

Issue with `TRANSFER_FROM_FAILED` when calling Uniswap contract - but I am approving the token!

My code is pretty simple function swapForEth(address tokenAddress, uint amountIn, uint amountOutMin, address to, uint deadline) external onlyOwner payable { require(IERC20(...
0
votes
0answers
65 views

Is it possible to swap if the TransferFrom ERC20 function is unavailable in the contract?

I have in my wallet a certain ERC20 token. However upon further examination I saw that the transferFrom function was a honeypot, meaning that only the owner's funds could be spent this way. Nobody ...
0
votes
0answers
39 views

Dropped & replaced Uniswap, trust wallet

I invested to a new coin through uniswap with my trustwallet, it was pending, but ended up showing "Dropped & Replaced". Lost all hope for this transaction since i have no knowledge on ...
0
votes
0answers
854 views

How do I add fees to my ERC20 token? (for redistribution, liquidity and a dev wallet)

Thank you for reading this post. I can make a basic ERC20 token, but I am really struggling to find anything that explains how to add fees. My intention is to create a token with 3 fees. One fee will ...
0
votes
0answers
217 views

ETH lost on buggy Uniswap using connected Coinbase Wallet. Multiple transactions failed while one being displayed as successful

I used Uniswap for the first time, because a desired token was available through Uniswap. Everything seemed fine. I connected my Coinbase wallet to easily transfer the needed Ethereum funds and ...
0
votes
0answers
11 views

Does it cost more in AMM fees to split a trade into multiple pieces?

Suppose you're trading against an AMM with a static invariant, such as Uniswap v2. I define "static" as meaning the invariant containing no dynamic parameter in the price curve. A good ...
0
votes
0answers
103 views

Why I got “execution reverted: Uni::_transferTokens: transfer amount exceeds balance”"?

I tried to make a flashswap on uniswap, below is my code: contract Flash_swap_arb is Ownable,IUniswapV2Callee{ using SafeMath for uint256; address public my_to_address = ...
0
votes
2answers
67 views

Exception:Reverted when swap by smart contrat with uniswap

Here is my code pragma solidity ^0.8.2; import "https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/interfaces/IUniswapV2Router02.sol"; contract Test_Swap{ address ...
0
votes
1answer
252 views

Fail with error 'TransferHelper: TRANSFER_FROM_FAILED' / ERC20: transfer amount exceeds balance

I am Swap Tokens to ETH via uniswap but its failing due the following: Fail with error 'TransferHelper: TRANSFER_FROM_FAILED' on EtherScan but on Tenderly I am seeing ERC20: transfer amount exceeds ...
0
votes
0answers
56 views

Calling the fuction GetEthToTokenInputPrice

Please help since I'm getting furious over this problem. I deployed a contract to the ropsten network, and am trying to call a function getEthToTokenInputPrice to see if it worked through solidity. I ...
0
votes
1answer
109 views

Confusion around AmoutOutMin with swapExactETHForTokens call

I don't understand the paramater AmountOutMin for this function. From the docs, it seems that the call will fail, if the amount specified by this parameter, is not transferred to the user. However, in ...
0
votes
0answers
67 views

How can I set the price of my cake token into bnb in pancakeswap

Where can we set the price of the cake tokens so that we can easily convert bnb to cake tokens and vice versa in the pancakeswap contracts? Any help?
0
votes
0answers
29 views

What is the difference between liquidity mining and farming?

I have seen both terms being used in the DeFi space a lot. I understand that liquidity mining is: when people receive tokens as rewards for participating in a certain protocol in a given way. I ...
0
votes
0answers
21 views

Uniswap Pair Initial Price

I'm trying to determine what the Uniswap Pair initial price was(initial tokens A and B). Any idea how to do that without having to check every single token transfer and working backwards ?
0
votes
0answers
104 views

Contract uniswap check liquidity is added

How can i check in contract a liquidity is added to some pair and then exchange it?
0
votes
0answers
238 views

Can I burn tokens held by uniswap/pancake contract?

I'm trying to implement a function in solidity that burns tokens in liquidity. e.g I add 10k tokens to pancakeswap, after some sales I have 15k tokens in liquidity and I want to burn 5K, so I decided ...
0
votes
0answers
10 views

Does Dapps such as Uniswap and Sushiswap transactions are made 100% on-chain?

I'm just wondering, it looks like Dapps such as Uniswap and Sushiswap transactions are made 100% on-chain, because some claimed those apps are 100% decentralized. Is it true that all transactions are ...
0
votes
0answers
10 views

How to list to Uniswap on User behalf

Currently, DAPP is under development. Is it possible for us to handle the GAS payment and approval process on behalf of the user who created the token using DAPP when trying to list the token in ...
0
votes
0answers
62 views

Trying to understand Uniswap liquidity and their API with autoliquidity, need some help

So I'm trying to understand liquidity and the API from Uniswap. I understand the initial liquidity provided by their interface, i.e. I add 1 eth and 1 of my tokens, it means that 1 token costs 1 eth. ...
0
votes
1answer
674 views

Invalid BigNumber Value Uniswap and Ethers JS

Hey guys I am using the Uniswap Javascript SDK and Ethers JS to make a swap but I am getting this Error: invalid BigNumber value (argument="value", value=[-626648004,3158], code=...
0
votes
1answer
13 views

What to change when ico has been ended and public sale will be started

I want to start an ico on the ERC20 network. The ico will be available for three months for example. For that I have to write a smart contract. That is clear to me. It is only not clear to me what ...
0
votes
0answers
136 views

TRANSFER_FROM_FAILED when swapping token for eth with uniswap api

when calling uniswap.swapExactTokensForEth, I get the following error on etherscan: Fail with error: TransferHelper: TRANSFER_FROM_FAILED I see previous posts with this error, though they seem related ...
0
votes
0answers
4k views

Probably scammed by a coin which doesn't allow to sell, only to buy

As the title says - the coin: https://etherscan.io/token/0x6d85dd21d470e5c1e6af3a5198f0d5ac4dcdd7ef It only allows you to buy, but not to sell - I might still have a chance to recover my ETH, since I ...
0
votes
1answer
98 views

Pancake/Uniswap: tell inside contract if a transfer is a buy or sell

I have a token contract that will exclusively use Pancakeswap as trading platform. How can I tell in the contract if a transfer represents someone buying the token or someone selling it?
0
votes
0answers
41 views

Send LP tokens to a payable function using truffle console

I am trying to stake the LP tokens that I got after adding liquidity in pancakeswap contract function. I can see the LP tokens in my metamask wallet as well. Now I cant understand how will send some ...
0
votes
1answer
138 views

Flash loan price manipulation

I am quite new to flash loan and I don't fully understand it. I've been reading on flash loan attacks lately and notice often times it involves a huge dump on Uniswap to skew the price of a coin. I am ...
0
votes
0answers
180 views

TRANSFER_FROM_FAILED AddLiquidityEth uniswap

I'm new using ethereum and I have a problem trying to add liquidity to uniswap in a local network using ganache and forking from insura, this is my code: from web3 import Web3 import json def get_abi(...
0
votes
0answers
162 views

Reverse my transaction on uniswap

I swap ether to some coins and now i cannot swap back those coin to etherum. Probably i bought some scam coin but now my coinbase wallet is showing price against that coin. Is it possible that i can ...

1
5 6
7
8 9