ETH Price: $2,445.23 (+0.61%)

Transaction Decoder

Block:
17592021 at Jun-30-2023 12:14:11 PM +UTC
Transaction Fee:
0.007855062669077481 ETH $19.21
Gas Used:
178,893 Gas / 43.909279117 Gwei

Emitted Events:

98 0xa5d29237a8f14ff25ab9683c38e64671e3bb5cc8.0x6e89d517057028190560dd200cf6bf792842861353d1173761dfa362e1c133f0( 0x6e89d517057028190560dd200cf6bf792842861353d1173761dfa362e1c133f0, 00000000000000000000000094d2d745d837d84214f5395322e398c9f981952d, 000000000000000000000000000000000000000000000000016345785d8a0000, 0000000000000000000000000000000000000000000000000000000000000060, 0000000000000000000000000000000000000000000000000000000000000000 )
99 Forwarder.ForwarderDeposited( from=[Receiver] 0xa9d1e08c7793af67e9d92fe308d5697fb81d3e43, value=100000000000000000, data=0x )

Account State Difference:

  Address   Before After State Difference Code
0x06A04077...CE5F81CCF 0.005738226444700073 Eth0.015625 Eth0.009886773555299927
0x1039A4df...6D8594Fa9 0.000184735120563 Eth0.013279375120563 Eth0.01309464
0x5C893aD7...F901c2fF6
(BingX Dep: 0x5C893aD7EB611dBDfd5fFe6e17034deF901c2fF6)
0.051419049 Eth0.100557259 Eth0.04913821
0x7488DfFe...3321F0f3F 0.003633215980968858 Eth0.040226675980968858 Eth0.03659346
0x7761F741...C21897558 0.001752658464315563 Eth0.006978788464315563 Eth0.00522613
0x7830c87C...31FA86F43
(Coinbase: Deposit)
38.518161972731868387 Eth
Nonce: 822911
38.510306910062790906 Eth
Nonce: 822912
0.007855062669077481
0x9885Dd1F...ACd7A1154 0.007871312318032098 Eth0.086125812318032098 Eth0.0782545
0x998F1AA8...c49dF20Ce 0.004590202966764492 Eth1.047581002966764492 Eth1.0429908
0x9d14AF65...d04e7F781 41.059276665825013398 Eth41.297584365825013398 Eth0.2383077
0xa5D29237...1E3bB5cc8
(BitGo: MultiSig 3)
8.987792649291403693 Eth9.087792649291403693 Eth0.1
0xA9D1e08C...FB81d3E43
(Coinbase 10)
4,066.942025669580782707 Eth4,064.54570806602548278 Eth2.396317603555299927
0xcb793619...484330Da3 0 Eth0.01720715 Eth0.01720715
27.800993764659281793 Eth27.801172657659281793 Eth0.000178893
0xDaeAd09B...C611f1F12 0.000152279678082 Eth0.684952059678082 Eth0.68479978
0xE24B20F4...B9D163c06 0 Eth0.09466306 Eth0.09466306
0xf576D6B9...5A6069e90 0.00305252176600456 Eth0.02920792176600456 Eth0.0261554

Execution Trace

Coinbase 10.1a1da075( )
  • ETH 0.00522613 0x7761f741b059adbb4a468195486d0acc21897558.CALL( )
  • ETH 0.009886773555299927 0x06a040776766c08f5fbead9a84fb7ddce5f81ccf.CALL( )
  • ETH 0.01309464 0x1039a4dfa82a799e0d94443a6f725196d8594fa9.CALL( )
  • ETH 0.01720715 0xcb7936192ba8017092f7757c236ad26484330da3.CALL( )
  • ETH 0.0261554 0xf576d6b99b4f5db6c3374a96dc8ad505a6069e90.CALL( )
  • ETH 0.03659346 0x7488dffe44ad1b15b5cc16ba9ab38fb3321f0f3f.CALL( )
  • ETH 0.04913821 BingX Dep: 0x5C893aD7EB611dBDfd5fFe6e17034deF901c2fF6.CALL( )
  • ETH 0.0782545 0x9885dd1f6fc3a1d7deb3a2a71b20ed4acd7a1154.CALL( )
  • ETH 0.09466306 0xe24b20f422ff73d46daa30f59d2047eb9d163c06.CALL( )
  • ETH 0.1 Forwarder.CALL( )
    • ETH 0.1 Forwarder.DELEGATECALL( )
      • ETH 0.1 BitGo: MultiSig 3.CALL( )
      • ETH 0.2383077 0x9d14af651f24da7909ae0881c09a65fd04e7f781.CALL( )
      • ETH 0.68479978 0xdaead09bc7d7e461e7ea7b31b8aeb8dc611f1f12.CALL( )
      • ETH 1.0429908 0x998f1aa8c98508b76794623fa1be01cc49df20ce.CALL( )
        File 1 of 2: Forwarder
        pragma solidity 0.7.5;
        
        /*
            The MIT License (MIT)
            Copyright (c) 2018 Murray Software, LLC.
            Permission is hereby granted, free of charge, to any person obtaining
            a copy of this software and associated documentation files (the
            "Software"), to deal in the Software without restriction, including
            without limitation the rights to use, copy, modify, merge, publish,
            distribute, sublicense, and/or sell copies of the Software, and to
            permit persons to whom the Software is furnished to do so, subject to
            the following conditions:
            The above copyright notice and this permission notice shall be included
            in all copies or substantial portions of the Software.
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
            OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
            IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
            CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
            TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
            SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        */
        //solhint-disable max-line-length
        //solhint-disable no-inline-assembly
        
        contract CloneFactory {
          function createClone(address target, bytes32 salt)
            internal
            returns (address payable result)
          {
            bytes20 targetBytes = bytes20(target);
            assembly {
              // load the next free memory slot as a place to store the clone contract data
              let clone := mload(0x40)
        
              // The bytecode block below is responsible for contract initialization
              // during deployment, it is worth noting the proxied contract constructor will not be called during
              // the cloning procedure and that is why an initialization function needs to be called after the
              // clone is created
              mstore(
                clone,
                0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
              )
        
              // This stores the address location of the implementation contract
              // so that the proxy knows where to delegate call logic to
              mstore(add(clone, 0x14), targetBytes)
        
              // The bytecode block is the actual code that is deployed for each clone created.
              // It forwards all calls to the already deployed implementation via a delegatecall
              mstore(
                add(clone, 0x28),
                0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
              )
        
              // deploy the contract using the CREATE2 opcode
              // this deploys the minimal proxy defined above, which will proxy all
              // calls to use the logic defined in the implementation contract `target`
              result := create2(0, clone, 0x37, salt)
            }
          }
        
          function isClone(address target, address query)
            internal
            view
            returns (bool result)
          {
            bytes20 targetBytes = bytes20(target);
            assembly {
              // load the next free memory slot as a place to store the comparison clone
              let clone := mload(0x40)
        
              // The next three lines store the expected bytecode for a miniml proxy
              // that targets `target` as its implementation contract
              mstore(
                clone,
                0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
              )
              mstore(add(clone, 0xa), targetBytes)
              mstore(
                add(clone, 0x1e),
                0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
              )
        
              // the next two lines store the bytecode of the contract that we are checking in memory
              let other := add(clone, 0x40)
              extcodecopy(query, other, 0, 0x2d)
        
              // Check if the expected bytecode equals the actual bytecode and return the result
              result := and(
                eq(mload(clone), mload(other)),
                eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
              )
            }
          }
        }
        
        
        /**
         * Contract that exposes the needed erc20 token functions
         */
        
        abstract contract ERC20Interface {
          // Send _value amount of tokens to address _to
          function transfer(address _to, uint256 _value)
            public
            virtual
            returns (bool success);
        
          // Get the account balance of another account with address _owner
          function balanceOf(address _owner)
            public
            virtual
            view
            returns (uint256 balance);
        }
        
        // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
        library TransferHelper {
            function safeApprove(
                address token,
                address to,
                uint256 value
            ) internal {
                // bytes4(keccak256(bytes('approve(address,uint256)')));
                (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
                require(
                    success && (data.length == 0 || abi.decode(data, (bool))),
                    'TransferHelper::safeApprove: approve failed'
                );
            }
        
            function safeTransfer(
                address token,
                address to,
                uint256 value
            ) internal {
                // bytes4(keccak256(bytes('transfer(address,uint256)')));
                (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
                require(
                    success && (data.length == 0 || abi.decode(data, (bool))),
                    'TransferHelper::safeTransfer: transfer failed'
                );
            }
        
            function safeTransferFrom(
                address token,
                address from,
                address to,
                uint256 value
            ) internal {
                // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
                (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
                require(
                    success && (data.length == 0 || abi.decode(data, (bool))),
                    'TransferHelper::transferFrom: transferFrom failed'
                );
            }
        
            function safeTransferETH(address to, uint256 value) internal {
                (bool success, ) = to.call{value: value}(new bytes(0));
                require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
            }
        }
        
        
        /**
         * Contract that will forward any incoming Ether to the creator of the contract
         *
         */
        contract Forwarder {
          // Address to which any funds sent to this contract will be forwarded
          address public parentAddress;
          event ForwarderDeposited(address from, uint256 value, bytes data);
        
          /**
           * Initialize the contract, and sets the destination address to that of the creator
           */
          function init(address _parentAddress) external onlyUninitialized {
            parentAddress = _parentAddress;
            uint256 value = address(this).balance;
        
            if (value == 0) {
              return;
            }
        
            (bool success, ) = parentAddress.call{ value: value }('');
            require(success, 'Flush failed');
            // NOTE: since we are forwarding on initialization,
            // we don't have the context of the original sender.
            // We still emit an event about the forwarding but set
            // the sender to the forwarder itself
            emit ForwarderDeposited(address(this), value, msg.data);
          }
        
          /**
           * Modifier that will execute internal code block only if the sender is the parent address
           */
          modifier onlyParent {
            require(msg.sender == parentAddress, 'Only Parent');
            _;
          }
        
          /**
           * Modifier that will execute internal code block only if the contract has not been initialized yet
           */
          modifier onlyUninitialized {
            require(parentAddress == address(0x0), 'Already initialized');
            _;
          }
        
          /**
           * Default function; Gets called when data is sent but does not match any other function
           */
          fallback() external payable {
            flush();
          }
        
          /**
           * Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
           */
          receive() external payable {
            flush();
          }
        
          /**
           * Execute a token transfer of the full balance from the forwarder token to the parent address
           * @param tokenContractAddress the address of the erc20 token contract
           */
          function flushTokens(address tokenContractAddress) external onlyParent {
            ERC20Interface instance = ERC20Interface(tokenContractAddress);
            address forwarderAddress = address(this);
            uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
            if (forwarderBalance == 0) {
              return;
            }
        
            TransferHelper.safeTransfer(
              tokenContractAddress,
              parentAddress,
              forwarderBalance
            );
          }
        
          /**
           * Flush the entire balance of the contract to the parent address.
           */
          function flush() public {
            uint256 value = address(this).balance;
        
            if (value == 0) {
              return;
            }
        
            (bool success, ) = parentAddress.call{ value: value }('');
            require(success, 'Flush failed');
            emit ForwarderDeposited(msg.sender, value, msg.data);
          }
        }
        
        contract ForwarderFactory is CloneFactory {
          address public implementationAddress;
        
          event ForwarderCreated(address newForwarderAddress, address parentAddress);
        
          constructor(address _implementationAddress) {
            implementationAddress = _implementationAddress;
          }
        
          function createForwarder(address parent, bytes32 salt) external {
            // include the signers in the salt so any contract deployed to a given address must have the same signers
            bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
        
            address payable clone = createClone(implementationAddress, finalSalt);
            Forwarder(clone).init(parent);
            emit ForwarderCreated(clone, parent);
          }
        }

        File 2 of 2: Forwarder
        pragma solidity 0.7.5;
        
        /*
            The MIT License (MIT)
            Copyright (c) 2018 Murray Software, LLC.
            Permission is hereby granted, free of charge, to any person obtaining
            a copy of this software and associated documentation files (the
            "Software"), to deal in the Software without restriction, including
            without limitation the rights to use, copy, modify, merge, publish,
            distribute, sublicense, and/or sell copies of the Software, and to
            permit persons to whom the Software is furnished to do so, subject to
            the following conditions:
            The above copyright notice and this permission notice shall be included
            in all copies or substantial portions of the Software.
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
            OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
            IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
            CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
            TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
            SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        */
        //solhint-disable max-line-length
        //solhint-disable no-inline-assembly
        
        contract CloneFactory {
          function createClone(address target, bytes32 salt)
            internal
            returns (address payable result)
          {
            bytes20 targetBytes = bytes20(target);
            assembly {
              // load the next free memory slot as a place to store the clone contract data
              let clone := mload(0x40)
        
              // The bytecode block below is responsible for contract initialization
              // during deployment, it is worth noting the proxied contract constructor will not be called during
              // the cloning procedure and that is why an initialization function needs to be called after the
              // clone is created
              mstore(
                clone,
                0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
              )
        
              // This stores the address location of the implementation contract
              // so that the proxy knows where to delegate call logic to
              mstore(add(clone, 0x14), targetBytes)
        
              // The bytecode block is the actual code that is deployed for each clone created.
              // It forwards all calls to the already deployed implementation via a delegatecall
              mstore(
                add(clone, 0x28),
                0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
              )
        
              // deploy the contract using the CREATE2 opcode
              // this deploys the minimal proxy defined above, which will proxy all
              // calls to use the logic defined in the implementation contract `target`
              result := create2(0, clone, 0x37, salt)
            }
          }
        
          function isClone(address target, address query)
            internal
            view
            returns (bool result)
          {
            bytes20 targetBytes = bytes20(target);
            assembly {
              // load the next free memory slot as a place to store the comparison clone
              let clone := mload(0x40)
        
              // The next three lines store the expected bytecode for a miniml proxy
              // that targets `target` as its implementation contract
              mstore(
                clone,
                0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
              )
              mstore(add(clone, 0xa), targetBytes)
              mstore(
                add(clone, 0x1e),
                0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
              )
        
              // the next two lines store the bytecode of the contract that we are checking in memory
              let other := add(clone, 0x40)
              extcodecopy(query, other, 0, 0x2d)
        
              // Check if the expected bytecode equals the actual bytecode and return the result
              result := and(
                eq(mload(clone), mload(other)),
                eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
              )
            }
          }
        }
        
        
        /**
         * Contract that exposes the needed erc20 token functions
         */
        
        abstract contract ERC20Interface {
          // Send _value amount of tokens to address _to
          function transfer(address _to, uint256 _value)
            public
            virtual
            returns (bool success);
        
          // Get the account balance of another account with address _owner
          function balanceOf(address _owner)
            public
            virtual
            view
            returns (uint256 balance);
        }
        
        // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
        library TransferHelper {
            function safeApprove(
                address token,
                address to,
                uint256 value
            ) internal {
                // bytes4(keccak256(bytes('approve(address,uint256)')));
                (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
                require(
                    success && (data.length == 0 || abi.decode(data, (bool))),
                    'TransferHelper::safeApprove: approve failed'
                );
            }
        
            function safeTransfer(
                address token,
                address to,
                uint256 value
            ) internal {
                // bytes4(keccak256(bytes('transfer(address,uint256)')));
                (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
                require(
                    success && (data.length == 0 || abi.decode(data, (bool))),
                    'TransferHelper::safeTransfer: transfer failed'
                );
            }
        
            function safeTransferFrom(
                address token,
                address from,
                address to,
                uint256 value
            ) internal {
                // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
                (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
                require(
                    success && (data.length == 0 || abi.decode(data, (bool))),
                    'TransferHelper::transferFrom: transferFrom failed'
                );
            }
        
            function safeTransferETH(address to, uint256 value) internal {
                (bool success, ) = to.call{value: value}(new bytes(0));
                require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
            }
        }
        
        
        /**
         * Contract that will forward any incoming Ether to the creator of the contract
         *
         */
        contract Forwarder {
          // Address to which any funds sent to this contract will be forwarded
          address public parentAddress;
          event ForwarderDeposited(address from, uint256 value, bytes data);
        
          /**
           * Initialize the contract, and sets the destination address to that of the creator
           */
          function init(address _parentAddress) external onlyUninitialized {
            parentAddress = _parentAddress;
            uint256 value = address(this).balance;
        
            if (value == 0) {
              return;
            }
        
            (bool success, ) = parentAddress.call{ value: value }('');
            require(success, 'Flush failed');
            // NOTE: since we are forwarding on initialization,
            // we don't have the context of the original sender.
            // We still emit an event about the forwarding but set
            // the sender to the forwarder itself
            emit ForwarderDeposited(address(this), value, msg.data);
          }
        
          /**
           * Modifier that will execute internal code block only if the sender is the parent address
           */
          modifier onlyParent {
            require(msg.sender == parentAddress, 'Only Parent');
            _;
          }
        
          /**
           * Modifier that will execute internal code block only if the contract has not been initialized yet
           */
          modifier onlyUninitialized {
            require(parentAddress == address(0x0), 'Already initialized');
            _;
          }
        
          /**
           * Default function; Gets called when data is sent but does not match any other function
           */
          fallback() external payable {
            flush();
          }
        
          /**
           * Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
           */
          receive() external payable {
            flush();
          }
        
          /**
           * Execute a token transfer of the full balance from the forwarder token to the parent address
           * @param tokenContractAddress the address of the erc20 token contract
           */
          function flushTokens(address tokenContractAddress) external onlyParent {
            ERC20Interface instance = ERC20Interface(tokenContractAddress);
            address forwarderAddress = address(this);
            uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
            if (forwarderBalance == 0) {
              return;
            }
        
            TransferHelper.safeTransfer(
              tokenContractAddress,
              parentAddress,
              forwarderBalance
            );
          }
        
          /**
           * Flush the entire balance of the contract to the parent address.
           */
          function flush() public {
            uint256 value = address(this).balance;
        
            if (value == 0) {
              return;
            }
        
            (bool success, ) = parentAddress.call{ value: value }('');
            require(success, 'Flush failed');
            emit ForwarderDeposited(msg.sender, value, msg.data);
          }
        }
        
        contract ForwarderFactory is CloneFactory {
          address public implementationAddress;
        
          event ForwarderCreated(address newForwarderAddress, address parentAddress);
        
          constructor(address _implementationAddress) {
            implementationAddress = _implementationAddress;
          }
        
          function createForwarder(address parent, bytes32 salt) external {
            // include the signers in the salt so any contract deployed to a given address must have the same signers
            bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
        
            address payable clone = createClone(implementationAddress, finalSalt);
            Forwarder(clone).init(parent);
            emit ForwarderCreated(clone, parent);
          }
        }