gobitfly / eth2-beaconchain-explorer

Open source golang based explorer for the eth2 beacon chain
GNU General Public License v3.0
797 stars 416 forks source link

Error display the internal transaction #2944

Open yxsec opened 3 weeks ago

yxsec commented 3 weeks ago

Describe the bug Although some internal transactions were failed, it also show the successful in the token transfer and internal transactions.

To Reproduce Trace attack code.

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.25;

contract TraceAttack {
    uint256 public testNumber = 42;

    function attackSim() external payable {
        (bool success, ) = address(this).call(abi.encodeWithSignature("innerAttackSim()"));
        require(success == false, "innerAttack should revert");
    }

    function innerAttackSim(address test) external {
        // Because we revert, this trasfer be as if it never happened
        payable(test).transfer(address(this).balance);

        // Because we revert, testNumber will be unchanged
        testNumber = 0xbad;

        // Revert
        require(false, "Nope");
    }
}

Expected behavior The revert internal transfer will not display, and the internal transaction will display the error.

Screenshots If applicable, add screenshots to help explain your problem. https://beaconcha.in/tx/f7d385f000250c073dfef9a36327c5d30a4c77a0c50588ce3eded29f6829a4cd#overview

image image

It not display error as it the normal transfer.

Desktop (please complete the following information):

Phone (please complete the following information):

Additional context Add any other context about the problem here.

yxsec commented 3 weeks ago

Here are the correct display https://eth.blockscout.com/tx/0xf7d385f000250c073dfef9a36327c5d30a4c77a0c50588ce3eded29f6829a4cd?tab=internal https://etherscan.io/tx/0xf7d385f000250c073dfef9a36327c5d30a4c77a0c50588ce3eded29f6829a4cd#internal Not display in the token transfer and label the error in the internal transactions.