Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x234b1756c9D5EefbFbdaD1d117d733AeB0b8Ac54
Balance 0.002959 ETH
Nonce 1
Code Size 9454 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

9454 bytes
0x608060405260043610610073575f3560e01c80637c53e2f71161004d5780637c53e2f71461013a57806389476069146101505780638da5cb5b14610178578063f2fde38b146101a2576100c8565b80631fc86486146100cc57806363549a71146100e8578063715018a614610124576100c8565b366100c8573373ffffffffffffffffffffffffffffffffffffffff167f4103257eaac983ca79a70d28f90dfc4fa16b619bb0c17ee7cab0d4034c279624346040516100be919061172d565b60405180910390a2005b5f80fd5b6100e660048036038101906100e19190611859565b6101ca565b005b3480156100f3575f80fd5b5061010e6004803603810190610109919061193d565b610909565b60405161011b9190611c13565b60405180910390f35b34801561012f575f80fd5b50610138610c25565b005b348015610145575f80fd5b5061014e610c38565b005b34801561015b575f80fd5b5061017660048036038101906101719190611c5d565b610d29565b005b348015610183575f80fd5b5061018c610e3c565b6040516101999190611c97565b60405180910390f35b3480156101ad575f80fd5b506101c860048036038101906101c39190611c5d565b610e63565b005b6101d2610ee7565b6101da610f6e565b5f8888905090505f8111610223576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021a90611d0a565b60405180910390fd5b5f80888890501190505f8087879050118061024057505f85859050115b905081156102925782898990501461028d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028490611d72565b60405180910390fd5b6102d8565b5f89899050146102d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ce90611dda565b60405180910390fd5b5b80156103365782878790501480156102f257508285859050145b610331576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032890611e42565b60405180910390fd5b61038a565b5f8787905014801561034a57505f85859050145b610389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038090611eaa565b60405180910390fd5b5b8115610421575f6103da8a8a808060200260200160405190810160405280939291908181526020018383602002808284375f81840152601f19601f82011690508083019250505050505050610fbd565b90508047101561041f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041690611f12565b60405180910390fd5b505b80156104b2576104b18787808060200260200160405190810160405280939291908181526020018383602002808284375f81840152601f19601f820116905080830192505050505050508686808060200260200160405190810160405280939291908181526020018383602002808284375f81840152601f19601f8201169050808301925050505050505061100d565b5b5f5b838110156108f3575f73ffffffffffffffffffffffffffffffffffffffff168c8c838181106104e6576104e5611f30565b5b90506020020160208101906104fb9190611f98565b73ffffffffffffffffffffffffffffffffffffffff1603610551576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105489061200d565b60405180910390fd5b811561074b575f73ffffffffffffffffffffffffffffffffffffffff1688888381811061058157610580611f30565b5b90506020020160208101906105969190611c5d565b73ffffffffffffffffffffffffffffffffffffffff16036105ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e390612075565b60405180910390fd5b61067e8c8c8381811061060257610601611f30565b5b90506020020160208101906106179190611f98565b87878481811061062a57610629611f30565b5b905060200201358a8a8581811061064457610643611f30565b5b90506020020160208101906106599190611c5d565b73ffffffffffffffffffffffffffffffffffffffff166113159092919063ffffffff16565b8b8b8281811061069157610690611f30565b5b90506020020160208101906106a69190611f98565b73ffffffffffffffffffffffffffffffffffffffff168888838181106106cf576106ce611f30565b5b90506020020160208101906106e49190611c5d565b73ffffffffffffffffffffffffffffffffffffffff167fa89d4ee4a40862954252a2abcadc45fde209893c215b143c0b3c8f23a1ac3b5588888581811061072e5761072d611f30565b5b90506020020135604051610742919061172d565b60405180910390a35b82156108e0575f8c8c8381811061076557610764611f30565b5b905060200201602081019061077a9190611f98565b73ffffffffffffffffffffffffffffffffffffffff168b8b848181106107a3576107a2611f30565b5b905060200201356040516107b6906120c0565b5f6040518083038185875af1925050503d805f81146107f0576040519150601f19603f3d011682016040523d82523d5f602084013e6107f5565b606091505b5050905080610839576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108309061211e565b60405180910390fd5b8c8c8381811061084c5761084b611f30565b5b90506020020160208101906108619190611f98565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd562aa20e3361ff6253ee67d3afe486e3c92cb3273cb1e684b48da6aa07674df8d8d868181106108c2576108c1611f30565b5b905060200201356040516108d6919061172d565b60405180910390a3505b80806108eb90612169565b9150506104b4565b505050506108ff611394565b5050505050505050565b6060610913610ee7565b5f8585905067ffffffffffffffff811115610931576109306121b0565b5b60405190808252806020026020018201604052801561096a57816020015b6109576116aa565b81526020019060019003908161094f5790505b5090505f5b86869050811015610c18575f8585905067ffffffffffffffff811115610998576109976121b0565b5b6040519080825280602002602001820160405280156109d157816020015b6109be6116e7565b8152602001906001900390816109b65790505b5090505f5b86869050811015610b07575f8787838181106109f5576109f4611f30565b5b9050602002016020810190610a0a9190611c5d565b905060405180604001604052808273ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff166370a082318d8d89818110610a6257610a61611f30565b5b9050602002016020810190610a779190611c5d565b6040518263ffffffff1660e01b8152600401610a939190611c97565b602060405180830381865afa158015610aae573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ad29190612207565b815250838381518110610ae857610ae7611f30565b5b6020026020010181905250508080610aff90612169565b9150506109d6565b506040518060800160405280898985818110610b2657610b25611f30565b5b9050602002016020810190610b3b9190611c5d565b73ffffffffffffffffffffffffffffffffffffffff168152602001898985818110610b6957610b68611f30565b5b9050602002016020810190610b7e9190611c5d565b73ffffffffffffffffffffffffffffffffffffffff163181526020015f8a8a86818110610bae57610bad611f30565b5b9050602002016020810190610bc39190611c5d565b73ffffffffffffffffffffffffffffffffffffffff163b111515815260200182815250838381518110610bf957610bf8611f30565b5b6020026020010181905250508080610c1090612169565b91505061096f565b5080915050949350505050565b610c2d610ee7565b610c365f61139d565b565b610c40610ee7565b5f4790505f8111610c86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7d9061227c565b60405180910390fd5b610c8e610e3c565b73ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015610cd0573d5f803e3d5ffd5b50610cd9610e3c565b73ffffffffffffffffffffffffffffffffffffffff167ffbb7117463cfa4818ce624af2693c7bef4c9fc55abc47ae2566501a595779a6082604051610d1e919061172d565b60405180910390a250565b610d31610ee7565b5f8190505f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d6f9190611c97565b602060405180830381865afa158015610d8a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610dae9190612207565b9050610de2610dbb610e3c565b828473ffffffffffffffffffffffffffffffffffffffff166113159092919063ffffffff16565b610dea610e3c565b73ffffffffffffffffffffffffffffffffffffffff167fc7007e57228f610de89c329174bb69f87ecbecaf8e44c0e45ef6c83c21a8027982604051610e2f919061172d565b60405180910390a2505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e6b610ee7565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610edb575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610ed29190611c97565b60405180910390fd5b610ee48161139d565b50565b610eef61145e565b73ffffffffffffffffffffffffffffffffffffffff16610f0d610e3c565b73ffffffffffffffffffffffffffffffffffffffff1614610f6c57610f3061145e565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610f639190611c97565b60405180910390fd5b565b600260015403610fb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610faa906122e4565b60405180910390fd5b6002600181905550565b5f805f90505b825181101561100757828181518110610fdf57610fde611f30565b5b602002602001015182610ff29190612302565b91508080610fff90612169565b915050610fc3565b50919050565b5f825190505f8167ffffffffffffffff81111561102d5761102c6121b0565b5b60405190808252806020026020018201604052801561105b5781602001602082028036833780820191505090505b5090505f805b838110156111a1575f86828151811061107d5761107c611f30565b5b602002602001015190505f60025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20540361112857808484815181106110df576110de611f30565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050828061112490612169565b9350505b85828151811061113b5761113a611f30565b5b602002602001015160025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461118e9190612302565b9250508190555081600101915050611061565b505f5b8181101561130d575f8382815181106111c0576111bf611f30565b5b6020026020010151905060025f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20548173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016112419190611c97565b602060405180830381865afa15801561125c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112809190612207565b10156112c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b89061237f565b60405180910390fd5b60025f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9055816001019150506111a4565b505050505050565b61138f838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb858560405160240161134892919061239d565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611465565b505050565b60018081905550565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f61148f828473ffffffffffffffffffffffffffffffffffffffff166114fa90919063ffffffff16565b90505f8151141580156114b35750808060200190518101906114b191906123ee565b155b156114f557826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016114ec9190611c97565b60405180910390fd5b505050565b606061150783835f61150f565b905092915050565b6060814710156115585747826040517fcf47918100000000000000000000000000000000000000000000000000000000815260040161154f929190612419565b60405180910390fd5b5f808573ffffffffffffffffffffffffffffffffffffffff16848660405161158091906124a2565b5f6040518083038185875af1925050503d805f81146115ba576040519150601f19603f3d011682016040523d82523d5f602084013e6115bf565b606091505b50915091506115cf8683836115da565b925050509392505050565b6060826115ef576115ea82611667565b61165f565b5f825114801561161557505f8473ffffffffffffffffffffffffffffffffffffffff163b145b1561165757836040517f9996b31500000000000000000000000000000000000000000000000000000000815260040161164e9190611c97565b60405180910390fd5b819050611660565b5b9392505050565b5f8151111561167857805160208201fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405180608001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f15158152602001606081525090565b60405180604001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81525090565b5f819050919050565b61172781611715565b82525050565b5f6020820190506117405f83018461171e565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261176f5761176e61174e565b5b8235905067ffffffffffffffff81111561178c5761178b611752565b5b6020830191508360208202830111156117a8576117a7611756565b5b9250929050565b5f8083601f8401126117c4576117c361174e565b5b8235905067ffffffffffffffff8111156117e1576117e0611752565b5b6020830191508360208202830111156117fd576117fc611756565b5b9250929050565b5f8083601f8401126118195761181861174e565b5b8235905067ffffffffffffffff81111561183657611835611752565b5b60208301915083602082028301111561185257611851611756565b5b9250929050565b5f805f805f805f806080898b03121561187557611874611746565b5b5f89013567ffffffffffffffff8111156118925761189161174a565b5b61189e8b828c0161175a565b9850985050602089013567ffffffffffffffff8111156118c1576118c061174a565b5b6118cd8b828c016117af565b9650965050604089013567ffffffffffffffff8111156118f0576118ef61174a565b5b6118fc8b828c01611804565b9450945050606089013567ffffffffffffffff81111561191f5761191e61174a565b5b61192b8b828c016117af565b92509250509295985092959890939650565b5f805f806040858703121561195557611954611746565b5b5f85013567ffffffffffffffff8111156119725761197161174a565b5b61197e87828801611804565b9450945050602085013567ffffffffffffffff8111156119a1576119a061174a565b5b6119ad87828801611804565b925092505092959194509250565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611a0d826119e4565b9050919050565b611a1d81611a03565b82525050565b611a2c81611715565b82525050565b5f8115159050919050565b611a4681611a32565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b604082015f820151611a895f850182611a14565b506020820151611a9c6020850182611a23565b50505050565b5f611aad8383611a75565b60408301905092915050565b5f602082019050919050565b5f611acf82611a4c565b611ad98185611a56565b9350611ae483611a66565b805f5b83811015611b14578151611afb8882611aa2565b9750611b0683611ab9565b925050600181019050611ae7565b5085935050505092915050565b5f608083015f830151611b365f860182611a14565b506020830151611b496020860182611a23565b506040830151611b5c6040860182611a3d565b5060608301518482036060860152611b748282611ac5565b9150508091505092915050565b5f611b8c8383611b21565b905092915050565b5f602082019050919050565b5f611baa826119bb565b611bb481856119c5565b935083602082028501611bc6856119d5565b805f5b85811015611c015784840389528151611be28582611b81565b9450611bed83611b94565b925060208a01995050600181019050611bc9565b50829750879550505050505092915050565b5f6020820190508181035f830152611c2b8184611ba0565b905092915050565b611c3c81611a03565b8114611c46575f80fd5b50565b5f81359050611c5781611c33565b92915050565b5f60208284031215611c7257611c71611746565b5b5f611c7f84828501611c49565b91505092915050565b611c9181611a03565b82525050565b5f602082019050611caa5f830184611c88565b92915050565b5f82825260208201905092915050565b7f656d70747920726563697069656e7473000000000000000000000000000000005f82015250565b5f611cf4601083611cb0565b9150611cff82611cc0565b602082019050919050565b5f6020820190508181035f830152611d2181611ce8565b9050919050565b7f676173206c656e677468206d69736d61746368000000000000000000000000005f82015250565b5f611d5c601383611cb0565b9150611d6782611d28565b602082019050919050565b5f6020820190508181035f830152611d8981611d50565b9050919050565b7f676173416d6f756e7473206d75737420626520656d70747900000000000000005f82015250565b5f611dc4601883611cb0565b9150611dcf82611d90565b602082019050919050565b5f6020820190508181035f830152611df181611db8565b9050919050565b7f746f6b656e206c656e677468206d69736d6174636800000000000000000000005f82015250565b5f611e2c601583611cb0565b9150611e3782611df8565b602082019050919050565b5f6020820190508181035f830152611e5981611e20565b9050919050565b7f746f6b656e20617272617973206d75737420626520656d7074790000000000005f82015250565b5f611e94601a83611cb0565b9150611e9f82611e60565b602082019050919050565b5f6020820190508181035f830152611ec181611e88565b9050919050565b7f4554482076616c7565206d69736d6174636800000000000000000000000000005f82015250565b5f611efc601283611cb0565b9150611f0782611ec8565b602082019050919050565b5f6020820190508181035f830152611f2981611ef0565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f611f67826119e4565b9050919050565b611f7781611f5d565b8114611f81575f80fd5b50565b5f81359050611f9281611f6e565b92915050565b5f60208284031215611fad57611fac611746565b5b5f611fba84828501611f84565b91505092915050565b7f7a65726f20726563697069656e740000000000000000000000000000000000005f82015250565b5f611ff7600e83611cb0565b915061200282611fc3565b602082019050919050565b5f6020820190508181035f83015261202481611feb565b9050919050565b7f7a65726f20746f6b656e000000000000000000000000000000000000000000005f82015250565b5f61205f600a83611cb0565b915061206a8261202b565b602082019050919050565b5f6020820190508181035f83015261208c81612053565b9050919050565b5f81905092915050565b50565b5f6120ab5f83612093565b91506120b68261209d565b5f82019050919050565b5f6120ca826120a0565b9150819050919050565b7f455448207472616e73666572206661696c6564000000000000000000000000005f82015250565b5f612108601383611cb0565b9150612113826120d4565b602082019050919050565b5f6020820190508181035f830152612135816120fc565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61217382611715565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036121a5576121a461213c565b5b600182019050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6121e681611715565b81146121f0575f80fd5b50565b5f81519050612201816121dd565b92915050565b5f6020828403121561221c5761221b611746565b5b5f612229848285016121f3565b91505092915050565b7f4e6f2045544820746f20776974686472617700000000000000000000000000005f82015250565b5f612266601283611cb0565b915061227182612232565b602082019050919050565b5f6020820190508181035f8301526122938161225a565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c005f82015250565b5f6122ce601f83611cb0565b91506122d98261229a565b602082019050919050565b5f6020820190508181035f8301526122fb816122c2565b9050919050565b5f61230c82611715565b915061231783611715565b925082820190508082111561232f5761232e61213c565b5b92915050565b7f496e73756666696369656e7420746f6b656e2062616c616e63650000000000005f82015250565b5f612369601a83611cb0565b915061237482612335565b602082019050919050565b5f6020820190508181035f8301526123968161235d565b9050919050565b5f6040820190506123b05f830185611c88565b6123bd602083018461171e565b9392505050565b6123cd81611a32565b81146123d7575f80fd5b50565b5f815190506123e8816123c4565b92915050565b5f6020828403121561240357612402611746565b5b5f612410848285016123da565b91505092915050565b5f60408201905061242c5f83018561171e565b612439602083018461171e565b9392505050565b5f81519050919050565b5f5b8381101561246757808201518184015260208101905061244c565b5f8484015250505050565b5f61247c82612440565b6124868185612093565b935061249681856020860161244a565b80840191505092915050565b5f6124ad8284612472565b91508190509291505056fea2646970667358221220ccff3ac19ba017355139a9d00242b5f8af3ad6792ae120e62a7398cfba5dca2664736f6c63430008140033

Verified Source Code Full Match

Compiler: v0.8.20+commit.a1b79de6 EVM: shanghai Optimization: No
zz_contract.sol 199 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";


contract MyContract is Ownable,ReentrancyGuard {
    using SafeERC20 for IERC20;

    mapping(address => uint256) private _tokenTotal;


    event ReceivedETH(address indexed sender, uint256 amount);
    event WithdrawalETH(address indexed owner, uint256 amount);
    event WithdrawalToken(address indexed owner, uint256 amount);
    event MultiTransferETH(address indexed sender, address indexed to, uint256 amount);
    event MultiTransferToken(address indexed token,address indexed to,uint256 amount);

    constructor() Ownable(msg.sender) {}

    receive() external payable {
        emit ReceivedETH(msg.sender, msg.value);
    }

    function withdrawalETH() external onlyOwner {
        uint256 balance = address(this).balance;
        require(balance > 0, "No ETH to withdraw");
        payable(owner()).transfer(balance);
        emit WithdrawalETH(owner(), balance);
    }

    function withdrawToken(address tokenAddress) external onlyOwner {
        IERC20 token = IERC20(tokenAddress);
        uint256 balance = token.balanceOf(address(this));
        token.safeTransfer(owner(), balance);
        emit WithdrawalToken(owner(), balance);
    }

    function addAmounts(uint256[] memory amounts) pure internal returns (uint256 totalAmount) {
        for (uint256 i = 0; i < amounts.length; i++) {
            totalAmount += amounts[i]; 
        }
    }

    function checkTokenBalancesOptimized(address[] memory tokenAddresss,uint256[] memory tokenAmounts) internal {
        uint256 len = tokenAddresss.length;
        // 记录出现过的 token
        address[] memory uniqueTokens = new address[](len);
        uint256 uniqueCount = 0;

        // 汇总每个 token 的总金额
        for (uint256 i = 0; i < len; ) {
            address token = tokenAddresss[i];
            if (_tokenTotal[token] == 0) {
                uniqueTokens[uniqueCount] = token;
                uniqueCount++;
            }

            _tokenTotal[token] += tokenAmounts[i];
            unchecked { ++i; }
        }

        // 校验余额
        for (uint256 i = 0; i < uniqueCount; ) {
            address token = uniqueTokens[i];
            require(IERC20(token).balanceOf(address(this)) >= _tokenTotal[token],"Insufficient token balance");
            // 清理 storage(非常关键)
            delete _tokenTotal[token];
            unchecked { ++i; }
        }
    }

    // function multiTransfer(
    //     address payable[] memory gasRecipients,  // 发送的地址
    //     uint256[] memory gasAmounts, // 发送的eth金额
    //     address[] memory tokenAddresss, // 发送的token合约地址
    //     uint256[] memory tokenAmounts // 发送的token数量
    // ) external onlyOwner payable nonReentrant {
    //     require(gasRecipients.length == gasAmounts.length, "gas length mismatch");
    //     require(gasRecipients.length == tokenAmounts.length, "token length mismatch");
    //     require(gasRecipients.length == tokenAddresss.length, "token addr length mismatch");
    //     require(gasRecipients.length > 0, "empty");

    //     // ETH 校验
    //     uint256 totalGasAmount = addAmounts(gasAmounts);
    //     require(address(this).balance >= totalGasAmount, "ETH insufficient");

    //     // Token 校验
    //     checkTokenBalancesOptimized(tokenAddresss, tokenAmounts);

    //     // ----- 转账 -----
    //     for (uint256 i = 0; i < gasRecipients.length; i++) {
    //         require(gasRecipients[i] != address(0), "zero recipient");
    //         require(tokenAddresss[i] != address(0), "zero token");

    //         IERC20(tokenAddresss[i]).safeTransfer(gasRecipients[i],tokenAmounts[i]);
    //         emit MultiTransferToken(tokenAddresss[i],gasRecipients[i], tokenAmounts[i]);

    //         (bool success, ) = payable(gasRecipients[i]).call{value: gasAmounts[i]}("");
    //         require(success, "ETH transfer failed");
    //         emit MultiTransferETH(msg.sender, gasRecipients[i], gasAmounts[i]);
    //     }
    // }

    function multiTransfer(
        address payable[] calldata recipients,
        uint256[] calldata gasAmounts,
        address[] calldata tokenAddresses,
        uint256[] calldata tokenAmounts
    ) external payable onlyOwner nonReentrant {
        uint256 len = recipients.length;
        require(len > 0, "empty recipients");

        bool sendETH = gasAmounts.length > 0;
        bool sendToken = tokenAddresses.length > 0 || tokenAmounts.length > 0;

        // ---- 长度校验 ----
        if (sendETH) {
            require(gasAmounts.length == len, "gas length mismatch");
        } else {
            require(gasAmounts.length == 0, "gasAmounts must be empty");
        }

        if (sendToken) {
            require(tokenAddresses.length == len && tokenAmounts.length == len,"token length mismatch");
        } else {
            require(tokenAddresses.length == 0 &&tokenAmounts.length == 0,"token arrays must be empty");
        }

        // ---- ETH 校验 ----
        if (sendETH) {
            uint256 totalGasAmount = addAmounts(gasAmounts);
            require(address(this).balance >= totalGasAmount, "ETH value mismatch");
        } 

        // ---- Token 校验 ----
        if (sendToken) {
            checkTokenBalancesOptimized(tokenAddresses, tokenAmounts);
        }

        // ---- 执行转账 ----
        for (uint256 i = 0; i < len; i++) {
            require(recipients[i] != address(0), "zero recipient");
            if (sendToken) {
                require(tokenAddresses[i] != address(0), "zero token");
                IERC20(tokenAddresses[i]).safeTransfer(recipients[i],tokenAmounts[i]);
                emit MultiTransferToken(tokenAddresses[i],recipients[i],tokenAmounts[i]);
            }
            if (sendETH) {
                (bool success, ) = recipients[i].call{value: gasAmounts[i]}("");
                require(success, "ETH transfer failed");
                emit MultiTransferETH(msg.sender,recipients[i],gasAmounts[i]);
            }
        }
    }



    struct Token {
        address tokenAddress;
        uint256 balance;
    }

    struct BalanceResult {
        address user;
        uint256 ethBalance;
        bool isContract;
        Token[] tokenBalances;
    }

    // 批量获取地址的状态
    function multiGetAddressInfo(address[] calldata recipients,address[] calldata tokenAddresses)external view onlyOwner returns (BalanceResult[] memory){
        BalanceResult[] memory results = new BalanceResult[](recipients.length);

        for (uint256 i = 0; i < recipients.length; i++) {
            Token[] memory tokenBalances = new Token[](tokenAddresses.length);

            for (uint256 j = 0; j < tokenAddresses.length; j++) {
                address token = tokenAddresses[j];
                tokenBalances[j] = Token({
                    tokenAddress: token,
                    balance: IERC20(token).balanceOf(recipients[i])
                });
            }

            results[i] = BalanceResult({
                user: recipients[i],
                isContract:recipients[i].code.length > 0,
                ethBalance: recipients[i].balance,
                tokenBalances: tokenBalances
            });
        }
        return results;
    }
}
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
IERC20.sol 79 lines
// 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);
}
SafeERC20.sol 118 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}
ReentrancyGuard.sol 77 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}
Address.sol 149 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/Address.sol)

pragma solidity ^0.8.20;

import {Errors} from "./Errors.sol";

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert Errors.InsufficientBalance(address(this).balance, amount);
        }

        (bool success, bytes memory returndata) = recipient.call{value: amount}("");
        if (!success) {
            _revert(returndata);
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {Errors.FailedCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert Errors.InsufficientBalance(address(this).balance, value);
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
     * of an unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {Errors.FailedCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            assembly ("memory-safe") {
                revert(add(returndata, 0x20), mload(returndata))
            }
        } else {
            revert Errors.FailedCall();
        }
    }
}
IERC20Permit.sol 90 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
Errors.sol 34 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of common custom errors used in multiple contracts
 *
 * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
 * It is recommended to avoid relying on the error API for critical functionality.
 *
 * _Available since v5.1._
 */
library Errors {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error InsufficientBalance(uint256 balance, uint256 needed);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedCall();

    /**
     * @dev The deployment failed.
     */
    error FailedDeployment();

    /**
     * @dev A necessary precompile is missing.
     */
    error MissingPrecompile(address);
}

Read Contract

multiGetAddressInfo 0x63549a71 → tuple[]
owner 0x8da5cb5b → address

Write Contract 5 functions

These functions modify contract state and require a wallet transaction to execute.

multiTransfer 0x1fc86486
address[] recipients
uint256[] gasAmounts
address[] tokenAddresses
uint256[] tokenAmounts
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
withdrawToken 0x89476069
address tokenAddress
withdrawalETH 0x7c53e2f7
No parameters

Recent Transactions

No transactions found for this address