ETH Price: $3,404.65 (+6.11%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Pay For Benefici...209025262024-10-05 23:08:23110 days ago1728169703IN
0x2c493AA9...81b299fC1
0 ETH0.000336583.92294669
Pay For Benefici...208771702024-10-02 10:18:47113 days ago1727864327IN
0x2c493AA9...81b299fC1
0 ETH0.000525836.11790333
Pay For Benefici...208353322024-09-26 14:17:11119 days ago1727360231IN
0x2c493AA9...81b299fC1
0 ETH0.0024587730.29916969
Pay For Benefici...208188792024-09-24 7:12:11122 days ago1727161931IN
0x2c493AA9...81b299fC1
0 ETH0.0014648417.04298437
Pay For Benefici...207918942024-09-20 12:47:23125 days ago1726836443IN
0x2c493AA9...81b299fC1
0 ETH0.0012395512.04646536
Transfer Ownersh...207764952024-09-18 9:10:35127 days ago1726650635IN
0x2c493AA9...81b299fC1
0 ETH0.000195936.84864207
Pay For Benefici...207458592024-09-14 2:25:59132 days ago1726280759IN
0x2c493AA9...81b299fC1
0 ETH0.000206282.4
Pay For Benefici...207416902024-09-13 12:27:11132 days ago1726230431IN
0x2c493AA9...81b299fC1
0 ETH0.000184082.14171226
Pay For Benefici...207410602024-09-13 10:20:47132 days ago1726222847IN
0x2c493AA9...81b299fC1
0 ETH0.000235462.59940285
Withdraw207400872024-09-13 7:04:59133 days ago1726211099IN
0x2c493AA9...81b299fC1
0 ETH0.000232.39689306
Withdraw207400662024-09-13 7:00:47133 days ago1726210847IN
0x2c493AA9...81b299fC1
0 ETH0.000222272.33659152
Pay For Benefici...207400362024-09-13 6:54:47133 days ago1726210487IN
0x2c493AA9...81b299fC1
0 ETH0.000147691.71836169
Pay For Benefici...207385552024-09-13 1:58:11133 days ago1726192691IN
0x2c493AA9...81b299fC1
0 ETH0.000204262.38076561
Pay For Benefici...207375312024-09-12 22:32:11133 days ago1726180331IN
0x2c493AA9...81b299fC1
0 ETH0.000203712.37017126
Pay For Benefici...207374572024-09-12 22:17:23133 days ago1726179443IN
0x2c493AA9...81b299fC1
0 ETH0.000256562.98509338
Pay For Benefici...207374502024-09-12 22:15:59133 days ago1726179359IN
0x2c493AA9...81b299fC1
0 ETH0.000264423.07646462
Pay For Benefici...207371992024-09-12 21:25:35133 days ago1726176335IN
0x2c493AA9...81b299fC1
0 ETH0.000564656.56956317
Pay For Benefici...207355062024-09-12 15:44:47133 days ago1726155887IN
0x2c493AA9...81b299fC1
0 ETH0.000764888.8991363
Pay For Benefici...207350802024-09-12 14:18:47133 days ago1726150727IN
0x2c493AA9...81b299fC1
0 ETH0.000582316.78705322
Pay For Benefici...207349502024-09-12 13:52:35133 days ago1726149155IN
0x2c493AA9...81b299fC1
0 ETH0.000320813.73259068
Pay For Benefici...207345772024-09-12 12:37:59133 days ago1726144679IN
0x2c493AA9...81b299fC1
0 ETH0.000269852.24904631
Update Treasury207337882024-09-12 9:58:35133 days ago1726135115IN
0x2c493AA9...81b299fC1
0 ETH0.000097193.22136812
Pay For Benefici...207336142024-09-12 9:23:11133 days ago1726132991IN
0x2c493AA9...81b299fC1
0 ETH0.000304532.53462964
Update Allowed T...207188292024-09-10 7:49:35136 days ago1725954575IN
0x2c493AA9...81b299fC1
0 ETH0.000315224.18014559
Update Allowed T...207131362024-09-09 12:45:11136 days ago1725885911IN
0x2c493AA9...81b299fC1
0 ETH0.000381474.12365139
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:
Payment

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 9 : Payment.sol
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.24;

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

import { IPayment } from "src/interfaces/IPayment.sol";

contract Payment is IPayment, Ownable {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    address public constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    /// @notice Address of the treasury
    address public treasury;

    /// Tokens allowed for payment
    EnumerableSet.AddressSet private allowedTokens;

    mapping(bytes => mapping(address => uint256)) public userTokenReceived;

    mapping(address => uint256) public totalTokenReceived;

    mapping(address => uint256) public totalTokenWithdrawn;

    constructor(address _owner, address _treasury) Ownable(_owner) {
        treasury = _treasury;
    }

    /// @inheritdoc IPayment
    receive() external payable {
        _storePayment(msg.sender, ETH_ADDRESS, abi.encodePacked(msg.sender), msg.value);
    }

    /// @inheritdoc IPayment
    fallback() external payable {
        _storePayment(msg.sender, ETH_ADDRESS, abi.encodePacked(msg.sender), msg.value);
    }

    /// @inheritdoc IPayment
    function payWithERC20(address token, uint256 amount) external {
        _transferPayment(msg.sender, token, abi.encodePacked(msg.sender), amount);
    }

    /// @inheritdoc IPayment
    function payForBeneficiaryWithERC20(address token, bytes memory beneficiary, uint256 amount) external {
        _transferPayment(msg.sender, token, beneficiary, amount);
    }

    /// @inheritdoc IPayment
    function withdraw(address token, uint256 amount) external onlyOwner {
        require(amount > 0, "Invalid amount");

        if (token == ETH_ADDRESS) {
            payable(treasury).transfer(amount);
        } else {
            IERC20(token).safeTransfer(treasury, amount);
        }

        totalTokenWithdrawn[token] += amount;

        emit Withdraw(treasury, token, amount);
    }

    /// @inheritdoc IPayment
    function allowedTokensLength() external view returns (uint256) {
        return allowedTokens.length();
    }

    /// @inheritdoc IPayment
    function allowedToken(uint256 index) external view returns (address) {
        return allowedTokens.at(index);
    }

    /// @inheritdoc IPayment
    function isTokenAllowed(address token) external view override returns (bool) {
        return allowedTokens.contains(token);
    }

    /// @inheritdoc IPayment
    function updateAllowedTokens(address token, bool add) external onlyOwner {
        if (add) {
            allowedTokens.add(token);
        } else {
            allowedTokens.remove(token);
        }

        emit SetAllowedTokens(token, add);
    }

    function updateTreasury(address _treasury) external onlyOwner {
        treasury = _treasury;

        emit TreasuryUpdated(_treasury);
    }

    function _transferPayment(address payer, address token, bytes memory beneficiary, uint256 amount) private {
        require(amount > 0, "Cannot stake 0");
        require(this.isTokenAllowed(token), "Token not allowed for payment");

        IERC20(token).safeTransferFrom(payer, address(this), amount);

        _storePayment(payer, token, beneficiary, amount);
    }

    function _storePayment(address payer, address token, bytes memory beneficiary, uint256 amount) private {
        userTokenReceived[beneficiary][token] += amount;
        totalTokenReceived[token] += amount;

        emit PaymentReceived(payer, token, beneficiary, amount);
    }
}

File 2 of 9 : 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 9 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._positions[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._positions[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 4 of 9 : 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 9 : 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 9 : IPayment.sol
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.24;

interface IPayment {
    /// @dev Emitted when payment received
    /// @param from Address of the user performing the payment
    /// @param token Addres of the token used for payment
    /// @param beneficiary Address of the user the payment will be indexed to
    /// @param amount Amount of MODE tokens staked
    event PaymentReceived(address indexed from, address indexed token, bytes beneficiary, uint256 amount);

    /// @dev Emitted when payments withdrawn from the contract to the treasury
    /// @param beneficiary Address of the treasury
    /// @param token Address of the token withdrawn
    /// @param amount Amount of tokens withdrawn
    event Withdraw(address indexed beneficiary, address indexed token, uint256 amount);

    /// @dev Emitted when a token is added or removed from the allowedTokens
    /// @param token Token address
    /// @param add True if token is added, false if removed
    event SetAllowedTokens(address indexed token, bool add);

    /// @dev Emitted when treasury address is updated
    /// @param treasury Address of the new treasury
    event TreasuryUpdated(address indexed treasury);

    /// @dev Receives payment in ETH
    receive() external payable;

    /// @dev Fallback function to receive payment in ETH
    fallback() external payable;

    /// @dev Receives payment in ERC20 tokens
    function payWithERC20(address token, uint256 amount) external;

    /// @dev Receives payment for beneficiary in ERC20 tokens
    function payForBeneficiaryWithERC20(address token, bytes memory beneficiary, uint256 amount) external;

    /// @dev Withdraws token amount to the treasury
    function withdraw(address token, uint256 amount) external;

    /// @dev returns length of allowedTokens array
    function allowedTokensLength() external view returns (uint256);

    /// @dev returns allowedTokens array item's address for "index"
    function allowedToken(uint256 index) external view returns (address);

    /// @dev returns if "token" is allowed for payments
    function isTokenAllowed(address token) external view returns (bool);

    /// @dev Adds or removes tokens from the allowedTokens
    function updateAllowedTokens(address token, bool add) external;

    /// @dev Updates the treasury address
    function updateTreasury(address _treasury) external;
}

File 7 of 9 : 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;
    }
}

File 8 of 9 : 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 9 of 9 : 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();
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "@ERC721A-upgradeable/=lib/ERC721A-Upgradeable/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
    "ERC721A/=lib/ERC721A/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_treasury","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":"FailedInnerCall","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bytes","name":"beneficiary","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"add","type":"bool"}],"name":"SetAllowedTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"treasury","type":"address"}],"name":"TreasuryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"allowedToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowedTokensLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isTokenAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bytes","name":"beneficiary","type":"bytes"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"payForBeneficiaryWithERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"payWithERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalTokenReceived","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalTokenWithdrawn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"add","type":"bool"}],"name":"updateAllowedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"updateTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"address","name":"","type":"address"}],"name":"userTokenReceived","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b5060405161119a38038061119a83398101604081905261002f916100fa565b816001600160a01b03811661005e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100678161008e565b50600180546001600160a01b0319166001600160a01b03929092169190911790555061012d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100f557600080fd5b919050565b6000806040838503121561010d57600080fd5b610116836100de565b9150610124602084016100de565b90509250929050565b61105e8061013c6000396000f3fe6080604052600436106100f75760003560e01c806391751b241161008a578063e6c0fe3611610059578063e6c0fe361461036a578063f2fde38b1461038a578063f3fef3a3146103aa578063f9eaee0d146103ca57610150565b806391751b24146102ad578063a734f06e146102f5578063ac3fd8731461031d578063b572ccca1461034a57610150565b8063715018a6116100c6578063715018a61461022d57806376de0a4e146102425780637f51bb1f1461026f5780638da5cb5b1461028f57610150565b8063403870b61461018d5780634565e5ef146101ca578063580030fb146101ed57806361d027b31461020d57610150565b366101505761014e3373eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee33604051602001610139919060609190911b6001600160601b031916815260140190565b604051602081830303815290604052346103fa565b005b61014e3373eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee33604051602001610139919060609190911b6001600160601b031916815260140190565b34801561019957600080fd5b506101ad6101a8366004610d21565b6104d2565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101d657600080fd5b506101df6104e5565b6040519081526020016101c1565b3480156101f957600080fd5b5061014e610208366004610df9565b6104f6565b34801561021957600080fd5b506001546101ad906001600160a01b031681565b34801561023957600080fd5b5061014e610507565b34801561024e57600080fd5b506101df61025d366004610e50565b60056020526000908152604090205481565b34801561027b57600080fd5b5061014e61028a366004610e50565b61051b565b34801561029b57600080fd5b506000546001600160a01b03166101ad565b3480156102b957600080fd5b506101df6102c8366004610e6b565b81516020818401810180516004825292820194820194909420919093529091526000908152604090205481565b34801561030157600080fd5b506101ad73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561032957600080fd5b506101df610338366004610e50565b60066020526000908152604090205481565b34801561035657600080fd5b5061014e610365366004610ec7565b61056d565b34801561037657600080fd5b5061014e610385366004610efe565b6105e2565b34801561039657600080fd5b5061014e6103a5366004610e50565b610624565b3480156103b657600080fd5b5061014e6103c5366004610efe565b610667565b3480156103d657600080fd5b506103ea6103e5366004610e50565b6107a4565b60405190151581526020016101c1565b8060048360405161040b9190610f4c565b90815260200160405180910390206000856001600160a01b03166001600160a01b03168152602001908152602001600020600082825461044b9190610f7e565b90915550506001600160a01b03831660009081526005602052604081208054839290610478908490610f7e565b92505081905550826001600160a01b0316846001600160a01b03167f745224a3db91dbd7fe52902b73512e1afee0fdb4b5ead44a18b1d3534154e2cf84846040516104c4929190610f91565b60405180910390a350505050565b60006104df6002836107b1565b92915050565b60006104f160026107c4565b905090565b610502338484846107ce565b505050565b61050f6108ea565b6105196000610917565b565b6105236108ea565b600180546001600160a01b0319166001600160a01b0383169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a250565b6105756108ea565b801561058c57610586600283610967565b50610599565b61059760028361097c565b505b816001600160a01b03167fbeedd5dcb09c4803050d3047ee83527a912621e3d694e6a07c19507fcb9fa20e826040516105d6911515815260200190565b60405180910390a25050565b61062033833360405160200161060b919060609190911b6001600160601b031916815260140190565b604051602081830303815290604052846107ce565b5050565b61062c6108ea565b6001600160a01b03811661065b57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61066481610917565b50565b61066f6108ea565b600081116106b05760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606401610652565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03831601610715576001546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561070f573d6000803e3d6000fd5b5061072f565b60015461072f906001600160a01b03848116911683610991565b6001600160a01b03821660009081526006602052604081208054839290610757908490610f7e565b90915550506001546040518281526001600160a01b038481169216907f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9060200160405180910390a35050565b60006104df6002836109f0565b60006107bd8383610a12565b9392505050565b60006104df825490565b6000811161080f5760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b6044820152606401610652565b60405163f9eaee0d60e01b81526001600160a01b0384166004820152309063f9eaee0d90602401602060405180830381865afa158015610853573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108779190610fcc565b6108c35760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e206e6f7420616c6c6f77656420666f72207061796d656e740000006044820152606401610652565b6108d86001600160a01b038416853084610a3c565b6108e4848484846103fa565b50505050565b6000546001600160a01b031633146105195760405163118cdaa760e01b8152336004820152602401610652565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006107bd836001600160a01b038416610a75565b60006107bd836001600160a01b038416610ac4565b6040516001600160a01b0383811660248301526044820183905261050291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610bb7565b6001600160a01b038116600090815260018301602052604081205415156107bd565b6000826000018281548110610a2957610a29610fe9565b9060005260206000200154905092915050565b6040516001600160a01b0384811660248301528381166044830152606482018390526108e49186918216906323b872dd906084016109be565b6000818152600183016020526040812054610abc575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104df565b5060006104df565b60008181526001830160205260408120548015610bad576000610ae8600183610fff565b8554909150600090610afc90600190610fff565b9050808214610b61576000866000018281548110610b1c57610b1c610fe9565b9060005260206000200154905080876000018481548110610b3f57610b3f610fe9565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610b7257610b72611012565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104df565b60009150506104df565b6000610bcc6001600160a01b03841683610c1a565b90508051600014158015610bf1575080806020019051810190610bef9190610fcc565b155b1561050257604051635274afe760e01b81526001600160a01b0384166004820152602401610652565b60606107bd8383600084600080856001600160a01b03168486604051610c409190610f4c565b60006040518083038185875af1925050503d8060008114610c7d576040519150601f19603f3d011682016040523d82523d6000602084013e610c82565b606091505b5091509150610c92868383610c9c565b9695505050505050565b606082610cb157610cac82610cf8565b6107bd565b8151158015610cc857506001600160a01b0384163b155b15610cf157604051639996b31560e01b81526001600160a01b0385166004820152602401610652565b50806107bd565b805115610d085780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b600060208284031215610d3357600080fd5b5035919050565b80356001600160a01b0381168114610d5157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610d7d57600080fd5b813567ffffffffffffffff80821115610d9857610d98610d56565b604051601f8301601f19908116603f01168101908282118183101715610dc057610dc0610d56565b81604052838152866020858801011115610dd957600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e0e57600080fd5b610e1784610d3a565b9250602084013567ffffffffffffffff811115610e3357600080fd5b610e3f86828701610d6c565b925050604084013590509250925092565b600060208284031215610e6257600080fd5b6107bd82610d3a565b60008060408385031215610e7e57600080fd5b823567ffffffffffffffff811115610e9557600080fd5b610ea185828601610d6c565b925050610eb060208401610d3a565b90509250929050565b801515811461066457600080fd5b60008060408385031215610eda57600080fd5b610ee383610d3a565b91506020830135610ef381610eb9565b809150509250929050565b60008060408385031215610f1157600080fd5b610f1a83610d3a565b946020939093013593505050565b60005b83811015610f43578181015183820152602001610f2b565b50506000910152565b60008251610f5e818460208701610f28565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104df576104df610f68565b6040815260008351806040840152610fb0816060850160208801610f28565b602083019390935250601f91909101601f191601606001919050565b600060208284031215610fde57600080fd5b81516107bd81610eb9565b634e487b7160e01b600052603260045260246000fd5b818103818111156104df576104df610f68565b634e487b7160e01b600052603160045260246000fdfea26469706673582212203a46292fe489a19d283e793140e654f9357ba9a57d2d3966a117fc492b05840d64736f6c63430008180033000000000000000000000000b922585a76337563ebe72167322c037108f4d3e0000000000000000000000000b922585a76337563ebe72167322c037108f4d3e0

Deployed Bytecode

0x6080604052600436106100f75760003560e01c806391751b241161008a578063e6c0fe3611610059578063e6c0fe361461036a578063f2fde38b1461038a578063f3fef3a3146103aa578063f9eaee0d146103ca57610150565b806391751b24146102ad578063a734f06e146102f5578063ac3fd8731461031d578063b572ccca1461034a57610150565b8063715018a6116100c6578063715018a61461022d57806376de0a4e146102425780637f51bb1f1461026f5780638da5cb5b1461028f57610150565b8063403870b61461018d5780634565e5ef146101ca578063580030fb146101ed57806361d027b31461020d57610150565b366101505761014e3373eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee33604051602001610139919060609190911b6001600160601b031916815260140190565b604051602081830303815290604052346103fa565b005b61014e3373eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee33604051602001610139919060609190911b6001600160601b031916815260140190565b34801561019957600080fd5b506101ad6101a8366004610d21565b6104d2565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101d657600080fd5b506101df6104e5565b6040519081526020016101c1565b3480156101f957600080fd5b5061014e610208366004610df9565b6104f6565b34801561021957600080fd5b506001546101ad906001600160a01b031681565b34801561023957600080fd5b5061014e610507565b34801561024e57600080fd5b506101df61025d366004610e50565b60056020526000908152604090205481565b34801561027b57600080fd5b5061014e61028a366004610e50565b61051b565b34801561029b57600080fd5b506000546001600160a01b03166101ad565b3480156102b957600080fd5b506101df6102c8366004610e6b565b81516020818401810180516004825292820194820194909420919093529091526000908152604090205481565b34801561030157600080fd5b506101ad73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561032957600080fd5b506101df610338366004610e50565b60066020526000908152604090205481565b34801561035657600080fd5b5061014e610365366004610ec7565b61056d565b34801561037657600080fd5b5061014e610385366004610efe565b6105e2565b34801561039657600080fd5b5061014e6103a5366004610e50565b610624565b3480156103b657600080fd5b5061014e6103c5366004610efe565b610667565b3480156103d657600080fd5b506103ea6103e5366004610e50565b6107a4565b60405190151581526020016101c1565b8060048360405161040b9190610f4c565b90815260200160405180910390206000856001600160a01b03166001600160a01b03168152602001908152602001600020600082825461044b9190610f7e565b90915550506001600160a01b03831660009081526005602052604081208054839290610478908490610f7e565b92505081905550826001600160a01b0316846001600160a01b03167f745224a3db91dbd7fe52902b73512e1afee0fdb4b5ead44a18b1d3534154e2cf84846040516104c4929190610f91565b60405180910390a350505050565b60006104df6002836107b1565b92915050565b60006104f160026107c4565b905090565b610502338484846107ce565b505050565b61050f6108ea565b6105196000610917565b565b6105236108ea565b600180546001600160a01b0319166001600160a01b0383169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a250565b6105756108ea565b801561058c57610586600283610967565b50610599565b61059760028361097c565b505b816001600160a01b03167fbeedd5dcb09c4803050d3047ee83527a912621e3d694e6a07c19507fcb9fa20e826040516105d6911515815260200190565b60405180910390a25050565b61062033833360405160200161060b919060609190911b6001600160601b031916815260140190565b604051602081830303815290604052846107ce565b5050565b61062c6108ea565b6001600160a01b03811661065b57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61066481610917565b50565b61066f6108ea565b600081116106b05760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606401610652565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03831601610715576001546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561070f573d6000803e3d6000fd5b5061072f565b60015461072f906001600160a01b03848116911683610991565b6001600160a01b03821660009081526006602052604081208054839290610757908490610f7e565b90915550506001546040518281526001600160a01b038481169216907f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9060200160405180910390a35050565b60006104df6002836109f0565b60006107bd8383610a12565b9392505050565b60006104df825490565b6000811161080f5760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b6044820152606401610652565b60405163f9eaee0d60e01b81526001600160a01b0384166004820152309063f9eaee0d90602401602060405180830381865afa158015610853573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108779190610fcc565b6108c35760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e206e6f7420616c6c6f77656420666f72207061796d656e740000006044820152606401610652565b6108d86001600160a01b038416853084610a3c565b6108e4848484846103fa565b50505050565b6000546001600160a01b031633146105195760405163118cdaa760e01b8152336004820152602401610652565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006107bd836001600160a01b038416610a75565b60006107bd836001600160a01b038416610ac4565b6040516001600160a01b0383811660248301526044820183905261050291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610bb7565b6001600160a01b038116600090815260018301602052604081205415156107bd565b6000826000018281548110610a2957610a29610fe9565b9060005260206000200154905092915050565b6040516001600160a01b0384811660248301528381166044830152606482018390526108e49186918216906323b872dd906084016109be565b6000818152600183016020526040812054610abc575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104df565b5060006104df565b60008181526001830160205260408120548015610bad576000610ae8600183610fff565b8554909150600090610afc90600190610fff565b9050808214610b61576000866000018281548110610b1c57610b1c610fe9565b9060005260206000200154905080876000018481548110610b3f57610b3f610fe9565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610b7257610b72611012565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104df565b60009150506104df565b6000610bcc6001600160a01b03841683610c1a565b90508051600014158015610bf1575080806020019051810190610bef9190610fcc565b155b1561050257604051635274afe760e01b81526001600160a01b0384166004820152602401610652565b60606107bd8383600084600080856001600160a01b03168486604051610c409190610f4c565b60006040518083038185875af1925050503d8060008114610c7d576040519150601f19603f3d011682016040523d82523d6000602084013e610c82565b606091505b5091509150610c92868383610c9c565b9695505050505050565b606082610cb157610cac82610cf8565b6107bd565b8151158015610cc857506001600160a01b0384163b155b15610cf157604051639996b31560e01b81526001600160a01b0385166004820152602401610652565b50806107bd565b805115610d085780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b600060208284031215610d3357600080fd5b5035919050565b80356001600160a01b0381168114610d5157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610d7d57600080fd5b813567ffffffffffffffff80821115610d9857610d98610d56565b604051601f8301601f19908116603f01168101908282118183101715610dc057610dc0610d56565b81604052838152866020858801011115610dd957600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e0e57600080fd5b610e1784610d3a565b9250602084013567ffffffffffffffff811115610e3357600080fd5b610e3f86828701610d6c565b925050604084013590509250925092565b600060208284031215610e6257600080fd5b6107bd82610d3a565b60008060408385031215610e7e57600080fd5b823567ffffffffffffffff811115610e9557600080fd5b610ea185828601610d6c565b925050610eb060208401610d3a565b90509250929050565b801515811461066457600080fd5b60008060408385031215610eda57600080fd5b610ee383610d3a565b91506020830135610ef381610eb9565b809150509250929050565b60008060408385031215610f1157600080fd5b610f1a83610d3a565b946020939093013593505050565b60005b83811015610f43578181015183820152602001610f2b565b50506000910152565b60008251610f5e818460208701610f28565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104df576104df610f68565b6040815260008351806040840152610fb0816060850160208801610f28565b602083019390935250601f91909101601f191601606001919050565b600060208284031215610fde57600080fd5b81516107bd81610eb9565b634e487b7160e01b600052603260045260246000fd5b818103818111156104df576104df610f68565b634e487b7160e01b600052603160045260246000fdfea26469706673582212203a46292fe489a19d283e793140e654f9357ba9a57d2d3966a117fc492b05840d64736f6c63430008180033

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

000000000000000000000000b922585a76337563ebe72167322c037108f4d3e0000000000000000000000000b922585a76337563ebe72167322c037108f4d3e0

-----Decoded View---------------
Arg [0] : _owner (address): 0xb922585A76337563Ebe72167322c037108f4d3e0
Arg [1] : _treasury (address): 0xb922585A76337563Ebe72167322c037108f4d3e0

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b922585a76337563ebe72167322c037108f4d3e0
Arg [1] : 000000000000000000000000b922585a76337563ebe72167322c037108f4d3e0


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.