GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — execution reverted (close_position not executing the "Burn" call on Polygon network) · Issue #330 · uniswap-python/uniswap-python

execution reverted (close_position not executing the "Burn" call on Polygon network) #330

New issue
Copy link
New issue
Copy link
Open
Open
execution reverted (close_position not executing the "Burn" call on Polygon network)#330
Copy link
Labels
bugSomething isn't workingSomething isn't working

Description

@carlos-pansela
carlos-pansela
opened on Apr 28, 2023
Issue body actions

Describe the bug

close_position not executing the "Burn" function on Polygon network.

web3.exceptions.ContractLogicError ! execution reverted: Not cleared

The “Decrease Liquidity” and “Collect” parts of the function call execute fine, but the “Burn” call fails.

After running the close_position() a second time returns

web3.exceptions.ContractLogicError ! execution reverted

To Reproduce

I am unfortunately unable to reproduce this on demand. It seems to sometimes happens. I anecdotally suspect this happens when polygon network is overloaded but have no proof that it is the case.

Network: Polygon Mainnet

LP pool = 0x86f1d8390222A3691C28938eC7404A1661E618e0
token0 = 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270
token1 = 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619

Route: I don't have any custom route setup

Here is the relevant code

`
w3 = Web3(Web3.HTTPProvider(HTTPprovider))
w3.middleware_onion.inject(geth_poa_middleware, layer = 0)
w3.middleware_onion.add(construct_sign_and_send_raw_middleware(private_key))

version = 3
uniswap = Uniswap(address = address, private_key = private_key, version = version, provider = HTTPprovider, web3 = w3)

def close_position(token_ID):
close_position = uniswap.close_position(token_ID)

close_position(token_ID)
`

Expected behavior

If the function close_position fails to execute all 3 steps (Decrease liquidity, Collect and Burn) at a time, then upon calling it again it should finish the process. ("Burn" in my case, because "Decrease liquidity" and "Collect" work fine)

Additional context

Activity

  1. carlos-pansela
    added
    bugSomething isn't workingSomething isn't working
    on Apr 28, 2023
  2. carlos-pansela commented on May 9, 2023

    @carlos-pansela
    carlos-pansela
    on May 9, 2023
    Author
    More actions

    Is anybody able to help please ?

  3. ErikBjare commented on May 9, 2023

    @ErikBjare
    ErikBjare
    on May 9, 2023
    Member
    More actions

    The error is triggered by the following line:

    https://github.com/Uniswap/v3-periphery/blob/6cce88e63e176af1ddb6cc56e029110289622317/contracts/NonfungiblePositionManager.sol#L379

    Looks like the position hasn't been cleared completely, which is a requirement to burn the LP token.

    I'm unfortunately not familiar enough about the liquidity provision part of the code to say exactly what the issue is.

  4. ErikBjare commented on May 9, 2023

    @ErikBjare
    ErikBjare
    on May 9, 2023
    Member
    More actions

    I notice there are several wait_for_transaction_receipt calls in the close_liquidity method, which will make the transactions end up in different blocks.

    It's possible that doing a multicall or sending them off at the same time (for inclusion into the same block) can address the issue. Just speculating though, not sure why positions aren't cleared entirely before burning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.