Uniswap / v3-periphery

🦄 🦄 🦄 Peripheral smart contracts for interacting with Uniswap v3
https://uniswap.org
GNU General Public License v2.0
1.15k stars 1.06k forks source link

On-chain staticcall IQuoter is not working #374

Closed erencelik closed 6 months ago

erencelik commented 6 months ago

I'm able to use IQuoter functionalities with ethersjs however I couldn't make a successful call through my contract.

Here is the code snippet; All parameters are valid and works on v2 amountOut calculation.

(bool success, bytes memory data) = quoter.staticcall(
                abi.encodeWithSelector(
                    IQuoter.quoteExactInputSingle.selector,
                    _tokenIn,
                    _tokenOut,
                    _poolFee,
                    _amount,
                    0
                )
            );
require(success, "staticcall failed on Quoter");
return abi.decode(data, (uint256));

P.S. : I also tried encoding staticcall data by using abi.encodeWithSignature but it has no effect.

erencelik commented 6 months ago

nvm. it seems quoter itself obtains pool from it's own factory means it only support uniswap pools unless other defis deploy their own quoters so I'm closing this.