2022 Developer Survey is open! Take survey.

Hot answers tagged

1 vote
Accepted

Initializing IUniswapV2Pair from msg.sender

So IUniswapV2Pair is a cast, that casts an address into an interface, in this case the IUniswapV2Pair interface. Doing this essentially makes all the functions inside of the interface easily callable ...
user avatar
1 vote

ETH not showing in Coinbase Wallet after using Uniswap

The transaction shows that you swapped the tokens for Eth and you did received the Eth in your address (1.091778833710728356 Ether to be exact). Nothing seems wrong with it.
user avatar
  • 3,202
1 vote
Accepted

Uniswap V3: Fetching spot prices documentation seems incomplete

These JSBI objects got a method toSignificant, use it to convert the big number into a number literal. // toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; ...
user avatar
  • 1,236
1 vote

Liquidity locking and ETH loose

Locking up your liquidity tokens doesn't do anything except preventing you from exchanging your LP tokens back to the tokens from the pool. Whiteboard crypto on Youtube has a nice video about how ...
user avatar
  • 21
1 vote
Accepted

Having trouble executing swapExactTokensForTokens on a uniswap contract?

You're calling swapExactTokensForTokens function from your contract, so the msg.sender in this context is address of the contract. When Uniswap's router tries to transfer tokens it calls transferFrom(...
user avatar
  • 26
1 vote

AddLiquidity to Uniswap

No, you dont need real DAI or any other token. You just need to fork and use any address that has enough tokens. For example: Get an address of account that has large amount of ether. Here is a list ...
user avatar
  • 880
1 vote

Why ERC-20 interface uses uint256 while Uniswap router uint?

uint is an alias for uint256. A good example contract that focuses on primitives https://solidity-by-example.org/primitives
user avatar
1 vote
Accepted

Why ERC-20 interface uses uint256 while Uniswap router uint?

The simple uint and int are similar to uint256 and int256, respectively.
user avatar
1 vote

Out of gas when trying to deploy UniswapV2Router02 locally in Hardhat

You should enable allowUnlimitedContractSize for your testing network in hardhat.config.js. I.e: Hardhat use "hardhat" network as default, you could simply add this line: networks: { ...
user avatar
1 vote

How come this tx appears as "private" in etherscan but is also a uniswap v2 swap?

Here is a visual explanation to elaborate on @Dylan's answer. The router provides convenience methods and the MEV bot contracts bypass it. The image below is an example. While the router is bypassed ...
user avatar
  • 123
1 vote

Uniswap V2 removeLiquidity

This is wrong for two reasons: You are not trading liquidity tokens for pool tokens, you're removing liquidity which is different. amountADesired & amountBDesired are not maintained as pairs with ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible