As of May 31, 2023, we have updated our Code of Conduct.

New answers tagged

0 votes

AttributeError: 'exactInputSingle' object has no attribute 'buildTransaction'

I get the answer form github: 'in v6, it's snaked cased as build_transaction()' from:https://github.com/ethereum/web3.py/issues/1340
Zysman's user avatar
  • 1
0 votes

ERROR: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack

This problem usually arises, when you use more than 16 variables in a function at once. To fix the stack too-deep error, you should delete your variables after you do not need them this way: function ...
Nal Luksic's user avatar
0 votes
Accepted

Can I get the result of swap by logs?

There is several transfers happening here, so simply looking at swap event log will not be sufficient. What you should do is find a transfer event, where sender is the pair contract and the receiver ...
Nal Luksic's user avatar
0 votes

How was this liquidity token locked? I can't find any references to the lockNFT function online?

the creator of the midwit token deployed their own nft/lp locker, i believe the original creator of the locker contract is "blurr" (RFD deployer), the contract is verified so you can check ...
never go full degen's user avatar
0 votes

How to calculate sqrtPriceX96 in solidity?

This way: const sqrtPriceToPrice = (sqrtPriceX96, token0Decimals, token1Decimals) => { let mathPrice = Number(sqrtPriceX96) ** 2 / 2 ** 192; const decimalAdjustment = 10 ** (token0Decimals -...
Rodrigo Burgos's user avatar
1 vote
Accepted

Understanding the getAmountsOut functrion, help please

Your understanding of the return signature is correct. In Solidity you can define the return variable in the signature. You can read more here. TL;DR getAmountsOut calculates dynamically the swap for ...
Willbrand's user avatar
  • 129
0 votes
Accepted

Can't create UniswapV2Pair from constructor on Ethereum Mainnet

The problem was solved when I changed the wallet to one with more ETH (at least twice the amount that needs to be paid for fees for the deployment)
ppduster's user avatar
0 votes

Uniswap Range Order Tick Range Question

Summary If providing liquidity in token 0, tickLower/tickUpper must be above current tick range. If providing in token 1, tickLower/tickUpper must be below the current tick range. What are ticks ...
Nat's user avatar
  • 223
0 votes
Accepted

Issues verifying signed data for Permit2

The issue has been resolved and proved to be nothing but an integration bug caused by an unclear contract API. The values used to rebuild the hash (e.g. amount, nonce, token address) have to match 1:1 ...
razgraf's user avatar
  • 770
0 votes

How would I be able to set slippage for exactInputSingle on Uniswap v3 and Pancakeswap v3?

I somehow found a way to do this by using the sqrtPriceX96 in the token's pool address by querying slot0. The documentation for this is gone but I've searched and saw other people using this formula: ...
Austin's user avatar
  • 123
0 votes

What is Ticks on Uniswap?

in uniswap v3 we have concentrated liquidity. User has to decide in which price range s/he wants to have their liquidity gets traded. for this, uniswap has to find a way to decide the price ranges. ...
Yilmaz's user avatar
  • 1,424
0 votes

How to calculate all-time global fees, earned by a Uniswap v3 pool?

you do not calculate, it is already in a global state and tracked by the uniswap v3. from the v3 whitepaper The global state also tracks two numbers: feeGrowthGlobal0 (fg,0 ) and feeGrowthGlobal1 (fg,...
Yilmaz's user avatar
  • 1,424
0 votes

Trying to make sense of Uniswap v3 fees (feeGrowthInside0LastX128, feeGrowthGlobal0X128)

@Crypto_Rachel your code works only when we have defined min and max ticks. When we have position with whole range min tick on NFT image is -887220 but tickLower from positions returns value like ...
wafcio's user avatar
  • 1
1 vote

Sending balance to address

What balance are you talking about ? If that's your ETH balance, then that's normal. What the first snippet does is that it first sends the whole balance in ETH of your contract. Then you are checking ...
Franfran's user avatar
  • 564
1 vote
Accepted

How to wrap ETH into WETH via ethers.js or web3.js?

Here's the deposit method: https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2#writeContract#F5 After calling deposit method, the caller will received WETH equal to the ETH amount ...
tia's user avatar
  • 126
0 votes

Sending transaction to Uniswap/Pancakeswap Router using Nethereum failing

It seems that the issue might be with the input parameters being passed to the exactInputSingle function. One thing you can try is to encode the nested array of input parameters manually using the ...
Kelvin Chelenje's user avatar
0 votes
Accepted

Swap contract v Lightning network contract

The reason why decentralized exchanges like Uniswap and Balancer require gas fees and confirmation time is because they are built on top of the Ethereum blockchain, which is a smart contract platform. ...
Kelvin Chelenje's user avatar
0 votes

Ethereum test network for Uniswap

The Uniswap Interface officially supports the following testnets: Goerli Optimism Goerli Arbitrum Goerli Celo Alfajores Polygon Mumbai Only Goerli is Ethereum test network as such, but the others ...
kfx's user avatar
  • 977
0 votes

Transaction fails on Etherscan but succeeds on Tenderly, why is that?

Goerli has been super unsteady un unreliable lately. Its gas prices have been through the roof. Basically Goerli shouldn't be used anymore for testing dapps. Sepolia is the meant network for dapp ...
Lauri Peltonen's user avatar
0 votes

Confused in understanding on tick range in uniswap

Tick index range is [-887272, 887272]. This covers the entire price ranges. With the base 1.0001, powering it to the tick index i from -887272 to +887272 gives you a huge range: >>> # python ...
hyunchel's user avatar
0 votes

Tell me if i understood this line properly

In the context of your code snippet, it's checking for three cases: a new liquidity has been initialized the liquidity has been removed entirely neither #1 or #2 If the case 1 or 2 happens, we are ...
hyunchel's user avatar
0 votes

Liquidity Pool Addresses

You should consult with their documentations for the latest updates on deployment addresses should there be any change. For example, you can find deployment addresses in Uniswap documentation.
hyunchel's user avatar
2 votes

Ethereum test network for Uniswap

Sepolia is the testnet which should be used for testing dapps, including Uniswap. Unfortunately, it looks like Uniswap only supports Goerli (Ropsten and Rinkeby are already deprecated). As I see it, ...
Lauri Peltonen's user avatar
1 vote
Accepted

Why does Uniswap use Q notation versus the uint256 ratio price?

Uniswap utilizes a fixed-point number representation(Q-notation) to achieve a higher precision. sqrtX96 means that the variable has been multiplied by 2**96 to guarantee 96 bits of precision during ...
hyunchel's user avatar
2 votes

Does uniswap have ONE liquidity pool per pair?

It depends if you are referring to Uniswap V2, or Uniswap V3. In uniswap V2, there was one pair contract per erc20 pair. In uniswap V3, there can be multiple pools for each asset pair, defined at a ...
Bruce's user avatar
  • 612
0 votes

How to create a uniswap pool on goerli with two custom created tokens, tokenA and tokenB?

The steps I would take to solve this problem: Get the smart contracts.Basic ERC20 Tokens can be implemented with OpenZeppelins ERC20 wizard.For Uniswap, you need to interact with the UniswapFactory ...
Willbrand's user avatar
  • 129

Top 50 recent answers are included