ETH Price: $1,974.06 (-0.07%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
0x60806040245080782026-02-21 21:58:1114 hrs ago1771711091  Contract Creation0 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MultiSendUnwrapper

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 100 runs

Other Settings:
shanghai EvmVersion
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.17 <0.9.0;

import "./Types.sol";

contract MultiSendUnwrapper is ITransactionUnwrapper {
    uint256 private constant OFFSET_START = 68;

    error UnsupportedMode();
    error MalformedHeader();
    error MalformedBody();

    function unwrap(
        address,
        uint256 value,
        bytes calldata data,
        Operation operation
    ) external pure returns (UnwrappedTransaction[] memory) {
        if (value != 0) {
            revert UnsupportedMode();
        }
        if (operation != Operation.DelegateCall) {
            revert UnsupportedMode();
        }
        _validateHeader(data);
        uint256 count = _validateEntries(data);
        return _unwrapEntries(data, count);
    }

    function _validateHeader(bytes calldata data) private pure {
        // first 4 bytes are the selector for multiSend(bytes)
        if (bytes4(data) != IMultiSend.multiSend.selector) {
            revert MalformedHeader();
        }

        // the following 32 bytes are the offset to the bytes param
        // (always 0x20)
        if (bytes32(data[4:]) != bytes32(uint256(0x20))) {
            revert MalformedHeader();
        }

        // the following 32 bytes are the length of the bytes param
        uint256 length = uint256(bytes32(data[36:]));

        // validate that the total calldata length matches
        // it's the 4 + 32 + 32 bytes checked above + the <length> bytes
        // padded to a multiple of 32
        if (4 + _ceil32(32 + 32 + length) != data.length) {
            revert MalformedHeader();
        }
    }

    function _validateEntries(
        bytes calldata data
    ) private pure returns (uint256 count) {
        uint256 offset = OFFSET_START;
        uint256 end = OFFSET_START + uint256(bytes32(data[36:]));

        for (; offset < end; ) {
            // Per transaction:
            // Operation   1  bytes
            // To          20 bytes
            // Value       32 bytes
            // Length      32 bytes
            // Data        Length bytes
            uint8 operation = uint8(bytes1(data[offset:]));
            if (operation > 1) {
                revert MalformedBody();
            }

            uint256 length = uint256(bytes32(data[offset + 53:]));
            if (offset + 85 + length > end) {
                revert MalformedBody();
            }

            offset += 85 + length;
            count++;
        }

        if (count == 0) {
            revert MalformedBody();
        }
    }

    function _unwrapEntries(
        bytes calldata data,
        uint256 count
    ) private pure returns (UnwrappedTransaction[] memory result) {
        result = new UnwrappedTransaction[](count);

        uint256 offset = OFFSET_START;
        for (uint256 i; i < count; ) {
            result[i].operation = Operation(uint8(bytes1(data[offset:])));
            offset += 1;

            result[i].to = address(bytes20(data[offset:]));
            offset += 20;

            result[i].value = uint256(bytes32(data[offset:]));
            offset += 32;

            uint256 size = uint256(bytes32(data[offset:]));
            offset += 32;

            result[i].dataLocation = offset;
            result[i].dataSize = size;
            offset += size;

            unchecked {
                ++i;
            }
        }
    }

    function _ceil32(uint256 length) private pure returns (uint256) {
        // pad size. Source: http://www.cs.nott.ac.uk/~psarb2/G51MPC/slides/NumberLogic.pdf
        return ((length + 32 - 1) / 32) * 32;
    }
}

File 2 of 3 : Operation.sol
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

enum Operation {
  Call,
  DelegateCall
}

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.17 <0.9.0;

import "@gnosis-guild/zodiac-core/contracts/core/Operation.sol";

interface IMultiSend {
    function multiSend(bytes memory transactions) external payable;
}

struct UnwrappedTransaction {
    Operation operation;
    address to;
    uint256 value;
    // We wanna deal in calldata slices. We return location, let invoker slice
    uint256 dataLocation;
    uint256 dataSize;
}

interface ITransactionUnwrapper {
    function unwrap(
        address to,
        uint256 value,
        bytes calldata data,
        Operation operation
    ) external view returns (UnwrappedTransaction[] memory result);
}

interface ICustomCondition {
    function check(
        address to,
        uint256 value,
        bytes calldata data,
        Operation operation,
        uint256 location,
        uint256 size,
        bytes12 extra
    ) external view returns (bool success, bytes32 reason);
}

Settings
{
  "evmVersion": "shanghai",
  "optimizer": {
    "enabled": true,
    "runs": 100
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"MalformedBody","type":"error"},{"inputs":[],"name":"MalformedHeader","type":"error"},{"inputs":[],"name":"UnsupportedMode","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Operation","name":"operation","type":"uint8"}],"name":"unwrap","outputs":[{"components":[{"internalType":"enum Operation","name":"operation","type":"uint8"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"dataLocation","type":"uint256"},{"internalType":"uint256","name":"dataSize","type":"uint256"}],"internalType":"struct UnwrappedTransaction[]","name":"","type":"tuple[]"}],"stateMutability":"pure","type":"function"}]

608060405234801561000f575f80fd5b506108308061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063c7a7b6351461002d575b5f80fd5b61004061003b36600461052c565b610056565b60405161004d91906105e3565b60405180910390f35b606084156100775760405163ad6e405560e01b815260040160405180910390fd5b600182600181111561008b5761008b6105cf565b146100a95760405163ad6e405560e01b815260040160405180910390fd5b6100b384846100d6565b5f6100be85856101a1565b90506100cb8585836102b8565b979650505050505050565b6346c07f8560e11b6100e88284610677565b6001600160e01b0319161461011057604051631a751fb760e11b815260040160405180910390fd5b602061011f82600481866106a5565b610128916106cc565b1461014657604051631a751fb760e11b815260040160405180910390fd5b5f61015482602481866106a5565b61015d916106cc565b90508161017361016e8360406106fd565b6104e5565b61017e9060046106fd565b1461019c57604051631a751fb760e11b815260040160405180910390fd5b505050565b5f6044816101b284602481886106a5565b6101bb916106cc565b6101c69060446106fd565b90505b80821015610291575f6101de858481896106a5565b6101e791610710565b60f81c9050600181111561020d57604051629ec3f960e31b815260040160405180910390fd5b5f868661021b8660356106fd565b6102269282906106a5565b61022f916106cc565b9050828161023e8660556106fd565b61024891906106fd565b111561026657604051629ec3f960e31b815260040160405180910390fd5b6102718160556106fd565b61027b90856106fd565b9350846102878161073e565b95505050506101c9565b825f036102b057604051629ec3f960e31b815260040160405180910390fd5b505092915050565b60608167ffffffffffffffff8111156102d3576102d3610756565b60405190808252806020026020018201604052801561033b57816020015b6103286040805160a08101909152805f81526020015f6001600160a01b031681526020015f81526020015f81526020015f81525090565b8152602001906001900390816102f15790505b50905060445f5b838110156104dc57610356858381896106a5565b61035f91610710565b60f81c6001811115610373576103736105cf565b8382815181106103855761038561076a565b60200260200101515f019060018111156103a1576103a16105cf565b908160018111156103b4576103b46105cf565b9052506103c26001836106fd565b91506103d0858381896106a5565b6103d99161077e565b60601c8382815181106103ee576103ee61076a565b6020908102919091018101516001600160a01b039092169101526104136014836106fd565b9150610421858381896106a5565b61042a916106cc565b5f1c83828151811061043e5761043e61076a565b6020026020010151604001818152505060208261045b91906106fd565b91505f61046a8684818a6106a5565b610473916106cc565b90506104806020846106fd565b9250828483815181106104955761049561076a565b60200260200101516060018181525050808483815181106104b8576104b861076a565b6020908102919091010151608001526104d181846106fd565b925050600101610342565b50509392505050565b5f602060016104f484836106fd565b6104fe91906107b1565b61050891906107c4565b6105139060206107e3565b92915050565b803560028110610527575f80fd5b919050565b5f805f805f60808688031215610540575f80fd5b85356001600160a01b0381168114610556575f80fd5b945060208601359350604086013567ffffffffffffffff80821115610579575f80fd5b818801915088601f83011261058c575f80fd5b81358181111561059a575f80fd5b8960208285010111156105ab575f80fd5b6020830195508094505050506105c360608701610519565b90509295509295909350565b634e487b7160e01b5f52602160045260245ffd5b602080825282518282018190525f91906040908185019086840185805b8381101561066957825180516002811061062857634e487b7160e01b84526021600452602484fd5b8652808801516001600160a01b0316888701528681015187870152606080820151908701526080908101519086015260a09094019391860191600101610600565b509298975050505050505050565b6001600160e01b031981358181169160048510156102b05760049490940360031b84901b1690921692915050565b5f80858511156106b3575f80fd5b838611156106bf575f80fd5b5050820193919092039150565b80356020831015610513575f19602084900360031b1b1692915050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610513576105136106e9565b6001600160f81b031981358181169160018510156102b05760019490940360031b84901b1690921692915050565b5f6001820161074f5761074f6106e9565b5060010190565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b6bffffffffffffffffffffffff1981358181169160148510156102b05760149490940360031b84901b1690921692915050565b81810381811115610513576105136106e9565b5f826107de57634e487b7160e01b5f52601260045260245ffd5b500490565b8082028115828204841417610513576105136106e956fea264697066735822122039836a916c6e77cf306bccef03cf05dd5cb638d5ac3fd8bde58b82582f3be8bb64736f6c63430008150033

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063c7a7b6351461002d575b5f80fd5b61004061003b36600461052c565b610056565b60405161004d91906105e3565b60405180910390f35b606084156100775760405163ad6e405560e01b815260040160405180910390fd5b600182600181111561008b5761008b6105cf565b146100a95760405163ad6e405560e01b815260040160405180910390fd5b6100b384846100d6565b5f6100be85856101a1565b90506100cb8585836102b8565b979650505050505050565b6346c07f8560e11b6100e88284610677565b6001600160e01b0319161461011057604051631a751fb760e11b815260040160405180910390fd5b602061011f82600481866106a5565b610128916106cc565b1461014657604051631a751fb760e11b815260040160405180910390fd5b5f61015482602481866106a5565b61015d916106cc565b90508161017361016e8360406106fd565b6104e5565b61017e9060046106fd565b1461019c57604051631a751fb760e11b815260040160405180910390fd5b505050565b5f6044816101b284602481886106a5565b6101bb916106cc565b6101c69060446106fd565b90505b80821015610291575f6101de858481896106a5565b6101e791610710565b60f81c9050600181111561020d57604051629ec3f960e31b815260040160405180910390fd5b5f868661021b8660356106fd565b6102269282906106a5565b61022f916106cc565b9050828161023e8660556106fd565b61024891906106fd565b111561026657604051629ec3f960e31b815260040160405180910390fd5b6102718160556106fd565b61027b90856106fd565b9350846102878161073e565b95505050506101c9565b825f036102b057604051629ec3f960e31b815260040160405180910390fd5b505092915050565b60608167ffffffffffffffff8111156102d3576102d3610756565b60405190808252806020026020018201604052801561033b57816020015b6103286040805160a08101909152805f81526020015f6001600160a01b031681526020015f81526020015f81526020015f81525090565b8152602001906001900390816102f15790505b50905060445f5b838110156104dc57610356858381896106a5565b61035f91610710565b60f81c6001811115610373576103736105cf565b8382815181106103855761038561076a565b60200260200101515f019060018111156103a1576103a16105cf565b908160018111156103b4576103b46105cf565b9052506103c26001836106fd565b91506103d0858381896106a5565b6103d99161077e565b60601c8382815181106103ee576103ee61076a565b6020908102919091018101516001600160a01b039092169101526104136014836106fd565b9150610421858381896106a5565b61042a916106cc565b5f1c83828151811061043e5761043e61076a565b6020026020010151604001818152505060208261045b91906106fd565b91505f61046a8684818a6106a5565b610473916106cc565b90506104806020846106fd565b9250828483815181106104955761049561076a565b60200260200101516060018181525050808483815181106104b8576104b861076a565b6020908102919091010151608001526104d181846106fd565b925050600101610342565b50509392505050565b5f602060016104f484836106fd565b6104fe91906107b1565b61050891906107c4565b6105139060206107e3565b92915050565b803560028110610527575f80fd5b919050565b5f805f805f60808688031215610540575f80fd5b85356001600160a01b0381168114610556575f80fd5b945060208601359350604086013567ffffffffffffffff80821115610579575f80fd5b818801915088601f83011261058c575f80fd5b81358181111561059a575f80fd5b8960208285010111156105ab575f80fd5b6020830195508094505050506105c360608701610519565b90509295509295909350565b634e487b7160e01b5f52602160045260245ffd5b602080825282518282018190525f91906040908185019086840185805b8381101561066957825180516002811061062857634e487b7160e01b84526021600452602484fd5b8652808801516001600160a01b0316888701528681015187870152606080820151908701526080908101519086015260a09094019391860191600101610600565b509298975050505050505050565b6001600160e01b031981358181169160048510156102b05760049490940360031b84901b1690921692915050565b5f80858511156106b3575f80fd5b838611156106bf575f80fd5b5050820193919092039150565b80356020831015610513575f19602084900360031b1b1692915050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610513576105136106e9565b6001600160f81b031981358181169160018510156102b05760019490940360031b84901b1690921692915050565b5f6001820161074f5761074f6106e9565b5060010190565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b6bffffffffffffffffffffffff1981358181169160148510156102b05760149490940360031b84901b1690921692915050565b81810381811115610513576105136106e9565b5f826107de57634e487b7160e01b5f52601260045260245ffd5b500490565b8082028115828204841417610513576105136106e956fea264697066735822122039836a916c6e77cf306bccef03cf05dd5cb638d5ac3fd8bde58b82582f3be8bb64736f6c63430008150033

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.