ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
4.97k stars 1.69k forks source link

Problem with the mint Function with Optimism #2608

Closed prophetyy18 closed 2 years ago

prophetyy18 commented 2 years ago

What was wrong?

When I use Web3py to build a Transaction on Optimism, the result is 'gas required exceeds allowance (15000000). And then I looked for the difference in the code. Because my code was successfully working on the polygon. Then I noticed some differences. I use Metamask to interact with Uniswap by explorer. When polygon encods the int24 it will be 0000000000000000000000000000000000000000000000000000000000031c18. But when Optimism encodes the int24 it will be fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcef5a. So my transaction can't build. I'd like to know is there any solution to solve this problem.

https://optimistic.etherscan.io/address/0xC36442b4a4522E871399CD717aBDD847Ab11FE88#writeContract The mint function is in this contract.

https://polygonscan.com/address/0xc36442b4a4522e871399cd717abdd847ab11fe88#writeContract And this is the same contract on Polygon

How can it be fixed?

Fill this section in if you know how this could or should be fixed.

fselmo commented 2 years ago

This looks like a usage question as I don't see any code or a way that this relates to the library itself. If I'm wrong and you see an issue with the library, please share the code you think has a bug or is causing the issue and ask to reopen. We use issues to track issues with the library itself. The Discord or Ethereum Stack Exchange are good places to get some questions answered and if you find that in the end this is an issue with the library, please raise the issue here. Best of luck.