Contract 0x669AdB1B0D5D7a2e244CE7091c220C17a6429E44

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x040742e34105fc183f93ce3c8ab9658873f8df50aacb9e3ad84d37e34456305fSet Gov284455702022-10-05 6:19:07178 days 13 hrs agoMycelium: Deployer IN  0x669adb1b0d5d7a2e244ce7091c220c17a6429e440 ETH0.00000742 0.1
0xe080235b1cf20fd5e4aab1a19f608f3ba81f7f0be028ca81350fc4f33184787a0x60806040202130582022-08-14 8:19:02230 days 11 hrs agoMycelium: Deployer IN  Create: BatchSender0 ETH0.000633768948 ETH0.090703826
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BatchSender

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 1 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Arbiscan on 2022-10-05
*/

// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @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 Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

contract Governable {
    address public gov;

    constructor() public {
        gov = msg.sender;
    }

    modifier onlyGov() {
        require(msg.sender == gov, "Governable: forbidden");
        _;
    }

    function setGov(address _gov) external onlyGov {
        gov = _gov;
    }
}

contract BatchSender is Governable {
    using SafeMath for uint256;

    mapping(address => bool) public isHandler;

    event BatchSend(uint256 indexed typeId, address indexed token, address[] accounts, uint256[] amounts);

    modifier onlyHandler() {
        require(isHandler[msg.sender], "BatchSender: forbidden");
        _;
    }

    constructor() public {
        isHandler[msg.sender] = true;
    }

    function setHandler(address _handler, bool _isActive) external onlyGov {
        isHandler[_handler] = _isActive;
    }

    function send(
        IERC20 _token,
        address[] memory _accounts,
        uint256[] memory _amounts
    ) public onlyHandler {
        _send(_token, _accounts, _amounts, 0);
    }

    function sendAndEmit(
        IERC20 _token,
        address[] memory _accounts,
        uint256[] memory _amounts,
        uint256 _typeId
    ) public onlyHandler {
        _send(_token, _accounts, _amounts, _typeId);
    }

    function _send(
        IERC20 _token,
        address[] memory _accounts,
        uint256[] memory _amounts,
        uint256 _typeId
    ) private {
        for (uint256 i = 0; i < _accounts.length; i++) {
            address account = _accounts[i];
            uint256 amount = _amounts[i];
            _token.transferFrom(msg.sender, account, amount);
        }

        emit BatchSend(_typeId, address(_token), _accounts, _amounts);
    }
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"typeId","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address[]","name":"accounts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"BatchSend","type":"event"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isHandler","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"send","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"uint256","name":"_typeId","type":"uint256"}],"name":"sendAndEmit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_handler","type":"address"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setHandler","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a01b0319163390811782558152600160208190526040909120805460ff191690911790556107518061004d6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806312d43a511461006757806346ea87af1461008b578063745ae40b146100c55780639cb7de4b146101fc578063cfad57a21461022a578063f8129cd214610250575b600080fd5b61006f610383565b604080516001600160a01b039092168252519081900360200190f35b6100b1600480360360208110156100a157600080fd5b50356001600160a01b0316610392565b604080519115158252519081900360200190f35b6101fa600480360360808110156100db57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561010557600080fd5b82018360208201111561011757600080fd5b803590602001918460208302840111600160201b8311171561013857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561018757600080fd5b82018360208201111561019957600080fd5b803590602001918460208302840111600160201b831117156101ba57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050913592506103a7915050565b005b6101fa6004803603604081101561021257600080fd5b506001600160a01b0381351690602001351515610416565b6101fa6004803603602081101561024057600080fd5b50356001600160a01b0316610498565b6101fa6004803603606081101561026657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561029057600080fd5b8201836020820111156102a257600080fd5b803590602001918460208302840111600160201b831117156102c357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561031257600080fd5b82018360208201111561032457600080fd5b803590602001918460208302840111600160201b8311171561034557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610511945050505050565b6000546001600160a01b031681565b60016020526000908152604090205460ff1681565b3360009081526001602052604090205460ff16610404576040805162461bcd60e51b81526020600482015260166024820152752130ba31b429b2b73232b91d103337b93134b23232b760511b604482015290519081900360640190fd5b61041084848484610580565b50505050565b6000546001600160a01b0316331461046d576040805162461bcd60e51b815260206004820152601560248201527423b7bb32b93730b136329d103337b93134b23232b760591b604482015290519081900360640190fd5b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146104ef576040805162461bcd60e51b815260206004820152601560248201527423b7bb32b93730b136329d103337b93134b23232b760591b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526001602052604090205460ff1661056e576040805162461bcd60e51b81526020600482015260166024820152752130ba31b429b2b73232b91d103337b93134b23232b760511b604482015290519081900360640190fd5b61057b8383836000610580565b505050565b60005b835181101561064e57600084828151811061059a57fe5b6020026020010151905060008483815181106105b257fe5b602090810291909101810151604080516323b872dd60e01b81523360048201526001600160a01b038681166024830152604482018490529151929450908a16926323b872dd926064808401938290030181600087803b15801561061457600080fd5b505af1158015610628573d6000803e3d6000fd5b505050506040513d602081101561063e57600080fd5b5050600190920191506105839050565b50836001600160a01b0316817fa1552778fd4edc5098fd82f614c100bf0f42c781e7926907643e2894679da0f38585604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156106c15781810151838201526020016106a9565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156107005781810151838201526020016106e8565b5050505090500194505050505060405180910390a35050505056fea2646970667358221220190cd1ef968670901387d45811fb3dd9053a489d914ec9967bf734736f06de7064736f6c634300060c0033

Deployed ByteCode Sourcemap

8521:1459:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8238:18;;;:::i;:::-;;;;-1:-1:-1;;;;;8238:18:0;;;;;;;;;;;;;;8598:41;;;;;;;;;;;;;;;;-1:-1:-1;8598:41:0;-1:-1:-1;;;;;8598:41:0;;:::i;:::-;;;;;;;;;;;;;;;;;;9282:232;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9282:232:0;;;;;;;;;;;;;;;-1:-1:-1;;;9282:232:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;9282:232:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9282:232:0;;;;;;;;-1:-1:-1;9282:232:0;;-1:-1:-1;;;;;9282:232:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;9282:232:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9282:232:0;;-1:-1:-1;;9282:232:0;;;-1:-1:-1;9282:232:0;;-1:-1:-1;;9282:232:0:i;:::-;;8952:121;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;8952:121:0;;;;;;;;;;:::i;8438:76::-;;;;;;;;;;;;;;;;-1:-1:-1;8438:76:0;-1:-1:-1;;;;;8438:76:0;;:::i;9081:193::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9081:193:0;;;;;;;;;;;;;;;-1:-1:-1;;;9081:193:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;9081:193:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9081:193:0;;;;;;;;-1:-1:-1;9081:193:0;;-1:-1:-1;;;;;9081:193:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;9081:193:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9081:193:0;;-1:-1:-1;9081:193:0;;-1:-1:-1;;;;;9081:193:0:i;8238:18::-;;;-1:-1:-1;;;;;8238:18:0;;:::o;8598:41::-;;;;;;;;;;;;;;;:::o;9282:232::-;8810:10;8800:21;;;;:9;:21;;;;;;;;8792:56;;;;;-1:-1:-1;;;8792:56:0;;;;;;;;;;;;-1:-1:-1;;;8792:56:0;;;;;;;;;;;;;;;9463:43:::1;9469:6;9477:9;9488:8;9498:7;9463:5;:43::i;:::-;9282:232:::0;;;;:::o;8952:121::-;8381:3;;-1:-1:-1;;;;;8381:3:0;8367:10;:17;8359:51;;;;;-1:-1:-1;;;8359:51:0;;;;;;;;;;;;-1:-1:-1;;;8359:51:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;9034:19:0;;;::::1;;::::0;;;:9:::1;:19;::::0;;;;:31;;-1:-1:-1;;9034:31:0::1;::::0;::::1;;::::0;;;::::1;::::0;;8952:121::o;8438:76::-;8381:3;;-1:-1:-1;;;;;8381:3:0;8367:10;:17;8359:51;;;;;-1:-1:-1;;;8359:51:0;;;;;;;;;;;;-1:-1:-1;;;8359:51:0;;;;;;;;;;;;;;;8496:3:::1;:10:::0;;-1:-1:-1;;;;;;8496:10:0::1;-1:-1:-1::0;;;;;8496:10:0;;;::::1;::::0;;;::::1;::::0;;8438:76::o;9081:193::-;8810:10;8800:21;;;;:9;:21;;;;;;;;8792:56;;;;;-1:-1:-1;;;8792:56:0;;;;;;;;;;;;-1:-1:-1;;;8792:56:0;;;;;;;;;;;;;;;9229:37:::1;9235:6;9243:9;9254:8;9264:1;9229:5;:37::i;:::-;9081:193:::0;;;:::o;9522:455::-;9691:9;9686:210;9710:9;:16;9706:1;:20;9686:210;;;9748:15;9766:9;9776:1;9766:12;;;;;;;;;;;;;;9748:30;;9793:14;9810:8;9819:1;9810:11;;;;;;;;;;;;;;;;;;;9836:48;;;-1:-1:-1;;;9836:48:0;;9856:10;9836:48;;;;-1:-1:-1;;;;;9836:48:0;;;;;;;;;;;;;;;9810:11;;-1:-1:-1;9836:19:0;;;;;;:48;;;;;;;;;;-1:-1:-1;9836:19:0;:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;9728:3:0;;;;;-1:-1:-1;9686:210:0;;-1:-1:-1;9686:210:0;;;9940:6;-1:-1:-1;;;;;9913:56:0;9923:7;9913:56;9949:9;9960:8;9913:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9522:455;;;;:::o

Metadata Hash

190cd1ef968670901387d45811fb3dd9053a489d914ec9967bf734736f06de70
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.