Contract

0x85B08F1d877325126BD655b1AEcd25a705884422

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...15825672024-12-25 17:48:556 days ago1735148935IN
0x85B08F1d...705884422
0 S0.000031511.1
Transfer Ownersh...13535622024-12-23 15:23:388 days ago1734967418IN
0x85B08F1d...705884422
0 S0.000031511.1

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ReferralDistributor

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 14 : ReferralDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

interface IVotingEscrow {
    function create_lock_for(uint _value, uint _lock_duration, address _to) external;
}

interface IMinterUpgradable {
    function returnSurplusTokens(uint256 amount) external;
}

contract ReferralDistributor is Ownable(msg.sender), AccessControl {

    uint256 public totalCredited;
    uint256 public totalClaimed;
    uint256 public MAX_TIME = 86400 * 7 * 52 * 2;

    IERC20 public SwpxToken = IERC20(0x90C44218E202995F1c06CB0f0E452dd3b6d8eBDf);
    IVotingEscrow public VotingEscrow = IVotingEscrow(0x329D9cA4FAd82D10f128050535c138D3bd83E397);
    IMinterUpgradable public MinterUpgradable;

    mapping(address => UserInfo) public userInfo;

    // Events
    event ClaimReward(address user, uint256 amount);
    event ReturnSurplus(uint256 amount);
    event SetMinter(address minter);
    event SetVotingEscrow(address votingEscrow);
    event SetMaxTime(uint256 maxTime);
    event EarnedRewards(address user, uint256 amount, uint256 epoch);
    event EmergencyRecoverERC20(address token, uint256 amount, address to);
    event EmergencyRecoverNative(uint256 amount, address to);

    // Structs
    struct UserInfo {
        uint256 amount;
        uint256 claimed;
        uint256 totalEarned;
    }

    constructor(address _minterUpgradable) {
        IERC20(SwpxToken).approve(_minterUpgradable, type(uint256).max);
        IERC20(SwpxToken).approve(address(VotingEscrow), type(uint256).max);
        MinterUpgradable = IMinterUpgradable(_minterUpgradable);
    }

    function claimRewards() external {
        require(userInfo[msg.sender].amount > 0, 'nothing to claim');
        uint256 _userAmount = userInfo[msg.sender].amount;
        userInfo[msg.sender].amount = 0;
        userInfo[msg.sender].claimed += _userAmount;
        totalClaimed += _userAmount;

        VotingEscrow.create_lock_for(_userAmount, MAX_TIME, msg.sender);

        emit ClaimReward(msg.sender, _userAmount);
    }

    function addUserRewards(address[] memory _users, uint256[] memory _amounts, uint256 _epoch) external onlyOwner {
        require(_users.length == _amounts.length);
        for (uint256 i = 0; i < _users.length; ++i) {
            userInfo[_users[i]].amount += _amounts[i];
            userInfo[_users[i]].totalEarned += _amounts[i];

            // stats
            emit EarnedRewards(_users[i], _amounts[i], _epoch);
            totalCredited += _amounts[i];

        }
    }

    function returnSurplus(uint256 _amount) external onlyOwner {
        MinterUpgradable.returnSurplusTokens(_amount);
        emit ReturnSurplus(_amount);
    }

    function setMinter(IMinterUpgradable _newMinter) external onlyOwner {
        IERC20(SwpxToken).approve(address(MinterUpgradable), 0);

        MinterUpgradable = _newMinter;

        IERC20(SwpxToken).approve(address(_newMinter), type(uint256).max);

        emit SetMinter(address(_newMinter));
    }

    function updateMaxTime(uint256 _newMaxTime) external onlyOwner {
        MAX_TIME = _newMaxTime;
        emit SetMaxTime(_newMaxTime);
    }

    function updateVotingEscrow(IVotingEscrow _newVotingEscrow) external onlyOwner {

        IERC20(SwpxToken).approve(address(VotingEscrow), 0);

        VotingEscrow = _newVotingEscrow;

        IERC20(SwpxToken).approve(address(_newVotingEscrow), type(uint256).max);

        emit SetVotingEscrow(address(_newVotingEscrow));
    }

    // emergency recovery
    function emergencyRecoverERC20(address _tokenAddress, uint256 _tokenAmount, address _to) external onlyOwner {
        IERC20(_tokenAddress).transfer(_to, _tokenAmount);
        emit EmergencyRecoverERC20(_tokenAddress, _tokenAmount, _to);
    }

    function emergencyRecoverNative(uint256 _amount, address _to) external onlyOwner {
        (bool sent, ) = _to.call{value: _amount}("");
        require(sent, "Failed to send Ether");
        emit EmergencyRecoverNative(_amount, _to);
    }

}

File 2 of 14 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

File 3 of 14 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC-165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).
     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

File 4 of 14 : 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 5 of 14 : IERC1363.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 6 of 14 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

File 7 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";

File 8 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
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 9 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    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 Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            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 silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

File 10 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            assembly ("memory-safe") {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert Errors.FailedCall();
        }
    }
}

File 11 of 14 : 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 12 of 14 : Errors.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)

pragma solidity ^0.8.20;

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

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

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

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

File 13 of 14 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 14 of 14 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_minterUpgradable","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"EarnedRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"EmergencyRecoverERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"EmergencyRecoverNative","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ReturnSurplus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxTime","type":"uint256"}],"name":"SetMaxTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"}],"name":"SetMinter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"votingEscrow","type":"address"}],"name":"SetVotingEscrow","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MinterUpgradable","outputs":[{"internalType":"contract IMinterUpgradable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SwpxToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VotingEscrow","outputs":[{"internalType":"contract IVotingEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"addUserRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"emergencyRecoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"emergencyRecoverNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"returnSurplus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMinterUpgradable","name":"_newMinter","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalCredited","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":[{"internalType":"uint256","name":"_newMaxTime","type":"uint256"}],"name":"updateMaxTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IVotingEscrow","name":"_newVotingEscrow","type":"address"}],"name":"updateVotingEscrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"uint256","name":"totalEarned","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040526303bfc400600455600580546001600160a01b03199081167390c44218e202995f1c06cb0f0e452dd3b6d8ebdf179091556006805490911673329d9ca4fad82d10f128050535c138d3bd83e3971790553480156200006157600080fd5b506040516200144838038062001448833981016040819052620000849162000227565b3380620000ab57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000b681620001d7565b5060055460405163095ea7b360e01b81526001600160a01b03838116600483015260001960248301529091169063095ea7b3906044016020604051808303816000875af11580156200010c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000132919062000259565b5060055460065460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af11580156200018a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b0919062000259565b50600780546001600160a01b0319166001600160a01b03929092169190911790556200027d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156200023a57600080fd5b81516001600160a01b03811681146200025257600080fd5b9392505050565b6000602082840312156200026c57600080fd5b815180151581146200025257600080fd5b6111bb806200028d6000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806391d14854116100de578063c0cfdbfd11610097578063da849f1211610071578063da849f121461034b578063da888fae1461035e578063f2fde38b14610371578063fca3b5aa1461038457600080fd5b8063c0cfdbfd1461031c578063d547741f1461032f578063d54ad2a11461034257600080fd5b806391d14854146102b5578063953c9533146102c85780639662ae6f146102db578063a217fddf146102ee578063ab58eb97146102f6578063b245b4641461030957600080fd5b806336568abe1161013057806336568abe14610243578063372500ab14610256578063715018a61461025e5780637599e8fc14610266578063897feb19146102915780638da5cb5b146102a457600080fd5b806301ffc9a714610178578063067b23c3146101a05780631959a002146101b7578063248a9ca31461020157806326949984146102255780632f2ff15d1461022e575b600080fd5b61018b610186366004610e99565b610397565b60405190151581526020015b60405180910390f35b6101a960025481565b604051908152602001610197565b6101e66101c5366004610edf565b60086020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610197565b6101a961020f366004610efc565b6000908152600160208190526040909120015490565b6101a960045481565b61024161023c366004610f15565b6103ce565b005b610241610251366004610f15565b6103fa565b610241610432565b610241610578565b600554610279906001600160a01b031681565b6040516001600160a01b039091168152602001610197565b600654610279906001600160a01b031681565b6000546001600160a01b0316610279565b61018b6102c3366004610f15565b61058c565b6102416102d6366004610efc565b6105b7565b6102416102e9366004610f15565b6105f4565b6101a9600081565b610241610304366004610edf565b6106dd565b610241610317366004610f45565b610828565b61024161032a366004610efc565b6108ef565b61024161033d366004610f15565b610986565b6101a960035481565b610241610359366004611061565b6109ac565b600754610279906001600160a01b031681565b61024161037f366004610edf565b610b66565b610241610392366004610edf565b610ba4565b60006001600160e01b03198216637965db0b60e01b14806103c857506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260016020819052604090912001546103ea81610cef565b6103f48383610cf9565b50505050565b6001600160a01b03811633146104235760405163334bd91960e11b815260040160405180910390fd5b61042d8282610d72565b505050565b336000908152600860205260409020546104865760405162461bcd60e51b815260206004820152601060248201526f6e6f7468696e6720746f20636c61696d60801b60448201526064015b60405180910390fd5b336000908152600860205260408120805482825560019091018054919283926104b090849061112c565b9250508190555080600360008282546104c9919061112c565b90915550506006546004805460405163d4e54c3b60e01b815291820184905260248201523360448201526001600160a01b039091169063d4e54c3b90606401600060405180830381600087803b15801561052257600080fd5b505af1158015610536573d6000803e3d6000fd5b505060408051338152602081018590527fba8de60c3403ec381d1d484652ea1980e3c3e56359195c92525bff4ce47ad98e93500190505b60405180910390a150565b610580610ddf565b61058a6000610e0c565b565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6105bf610ddf565b60048190556040518181527f0a6947e81b8d02192a37cb96e5cb75f1529d39e492eba73613b27771494b74699060200161056d565b6105fc610ddf565b6000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114610649576040519150601f19603f3d011682016040523d82523d6000602084013e61064e565b606091505b50509050806106965760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640161047d565b604080518481526001600160a01b03841660208201527fb95ce40c39aef9e414c197f4539ad5019fff944d1e4fd151d9bb3524877c1aab91015b60405180910390a1505050565b6106e5610ddf565b60055460065460405163095ea7b360e01b81526001600160a01b0391821660048201526000602482015291169063095ea7b3906044016020604051808303816000875af115801561073a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075e919061114d565b50600680546001600160a01b0319166001600160a01b0383811691821790925560055460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b3906044016020604051808303816000875af11580156107ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ee919061114d565b506040516001600160a01b03821681527f0927ef649a08b3f317d1dc814404dc648792deea5634d66f8d0879ced04d396c9060200161056d565b610830610ddf565b60405163a9059cbb60e01b81526001600160a01b0382811660048301526024820184905284169063a9059cbb906044016020604051808303816000875af115801561087f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a3919061114d565b50604080516001600160a01b038086168252602082018590528316918101919091527f4329db93344fec3c889395d5223b9264cbcc50fd16e51269185e53c1cd8e8881906060016106d0565b6108f7610ddf565b600754604051639c809ff760e01b8152600481018390526001600160a01b0390911690639c809ff790602401600060405180830381600087803b15801561093d57600080fd5b505af1158015610951573d6000803e3d6000fd5b505050507fa57e23d32abb8a5241e8ca8da51d25693839ea4f01de5953f894f3f67ef518958160405161056d91815260200190565b600082815260016020819052604090912001546109a281610cef565b6103f48383610d72565b6109b4610ddf565b81518351146109c257600080fd5b60005b83518110156103f4578281815181106109e0576109e061116f565b6020026020010151600860008684815181106109fe576109fe61116f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000016000828254610a38919061112c565b92505081905550828181518110610a5157610a5161116f565b602002602001015160086000868481518110610a6f57610a6f61116f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002016000828254610aa9919061112c565b925050819055507f2e1f391495bcedd0beca3409fe0517bdfb08420bbb73226a493974bb6e6c2695848281518110610ae357610ae361116f565b6020026020010151848381518110610afd57610afd61116f565b602090810291909101810151604080516001600160a01b03909416845291830152810184905260600160405180910390a1828181518110610b4057610b4061116f565b602002602001015160026000828254610b59919061112c565b90915550506001016109c5565b610b6e610ddf565b6001600160a01b038116610b9857604051631e4fbdf760e01b81526000600482015260240161047d565b610ba181610e0c565b50565b610bac610ddf565b60055460075460405163095ea7b360e01b81526001600160a01b0391821660048201526000602482015291169063095ea7b3906044016020604051808303816000875af1158015610c01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c25919061114d565b50600780546001600160a01b0319166001600160a01b0383811691821790925560055460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b3906044016020604051808303816000875af1158015610c91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb5919061114d565b506040516001600160a01b03821681527fcec52196e972044edde8689a1b608e459c5946b7f3e5c8cd3d6d8e126d422e1c9060200161056d565b610ba18133610e5c565b6000610d05838361058c565b610d6a5760008381526001602081815260408084206001600160a01b0387168086529252808420805460ff19169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45060016103c8565b5060006103c8565b6000610d7e838361058c565b15610d6a5760008381526001602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016103c8565b6000546001600160a01b0316331461058a5760405163118cdaa760e01b815233600482015260240161047d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610e66828261058c565b610e955760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161047d565b5050565b600060208284031215610eab57600080fd5b81356001600160e01b031981168114610ec357600080fd5b9392505050565b6001600160a01b0381168114610ba157600080fd5b600060208284031215610ef157600080fd5b8135610ec381610eca565b600060208284031215610f0e57600080fd5b5035919050565b60008060408385031215610f2857600080fd5b823591506020830135610f3a81610eca565b809150509250929050565b600080600060608486031215610f5a57600080fd5b8335610f6581610eca565b9250602084013591506040840135610f7c81610eca565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610fc657610fc6610f87565b604052919050565b600067ffffffffffffffff821115610fe857610fe8610f87565b5060051b60200190565b600082601f83011261100357600080fd5b8135602061101861101383610fce565b610f9d565b8083825260208201915060208460051b87010193508684111561103a57600080fd5b602086015b84811015611056578035835291830191830161103f565b509695505050505050565b60008060006060848603121561107657600080fd5b833567ffffffffffffffff8082111561108e57600080fd5b818601915086601f8301126110a257600080fd5b813560206110b261101383610fce565b82815260059290921b8401810191818101908a8411156110d157600080fd5b948201945b838610156110f85785356110e981610eca565b825294820194908201906110d6565b9750508701359250508082111561110e57600080fd5b5061111b86828701610ff2565b925050604084013590509250925092565b808201808211156103c857634e487b7160e01b600052601160045260246000fd5b60006020828403121561115f57600080fd5b81518015158114610ec357600080fd5b634e487b7160e01b600052603260045260246000fdfea26469706673582212203595b1bac5a91b1b0cfd60665be02ed126fa962c3719dbb2c96265f58e9e169164736f6c63430008180033000000000000000000000000c68f07001a8b67f2cf40ce04e974e4b4a5e0afbe

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101735760003560e01c806391d14854116100de578063c0cfdbfd11610097578063da849f1211610071578063da849f121461034b578063da888fae1461035e578063f2fde38b14610371578063fca3b5aa1461038457600080fd5b8063c0cfdbfd1461031c578063d547741f1461032f578063d54ad2a11461034257600080fd5b806391d14854146102b5578063953c9533146102c85780639662ae6f146102db578063a217fddf146102ee578063ab58eb97146102f6578063b245b4641461030957600080fd5b806336568abe1161013057806336568abe14610243578063372500ab14610256578063715018a61461025e5780637599e8fc14610266578063897feb19146102915780638da5cb5b146102a457600080fd5b806301ffc9a714610178578063067b23c3146101a05780631959a002146101b7578063248a9ca31461020157806326949984146102255780632f2ff15d1461022e575b600080fd5b61018b610186366004610e99565b610397565b60405190151581526020015b60405180910390f35b6101a960025481565b604051908152602001610197565b6101e66101c5366004610edf565b60086020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610197565b6101a961020f366004610efc565b6000908152600160208190526040909120015490565b6101a960045481565b61024161023c366004610f15565b6103ce565b005b610241610251366004610f15565b6103fa565b610241610432565b610241610578565b600554610279906001600160a01b031681565b6040516001600160a01b039091168152602001610197565b600654610279906001600160a01b031681565b6000546001600160a01b0316610279565b61018b6102c3366004610f15565b61058c565b6102416102d6366004610efc565b6105b7565b6102416102e9366004610f15565b6105f4565b6101a9600081565b610241610304366004610edf565b6106dd565b610241610317366004610f45565b610828565b61024161032a366004610efc565b6108ef565b61024161033d366004610f15565b610986565b6101a960035481565b610241610359366004611061565b6109ac565b600754610279906001600160a01b031681565b61024161037f366004610edf565b610b66565b610241610392366004610edf565b610ba4565b60006001600160e01b03198216637965db0b60e01b14806103c857506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260016020819052604090912001546103ea81610cef565b6103f48383610cf9565b50505050565b6001600160a01b03811633146104235760405163334bd91960e11b815260040160405180910390fd5b61042d8282610d72565b505050565b336000908152600860205260409020546104865760405162461bcd60e51b815260206004820152601060248201526f6e6f7468696e6720746f20636c61696d60801b60448201526064015b60405180910390fd5b336000908152600860205260408120805482825560019091018054919283926104b090849061112c565b9250508190555080600360008282546104c9919061112c565b90915550506006546004805460405163d4e54c3b60e01b815291820184905260248201523360448201526001600160a01b039091169063d4e54c3b90606401600060405180830381600087803b15801561052257600080fd5b505af1158015610536573d6000803e3d6000fd5b505060408051338152602081018590527fba8de60c3403ec381d1d484652ea1980e3c3e56359195c92525bff4ce47ad98e93500190505b60405180910390a150565b610580610ddf565b61058a6000610e0c565b565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6105bf610ddf565b60048190556040518181527f0a6947e81b8d02192a37cb96e5cb75f1529d39e492eba73613b27771494b74699060200161056d565b6105fc610ddf565b6000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114610649576040519150601f19603f3d011682016040523d82523d6000602084013e61064e565b606091505b50509050806106965760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640161047d565b604080518481526001600160a01b03841660208201527fb95ce40c39aef9e414c197f4539ad5019fff944d1e4fd151d9bb3524877c1aab91015b60405180910390a1505050565b6106e5610ddf565b60055460065460405163095ea7b360e01b81526001600160a01b0391821660048201526000602482015291169063095ea7b3906044016020604051808303816000875af115801561073a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075e919061114d565b50600680546001600160a01b0319166001600160a01b0383811691821790925560055460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b3906044016020604051808303816000875af11580156107ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ee919061114d565b506040516001600160a01b03821681527f0927ef649a08b3f317d1dc814404dc648792deea5634d66f8d0879ced04d396c9060200161056d565b610830610ddf565b60405163a9059cbb60e01b81526001600160a01b0382811660048301526024820184905284169063a9059cbb906044016020604051808303816000875af115801561087f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a3919061114d565b50604080516001600160a01b038086168252602082018590528316918101919091527f4329db93344fec3c889395d5223b9264cbcc50fd16e51269185e53c1cd8e8881906060016106d0565b6108f7610ddf565b600754604051639c809ff760e01b8152600481018390526001600160a01b0390911690639c809ff790602401600060405180830381600087803b15801561093d57600080fd5b505af1158015610951573d6000803e3d6000fd5b505050507fa57e23d32abb8a5241e8ca8da51d25693839ea4f01de5953f894f3f67ef518958160405161056d91815260200190565b600082815260016020819052604090912001546109a281610cef565b6103f48383610d72565b6109b4610ddf565b81518351146109c257600080fd5b60005b83518110156103f4578281815181106109e0576109e061116f565b6020026020010151600860008684815181106109fe576109fe61116f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000016000828254610a38919061112c565b92505081905550828181518110610a5157610a5161116f565b602002602001015160086000868481518110610a6f57610a6f61116f565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002016000828254610aa9919061112c565b925050819055507f2e1f391495bcedd0beca3409fe0517bdfb08420bbb73226a493974bb6e6c2695848281518110610ae357610ae361116f565b6020026020010151848381518110610afd57610afd61116f565b602090810291909101810151604080516001600160a01b03909416845291830152810184905260600160405180910390a1828181518110610b4057610b4061116f565b602002602001015160026000828254610b59919061112c565b90915550506001016109c5565b610b6e610ddf565b6001600160a01b038116610b9857604051631e4fbdf760e01b81526000600482015260240161047d565b610ba181610e0c565b50565b610bac610ddf565b60055460075460405163095ea7b360e01b81526001600160a01b0391821660048201526000602482015291169063095ea7b3906044016020604051808303816000875af1158015610c01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c25919061114d565b50600780546001600160a01b0319166001600160a01b0383811691821790925560055460405163095ea7b360e01b8152600481019290925260001960248301529091169063095ea7b3906044016020604051808303816000875af1158015610c91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb5919061114d565b506040516001600160a01b03821681527fcec52196e972044edde8689a1b608e459c5946b7f3e5c8cd3d6d8e126d422e1c9060200161056d565b610ba18133610e5c565b6000610d05838361058c565b610d6a5760008381526001602081815260408084206001600160a01b0387168086529252808420805460ff19169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45060016103c8565b5060006103c8565b6000610d7e838361058c565b15610d6a5760008381526001602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016103c8565b6000546001600160a01b0316331461058a5760405163118cdaa760e01b815233600482015260240161047d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610e66828261058c565b610e955760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161047d565b5050565b600060208284031215610eab57600080fd5b81356001600160e01b031981168114610ec357600080fd5b9392505050565b6001600160a01b0381168114610ba157600080fd5b600060208284031215610ef157600080fd5b8135610ec381610eca565b600060208284031215610f0e57600080fd5b5035919050565b60008060408385031215610f2857600080fd5b823591506020830135610f3a81610eca565b809150509250929050565b600080600060608486031215610f5a57600080fd5b8335610f6581610eca565b9250602084013591506040840135610f7c81610eca565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610fc657610fc6610f87565b604052919050565b600067ffffffffffffffff821115610fe857610fe8610f87565b5060051b60200190565b600082601f83011261100357600080fd5b8135602061101861101383610fce565b610f9d565b8083825260208201915060208460051b87010193508684111561103a57600080fd5b602086015b84811015611056578035835291830191830161103f565b509695505050505050565b60008060006060848603121561107657600080fd5b833567ffffffffffffffff8082111561108e57600080fd5b818601915086601f8301126110a257600080fd5b813560206110b261101383610fce565b82815260059290921b8401810191818101908a8411156110d157600080fd5b948201945b838610156110f85785356110e981610eca565b825294820194908201906110d6565b9750508701359250508082111561110e57600080fd5b5061111b86828701610ff2565b925050604084013590509250925092565b808201808211156103c857634e487b7160e01b600052601160045260246000fd5b60006020828403121561115f57600080fd5b81518015158114610ec357600080fd5b634e487b7160e01b600052603260045260246000fdfea26469706673582212203595b1bac5a91b1b0cfd60665be02ed126fa962c3719dbb2c96265f58e9e169164736f6c63430008180033

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

000000000000000000000000c68f07001a8b67f2cf40ce04e974e4b4a5e0afbe

-----Decoded View---------------
Arg [0] : _minterUpgradable (address): 0xC68F07001A8b67f2cf40CE04e974e4b4a5e0AfBe

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


Block Transaction 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
[ 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.