Skip to content
This repository was archived by the owner on Sep 17, 2021. It is now read-only.

What will happen in case of REVERT inside DELEGATE_CALL? #39

@k06a

Description

@k06a

I see a lot of BAD JUMP DESTINATION transactions here: https://etherscan.io/address/0x3958b4ec427f8fa24eb60f42821760e88d485f7f

SNX token calls tokenFallback on Uniswap contract in the middle of exchange and it seems Uniswap proxy handles this problem in a wrong way.

Proxy code is:

CALLDATASIZE
PUSH1 0x00
PUSH1 0x00
CALLDATACOPY
PUSH2 0x1000
PUSH1 0x00
CALLDATASIZE
PUSH1 0x00
PUSH20 0x2157a7894439191e520825fe9399ab8655e0f708
GAS
DELEGATE_CALL
ISZERO
PC
JUMPI
PUSH2 0x1000
PUSH1 0x00
RETURN

What does the latest part after DELEGATE_CALL means can anyone describe what should happen after DELEGATE_CALL reverts internally?

It seems Uniswap exchange called by another smart contract will eat all of its gas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions