Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
MultiSender
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * Token Toolbox: Multi Sender/Airdrop tokens distributor * https://tokentoolbox.app */ contract MultiSender { address public immutable treasury; error InvalidTokenError(); error InvalidParamsError(); error TransferError(); constructor(address treasury_) { treasury = treasury_; } /** * @dev Send the same amount of tokens or ETH to a list of addresses */ function transferSingle(address token, uint256 amount, address[] calldata addresses) external payable { if (token == address(0)) { for (uint256 i = 0; i < addresses.length; i++) payable(addresses[i]).transfer(amount); } else { if (token.code.length == 0) revert InvalidTokenError(); // must be a contract for (uint256 i = 0; i < addresses.length; i++) _sendTokens(token, addresses[i], amount); } _sendFees(); } /** * @dev Send tokens or ETH to a list of addresses */ function transfer(address token, address[] calldata addresses, uint256[] calldata amounts) external payable { if (addresses.length != amounts.length) revert InvalidParamsError(); if (token == address(0)) { for (uint256 i = 0; i < addresses.length; i++) payable(addresses[i]).transfer(amounts[i]); } else { if (token.code.length == 0) revert InvalidTokenError(); // must be a contract for (uint256 i = 0; i < addresses.length; i++) _sendTokens(token, addresses[i], amounts[i]); } _sendFees(); } /** * @dev Recover tokens or ETH */ function recover(address token, uint256 amount) external { if (amount == 0) revert InvalidParamsError(); if (token == address(0)) { payable(treasury).transfer(amount); } else { (bool success, ) = token.call(abi.encodeCall(IERC20.transfer, (treasury, amount))); if (!success) revert TransferError(); } } function _sendTokens(address token, address to, uint256 amount) private { (bool success, ) = token.call(abi.encodeCall(IERC20.transferFrom, (msg.sender, to, amount))); if (!success) revert TransferError(); } function _sendFees() private { uint256 balance = address(this).balance; if (treasury != address(0) && balance > 0) { payable(treasury).transfer(balance); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
{ "evmVersion": "cancun", "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"treasury_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidParamsError","type":"error"},{"inputs":[],"name":"InvalidTokenError","type":"error"},{"inputs":[],"name":"TransferError","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"transfer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"transferSingle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a0604052348015600e575f80fd5b50604051610856380380610856833981016040819052602b91603b565b6001600160a01b03166080526066565b5f60208284031215604a575f80fd5b81516001600160a01b0381168114605f575f80fd5b9392505050565b6080516107bd6100995f395f81816087015281816102130152818161026b0152818161054c015261059301526107bd5ff3fe60806040526004361061003e575f3560e01c806327e61662146100425780635705ae431461005757806361d027b31461007657806372a503be146100c5575b5f80fd5b61005561005036600461063f565b6100d8565b005b348015610062575f80fd5b50610055610071366004610695565b6101d8565b348015610081575f80fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100556100d33660046106bd565b61033a565b6001600160a01b03841661015b575f5b81811015610155578282828181106101025761010261073d565b90506020020160208101906101179190610751565b6001600160a01b03166108fc8590811502906040515f60405180830381858888f1935050505015801561014c573d5f803e3d5ffd5b506001016100e8565b506101ca565b836001600160a01b03163b5f03610185576040516327c4ba1d60e21b815260040160405180910390fd5b5f5b818110156101c8576101c0858484848181106101a5576101a561073d565b90506020020160208101906101ba9190610751565b8661048b565b600101610187565b505b6101d2610549565b50505050565b805f036101f8576040516354f9d1b760e01b815260040160405180910390fd5b6001600160a01b03821661025e576040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169082156108fc029083905f818181858888f19350505050158015610259573d5f803e3d5ffd5b505050565b6040516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152604482018390525f919084169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516102d69190610771565b5f604051808303815f865af19150503d805f811461030f576040519150601f19603f3d011682016040523d82523d5f602084013e610314565b606091505b5050905080610259576040516313ff771f60e21b815260040160405180910390fd5b5050565b82811461035a576040516354f9d1b760e01b815260040160405180910390fd5b6001600160a01b0385166103f5575f5b838110156103ef578484828181106103845761038461073d565b90506020020160208101906103999190610751565b6001600160a01b03166108fc8484848181106103b7576103b761073d565b9050602002013590811502906040515f60405180830381858888f193505050501580156103e6573d5f803e3d5ffd5b5060010161036a565b5061047c565b846001600160a01b03163b5f0361041f576040516327c4ba1d60e21b815260040160405180910390fd5b5f5b8381101561047a576104728686868481811061043f5761043f61073d565b90506020020160208101906104549190610751565b8585858181106104665761046661073d565b9050602002013561048b565b600101610421565b505b610484610549565b5050505050565b6040513360248201526001600160a01b038381166044830152606482018390525f919085169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516104e99190610771565b5f604051808303815f865af19150503d805f8114610522576040519150601f19603f3d011682016040523d82523d5f602084013e610527565b606091505b50509050806101d2576040516313ff771f60e21b815260040160405180910390fd5b477f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161580159061058157505f81115b156105d9576040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169082156108fc029083905f818181858888f19350505050158015610336573d5f803e3d5ffd5b50565b80356001600160a01b03811681146105f2575f80fd5b919050565b5f8083601f840112610607575f80fd5b50813567ffffffffffffffff81111561061e575f80fd5b6020830191508360208260051b8501011115610638575f80fd5b9250929050565b5f805f8060608587031215610652575f80fd5b61065b856105dc565b935060208501359250604085013567ffffffffffffffff81111561067d575f80fd5b610689878288016105f7565b95989497509550505050565b5f80604083850312156106a6575f80fd5b6106af836105dc565b946020939093013593505050565b5f805f805f606086880312156106d1575f80fd5b6106da866105dc565b9450602086013567ffffffffffffffff8111156106f5575f80fd5b610701888289016105f7565b909550935050604086013567ffffffffffffffff811115610720575f80fd5b61072c888289016105f7565b969995985093965092949392505050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215610761575f80fd5b61076a826105dc565b9392505050565b5f82518060208501845e5f92019182525091905056fea26469706673582212206c1b0daf6beaa65067ab24f1bf389e0961d9dfae0ff9349a35a5ff6d18f262c264736f6c634300081a00330000000000000000000000000048eb3654cefc1e149d9e08af6a81f61de7bc41
Deployed Bytecode
0x60806040526004361061003e575f3560e01c806327e61662146100425780635705ae431461005757806361d027b31461007657806372a503be146100c5575b5f80fd5b61005561005036600461063f565b6100d8565b005b348015610062575f80fd5b50610055610071366004610695565b6101d8565b348015610081575f80fd5b506100a97f0000000000000000000000000048eb3654cefc1e149d9e08af6a81f61de7bc4181565b6040516001600160a01b03909116815260200160405180910390f35b6100556100d33660046106bd565b61033a565b6001600160a01b03841661015b575f5b81811015610155578282828181106101025761010261073d565b90506020020160208101906101179190610751565b6001600160a01b03166108fc8590811502906040515f60405180830381858888f1935050505015801561014c573d5f803e3d5ffd5b506001016100e8565b506101ca565b836001600160a01b03163b5f03610185576040516327c4ba1d60e21b815260040160405180910390fd5b5f5b818110156101c8576101c0858484848181106101a5576101a561073d565b90506020020160208101906101ba9190610751565b8661048b565b600101610187565b505b6101d2610549565b50505050565b805f036101f8576040516354f9d1b760e01b815260040160405180910390fd5b6001600160a01b03821661025e576040516001600160a01b037f0000000000000000000000000048eb3654cefc1e149d9e08af6a81f61de7bc41169082156108fc029083905f818181858888f19350505050158015610259573d5f803e3d5ffd5b505050565b6040516001600160a01b037f0000000000000000000000000048eb3654cefc1e149d9e08af6a81f61de7bc4181166024830152604482018390525f919084169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516102d69190610771565b5f604051808303815f865af19150503d805f811461030f576040519150601f19603f3d011682016040523d82523d5f602084013e610314565b606091505b5050905080610259576040516313ff771f60e21b815260040160405180910390fd5b5050565b82811461035a576040516354f9d1b760e01b815260040160405180910390fd5b6001600160a01b0385166103f5575f5b838110156103ef578484828181106103845761038461073d565b90506020020160208101906103999190610751565b6001600160a01b03166108fc8484848181106103b7576103b761073d565b9050602002013590811502906040515f60405180830381858888f193505050501580156103e6573d5f803e3d5ffd5b5060010161036a565b5061047c565b846001600160a01b03163b5f0361041f576040516327c4ba1d60e21b815260040160405180910390fd5b5f5b8381101561047a576104728686868481811061043f5761043f61073d565b90506020020160208101906104549190610751565b8585858181106104665761046661073d565b9050602002013561048b565b600101610421565b505b610484610549565b5050505050565b6040513360248201526001600160a01b038381166044830152606482018390525f919085169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516104e99190610771565b5f604051808303815f865af19150503d805f8114610522576040519150601f19603f3d011682016040523d82523d5f602084013e610527565b606091505b50509050806101d2576040516313ff771f60e21b815260040160405180910390fd5b477f0000000000000000000000000048eb3654cefc1e149d9e08af6a81f61de7bc416001600160a01b03161580159061058157505f81115b156105d9576040516001600160a01b037f0000000000000000000000000048eb3654cefc1e149d9e08af6a81f61de7bc41169082156108fc029083905f818181858888f19350505050158015610336573d5f803e3d5ffd5b50565b80356001600160a01b03811681146105f2575f80fd5b919050565b5f8083601f840112610607575f80fd5b50813567ffffffffffffffff81111561061e575f80fd5b6020830191508360208260051b8501011115610638575f80fd5b9250929050565b5f805f8060608587031215610652575f80fd5b61065b856105dc565b935060208501359250604085013567ffffffffffffffff81111561067d575f80fd5b610689878288016105f7565b95989497509550505050565b5f80604083850312156106a6575f80fd5b6106af836105dc565b946020939093013593505050565b5f805f805f606086880312156106d1575f80fd5b6106da866105dc565b9450602086013567ffffffffffffffff8111156106f5575f80fd5b610701888289016105f7565b909550935050604086013567ffffffffffffffff811115610720575f80fd5b61072c888289016105f7565b969995985093965092949392505050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215610761575f80fd5b61076a826105dc565b9392505050565b5f82518060208501845e5f92019182525091905056fea26469706673582212206c1b0daf6beaa65067ab24f1bf389e0961d9dfae0ff9349a35a5ff6d18f262c264736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000048eb3654cefc1e149d9e08af6a81f61de7bc41
-----Decoded View---------------
Arg [0] : treasury_ (address): 0x0048eb3654cefc1E149D9e08AF6a81f61De7bC41
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000048eb3654cefc1e149d9e08af6a81f61de7bc41
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.