- Contract name:
- MultiSendCallOnly
- Optimization enabled
- false
- Compiler version
- v0.7.6+commit.7338295f
- EVM Version
- default
- Verified at
- 2022-04-16T14:39:06.542721Z
Contract source code
// SPDX-License-Identifier: LGPL-3.0-onlypragma solidity >=0.7.0 <0.9.0;/// @title Multi Send Call Only - Allows to batch multiple transactions into one, but only calls/// @author Stefan George - <stefan@gnosis.io>/// @author Richard Meissner - <richard@gnosis.io>/// @notice The guard logic is not required here as this contract doesn't support nested delegate callscontract MultiSendCallOnly {/// @dev Sends multiple transactions and reverts all if one fails./// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of/// operation has to be uint8(0) in this version (=> 1 byte),/// to as a address (=> 20 bytes),/// value as a uint256 (=> 32 bytes),/// data length as a uint256 (=> 32 bytes),/// data as bytes./// see abi.encodePacked for more information on packed encoding/// @notice The code is for most part the same as the normal MultiSend (to keep compatibility),/// but reverts if a transaction tries to use a delegatecall./// @notice This method is payable as delegatecalls keep the msg.value from the previous call/// If the calling method (e.g. execTransaction) received ETH this would revert otherwisefunction multiSend(bytes memory transactions) public payable {// solhint-disable-next-line no-inline-assemblyassembly {let length := mload(transactions)let i := 0x20for {// Pre block is not used in "while mode"} lt(i, length) {// Post block is not used in "while mode"} {// First byte of the data is the operation.// We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word).// This will also zero out unused data.let operation := shr(0xf8, mload(add(transactions, i)))// We offset the load address by 1 byte (operation byte)// We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data.let to := shr(0x60, mload(add(transactions, add(i, 0x01))))// We offset the load address by 21 byte (operation byte + 20 address bytes)let value := mload(add(transactions, add(i, 0x15)))// We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes)let dataLength := mload(add(transactions, add(i, 0x35)))
Contract ABI
[{"type":"function","stateMutability":"payable","outputs":[],"name":"multiSend","inputs":[{"type":"bytes","name":"transactions","internalType":"bytes"}]}]
Deployed ByteCode
0x60806040526004361061001e5760003560e01c80638d80ff0a14610023575b600080fd5b6100dc6004803603602081101561003957600080fd5b810190808035906020019064010000000081111561005657600080fd5b82018360208201111561006857600080fd5b8035906020019184600183028401116401000000008311171561008a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506100de565b005b805160205b8181101561015f578083015160f81c6001820184015160601c60158301850151603584018601516055850187016000856000811461012857600181146101385761013d565b6000808585888a5af1915061013d565b600080fd5b50600081141561014c57600080fd5b82605501870196505050505050506100e3565b50505056fea264697066735822122035246402746c96964495cae5b36461fd44dfb89f8e6cf6f6b8d60c0aa89f414864736f6c63430007060033