ETH Price: $3,627.34 (-0.30%)

Contract

0x9B1a1750584223F144629791D54895FAa32A771f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim213118162024-12-02 2:22:4746 hrs ago1733106167IN
0x9B1a1750...Aa32A771f
0 ETH0.0010206115.09432161
Claim213056742024-12-01 5:49:232 days ago1733032163IN
0x9B1a1750...Aa32A771f
0 ETH0.000696298.21918296
Claim212988152024-11-30 6:50:473 days ago1732949447IN
0x9B1a1750...Aa32A771f
0 ETH0.000682188.05257329
Claim212958642024-11-29 20:54:594 days ago1732913699IN
0x9B1a1750...Aa32A771f
0 ETH0.0007992511.82054011
Claim212951762024-11-29 18:36:474 days ago1732905407IN
0x9B1a1750...Aa32A771f
0 ETH0.0012460414.70851401
Claim212851362024-11-28 8:54:475 days ago1732784087IN
0x9B1a1750...Aa32A771f
0 ETH0.000799899.44208101
Claim212806412024-11-27 17:41:476 days ago1732729307IN
0x9B1a1750...Aa32A771f
0 ETH0.0022807226.92203585
Claim212617992024-11-25 2:31:118 days ago1732501871IN
0x9B1a1750...Aa32A771f
0 ETH0.000714438.4333378
Claim212595462024-11-24 18:58:479 days ago1732474727IN
0x9B1a1750...Aa32A771f
0 ETH0.000651049.62853697
Claim212568502024-11-24 9:56:239 days ago1732442183IN
0x9B1a1750...Aa32A771f
0 ETH0.000731598.63585632
Claim212567382024-11-24 9:33:599 days ago1732440839IN
0x9B1a1750...Aa32A771f
0 ETH0.000624719.23917853
Claim212345412024-11-21 7:13:2312 days ago1732173203IN
0x9B1a1750...Aa32A771f
0 ETH0.0008759310.33960766
Claim212328742024-11-21 1:37:5912 days ago1732153079IN
0x9B1a1750...Aa32A771f
0 ETH0.000645517.61978248
Claim212324682024-11-21 0:16:3513 days ago1732148195IN
0x9B1a1750...Aa32A771f
0 ETH0.0008682410.24885765
Claim212086782024-11-17 16:39:4716 days ago1731861587IN
0x9B1a1750...Aa32A771f
0 ETH0.0014160716.71552025
Claim212056522024-11-17 6:31:3516 days ago1731825095IN
0x9B1a1750...Aa32A771f
0 ETH0.000762449
Claim211922032024-11-15 9:28:3518 days ago1731662915IN
0x9B1a1750...Aa32A771f
0 ETH0.0015326218.09130554
Claim211909912024-11-15 5:25:1118 days ago1731648311IN
0x9B1a1750...Aa32A771f
0 ETH0.0013773116.25805211
Claim211830922024-11-14 2:57:2319 days ago1731553043IN
0x9B1a1750...Aa32A771f
0 ETH0.0029820735.20079444
Claim211505162024-11-09 13:52:2324 days ago1731160343IN
0x9B1a1750...Aa32A771f
0 ETH0.001206814.24533911
Claim211485742024-11-09 7:22:3524 days ago1731136955IN
0x9B1a1750...Aa32A771f
0 ETH0.000522127.7219392
Claim211335672024-11-07 5:04:3526 days ago1730955875IN
0x9B1a1750...Aa32A771f
0 ETH0.0012918915.24972461
Claim211301972024-11-06 17:47:3527 days ago1730915255IN
0x9B1a1750...Aa32A771f
0 ETH0.0010029814.83356229
Claim211237952024-11-05 20:20:2328 days ago1730838023IN
0x9B1a1750...Aa32A771f
0 ETH0.000834839.8544857
Claim211032352024-11-02 23:28:3531 days ago1730590115IN
0x9B1a1750...Aa32A771f
0 ETH0.000339474.0071558
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SimpleVault

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 10000 runs

Other Settings:
paris EvmVersion
File 1 of 7 : SimpleVault.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

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 SimpleVault is Ownable {
  using SafeERC20 for IERC20;

  /// @notice Token to be stored in the vault
  IERC20 public token;

  /// @dev userAddress => balance
  mapping(address => uint256) private balances;

  /// @dev Kept for convenience of tracking claimed amounts
  mapping(address => uint256) private claimed;

  error InsufficientBalance();
  error ArrayLengthMismatch();
  error ZeroAddress();
  error NoAddressesProvided();
  error ZeroBalance();

  event Deposit(address indexed user, uint256 amount);
  event Claim(address indexed user, uint256 amount);
  event Cancel(address indexed user, uint256 amount);

  constructor(address _token) Ownable(_msgSender()) {
    token = IERC20(_token);
  }

  /// @notice Deposit tokens to the vault
  /// @param users array of addresses to deposit tokens for
  /// @param amounts array of amounts to deposit for corresponding addresses
  function batchDeposit(address[] calldata users, uint256[] calldata amounts) public {
    if (users.length != amounts.length) {
      revert ArrayLengthMismatch();
    }
    if (users.length == 0) {
      revert NoAddressesProvided();
    }

    uint256 totalAmount;
    for (uint256 i = 0; i < users.length; i++) {
      address userAddress = users[i];
      uint256 amount = amounts[i];

      if (userAddress == address(0)) {
        revert ZeroAddress();
      }

      totalAmount += amount;
      balances[userAddress] += amount;
      emit Deposit(userAddress, amount);
    }

    token.safeTransferFrom(_msgSender(), address(this), totalAmount);
  }

  /// @notice Claim tokens from the vault for the sender address
  /// @param amount amount to claim
  function claim(uint256 amount) public {
    uint256 balance = balances[_msgSender()];
    if (balance == 0) {
      revert ZeroBalance();
    }
    if (amount > balance) {
      revert InsufficientBalance();
    }
    if (amount == 0) {
      amount = balance;
    }

    balances[_msgSender()] -= amount;
    claimed[_msgSender()] += amount;
    emit Claim(_msgSender(), amount);
    token.safeTransfer(_msgSender(), amount);
  }

  /// @notice [OnlyOwner] Cancel tokens for the provided addresses, sending them back to the sender
  /// @param users array of addresses to cancel tokens for
  function batchCancel(address[] calldata users) public onlyOwner {
    uint256 totalAmount;

    for (uint256 i = 0; i < users.length; i++) {
      address userAddress = users[i];
      uint256 userBalance = balances[userAddress];
      totalAmount += userBalance;
      balances[userAddress] = 0;
      emit Cancel(userAddress, userBalance);
    }

    if (totalAmount == 0) {
      revert ZeroBalance();
    }

    token.safeTransfer(_msgSender(), totalAmount);
  }

  /// @notice Get the balance of the provided user
  /// @param user user address to get the balance for
  function balanceOf(address user) public view returns (uint256) {
    return balances[user];
  }

  /// @notice Get the claimed amount of the provided user
  /// @param user user address to get the claimed amount for
  function claimedAmount(address user) public view returns (uint256) {
    return claimed[user];
  }
}

File 2 of 7 : Ownable.sol
// 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);
    }
}

File 3 of 7 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 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);
}

File 4 of 7 : IERC20.sol
// 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);
}

File 5 of 7 : SafeERC20.sol
// 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;
    }
}

File 6 of 7 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

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

    /**
     * @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 AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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
     * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));
        }
        (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 {FailedInnerCall}) 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 {FailedInnerCall} 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 {FailedInnerCall}.
     */
    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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

File 7 of 7 : Context.sol
// 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;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 10000,
    "details": {
      "yul": true,
      "constantOptimizer": true
    }
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"NoAddressesProvided","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroBalance","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Cancel","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"}],"name":"batchCancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"batchDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"claimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051610df3380380610df383398101604081905261002f916100d4565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e81610084565b50600180546001600160a01b0319166001600160a01b0392909216919091179055610104565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100e657600080fd5b81516001600160a01b03811681146100fd57600080fd5b9392505050565b610ce0806101136000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c806370a08231116100765780638da5cb5b1161005b5780638da5cb5b1461016a578063f2fde38b146101a9578063fc0c546a146101bc57600080fd5b806370a082311461012c578063715018a61461016257600080fd5b806304e86903146100a857806325a0b2e1146100f157806330a9073614610106578063379607f514610119575b600080fd5b6100de6100b6366004610a8c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b6040519081526020015b60405180910390f35b6101046100ff366004610b0e565b6101dc565b005b610104610114366004610b50565b610320565b610104610127366004610bbc565b610502565b6100de61013a366004610a8c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b610104610637565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e8565b6101046101b7366004610a8c565b61064b565b6001546101849073ffffffffffffffffffffffffffffffffffffffff1681565b6101e46106b4565b6000805b828110156102bc57600084848381811061020457610204610bd5565b90506020020160208101906102199190610a8c565b73ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604090205490915061024c8185610c33565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600260205260408082209190915551919550907f27f83af92b39768b17fe0c8d6922452702717efb8626d97e7a754e0b27d4f6d2906102aa9084815260200190565b60405180910390a250506001016101e8565b50806000036102f7576040517f669567ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61031b3360015473ffffffffffffffffffffffffffffffffffffffff169083610707565b505050565b828114610359576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000839003610394576040517f67892f3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805b848110156104d55760008686838181106103b4576103b4610bd5565b90506020020160208101906103c99190610a8c565b905060008585848181106103df576103df610bd5565b602002919091013591505073ffffffffffffffffffffffffffffffffffffffff8216610437576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104418185610c33565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604081208054929650839290919061047b908490610c33565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a25050600101610398565b506104fb3360015473ffffffffffffffffffffffffffffffffffffffff16903084610788565b5050505050565b336000908152600260205260408120549081900361054c576040517f669567ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80821115610586576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600003610592578091505b33600090815260026020526040812080548492906105b1908490610c46565b909155505033600090815260036020526040812080548492906105d5908490610c33565b909155505060405182815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49060200160405180910390a26106333360015473ffffffffffffffffffffffffffffffffffffffff169084610707565b5050565b61063f6106b4565b61064960006107d4565b565b6106536106b4565b73ffffffffffffffffffffffffffffffffffffffff81166106a8576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b6106b1816107d4565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610649576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161069f565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261031b91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610849565b60405173ffffffffffffffffffffffffffffffffffffffff84811660248301528381166044830152606482018390526107ce9186918216906323b872dd90608401610741565b50505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061086b73ffffffffffffffffffffffffffffffffffffffff8416836108df565b9050805160001415801561089057508080602001905181019061088e9190610c59565b155b1561031b576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240161069f565b60606108ed838360006108f6565b90505b92915050565b606081471015610934576040517fcd78605900000000000000000000000000000000000000000000000000000000815230600482015260240161069f565b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161095d9190610c7b565b60006040518083038185875af1925050503d806000811461099a576040519150601f19603f3d011682016040523d82523d6000602084013e61099f565b606091505b50915091506109af8683836109bb565b925050505b9392505050565b6060826109d0576109cb82610a4a565b6109b4565b81511580156109f4575073ffffffffffffffffffffffffffffffffffffffff84163b155b15610a43576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161069f565b50806109b4565b805115610a5a5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215610a9e57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146109b457600080fd5b60008083601f840112610ad457600080fd5b50813567ffffffffffffffff811115610aec57600080fd5b6020830191508360208260051b8501011115610b0757600080fd5b9250929050565b60008060208385031215610b2157600080fd5b823567ffffffffffffffff811115610b3857600080fd5b610b4485828601610ac2565b90969095509350505050565b60008060008060408587031215610b6657600080fd5b843567ffffffffffffffff80821115610b7e57600080fd5b610b8a88838901610ac2565b90965094506020870135915080821115610ba357600080fd5b50610bb087828801610ac2565b95989497509550505050565b600060208284031215610bce57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156108f0576108f0610c04565b818103818111156108f0576108f0610c04565b600060208284031215610c6b57600080fd5b815180151581146109b457600080fd5b6000825160005b81811015610c9c5760208186018101518583015201610c82565b50600092019182525091905056fea264697066735822122032eb9feac34edb7abcc65bae978c9c84b15e6014ac5636aca61524d84324773764736f6c634300081800330000000000000000000000004b1d0b9f081468d780ca1d5d79132b64301085d1

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a35760003560e01c806370a08231116100765780638da5cb5b1161005b5780638da5cb5b1461016a578063f2fde38b146101a9578063fc0c546a146101bc57600080fd5b806370a082311461012c578063715018a61461016257600080fd5b806304e86903146100a857806325a0b2e1146100f157806330a9073614610106578063379607f514610119575b600080fd5b6100de6100b6366004610a8c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b6040519081526020015b60405180910390f35b6101046100ff366004610b0e565b6101dc565b005b610104610114366004610b50565b610320565b610104610127366004610bbc565b610502565b6100de61013a366004610a8c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b610104610637565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e8565b6101046101b7366004610a8c565b61064b565b6001546101849073ffffffffffffffffffffffffffffffffffffffff1681565b6101e46106b4565b6000805b828110156102bc57600084848381811061020457610204610bd5565b90506020020160208101906102199190610a8c565b73ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604090205490915061024c8185610c33565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600260205260408082209190915551919550907f27f83af92b39768b17fe0c8d6922452702717efb8626d97e7a754e0b27d4f6d2906102aa9084815260200190565b60405180910390a250506001016101e8565b50806000036102f7576040517f669567ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61031b3360015473ffffffffffffffffffffffffffffffffffffffff169083610707565b505050565b828114610359576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000839003610394576040517f67892f3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805b848110156104d55760008686838181106103b4576103b4610bd5565b90506020020160208101906103c99190610a8c565b905060008585848181106103df576103df610bd5565b602002919091013591505073ffffffffffffffffffffffffffffffffffffffff8216610437576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104418185610c33565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604081208054929650839290919061047b908490610c33565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a25050600101610398565b506104fb3360015473ffffffffffffffffffffffffffffffffffffffff16903084610788565b5050505050565b336000908152600260205260408120549081900361054c576040517f669567ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80821115610586576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600003610592578091505b33600090815260026020526040812080548492906105b1908490610c46565b909155505033600090815260036020526040812080548492906105d5908490610c33565b909155505060405182815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49060200160405180910390a26106333360015473ffffffffffffffffffffffffffffffffffffffff169084610707565b5050565b61063f6106b4565b61064960006107d4565b565b6106536106b4565b73ffffffffffffffffffffffffffffffffffffffff81166106a8576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b6106b1816107d4565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610649576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161069f565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261031b91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610849565b60405173ffffffffffffffffffffffffffffffffffffffff84811660248301528381166044830152606482018390526107ce9186918216906323b872dd90608401610741565b50505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061086b73ffffffffffffffffffffffffffffffffffffffff8416836108df565b9050805160001415801561089057508080602001905181019061088e9190610c59565b155b1561031b576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240161069f565b60606108ed838360006108f6565b90505b92915050565b606081471015610934576040517fcd78605900000000000000000000000000000000000000000000000000000000815230600482015260240161069f565b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161095d9190610c7b565b60006040518083038185875af1925050503d806000811461099a576040519150601f19603f3d011682016040523d82523d6000602084013e61099f565b606091505b50915091506109af8683836109bb565b925050505b9392505050565b6060826109d0576109cb82610a4a565b6109b4565b81511580156109f4575073ffffffffffffffffffffffffffffffffffffffff84163b155b15610a43576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161069f565b50806109b4565b805115610a5a5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215610a9e57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146109b457600080fd5b60008083601f840112610ad457600080fd5b50813567ffffffffffffffff811115610aec57600080fd5b6020830191508360208260051b8501011115610b0757600080fd5b9250929050565b60008060208385031215610b2157600080fd5b823567ffffffffffffffff811115610b3857600080fd5b610b4485828601610ac2565b90969095509350505050565b60008060008060408587031215610b6657600080fd5b843567ffffffffffffffff80821115610b7e57600080fd5b610b8a88838901610ac2565b90965094506020870135915080821115610ba357600080fd5b50610bb087828801610ac2565b95989497509550505050565b600060208284031215610bce57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156108f0576108f0610c04565b818103818111156108f0576108f0610c04565b600060208284031215610c6b57600080fd5b815180151581146109b457600080fd5b6000825160005b81811015610c9c5760208186018101518583015201610c82565b50600092019182525091905056fea264697066735822122032eb9feac34edb7abcc65bae978c9c84b15e6014ac5636aca61524d84324773764736f6c63430008180033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000004b1d0b9f081468d780ca1d5d79132b64301085d1

-----Decoded View---------------
Arg [0] : _token (address): 0x4b1D0b9F081468D780Ca1d5d79132b64301085d1

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000004b1d0b9f081468d780ca1d5d79132b64301085d1


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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