ETH Price: $3,406.91 (-1.62%)
Gas: 9 Gwei

Contract

0x91E485705CB9fEfde7b9AFCf90766E78EA2cc62c
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Claim190631542024-01-22 15:27:59162 days ago1705937279IN
0x91E48570...8EA2cc62c
0 ETH0.0028079728.49667653
Distribute187525932023-12-10 1:39:59205 days ago1702172399IN
0x91E48570...8EA2cc62c
0 ETH0.003206323.31651662
Distribute186859982023-11-30 17:46:47214 days ago1701366407IN
0x91E48570...8EA2cc62c
0 ETH0.0036684926.67764797
Distribute186781022023-11-29 15:16:47216 days ago1701271007IN
0x91E48570...8EA2cc62c
0 ETH0.009150566.54333544
Distribute186708092023-11-28 14:46:47217 days ago1701182807IN
0x91E48570...8EA2cc62c
0 ETH0.0089396465.00992944
Distribute186636372023-11-27 14:41:11218 days ago1701096071IN
0x91E48570...8EA2cc62c
0 ETH0.005459939.70497048
Distribute186563562023-11-26 14:11:11219 days ago1701007871IN
0x91E48570...8EA2cc62c
0 ETH0.0034397325.01407152
Distribute186490732023-11-25 13:41:11220 days ago1700919671IN
0x91E48570...8EA2cc62c
0 ETH0.0036650823.70503299
Claim185486832023-11-11 12:26:59234 days ago1699705619IN
0x91E48570...8EA2cc62c
0 ETH0.001754820.61681947
Claim185486812023-11-11 12:26:35234 days ago1699705595IN
0x91E48570...8EA2cc62c
0 ETH0.0020670619.57505454
Claim184327282023-10-26 6:52:59250 days ago1698303179IN
0x91E48570...8EA2cc62c
0 ETH0.0013974813.7870754
Claim184327262023-10-26 6:52:35250 days ago1698303155IN
0x91E48570...8EA2cc62c
0 ETH0.0012492314.11609228
Distribute184129882023-10-23 12:32:23253 days ago1698064343IN
0x91E48570...8EA2cc62c
0 ETH0.0022973416.70650679
Claim184113242023-10-23 6:54:47253 days ago1698044087IN
0x91E48570...8EA2cc62c
0 ETH0.000765839.93618082
Claim184113162023-10-23 6:53:11253 days ago1698043991IN
0x91E48570...8EA2cc62c
0 ETH0.001112658.43665131
Distribute184057102023-10-22 12:02:23254 days ago1697976143IN
0x91E48570...8EA2cc62c
0 ETH0.001095937.96975138
Distribute183984072023-10-21 11:32:23255 days ago1697887943IN
0x91E48570...8EA2cc62c
0 ETH0.001109148.06580047
Claim183958412023-10-21 2:55:11255 days ago1697856911IN
0x91E48570...8EA2cc62c
0 ETH0.000362326.04121396
Claim183958372023-10-21 2:54:23255 days ago1697856863IN
0x91E48570...8EA2cc62c
0 ETH0.000644736.60020684
Claim183950752023-10-21 0:20:35255 days ago1697847635IN
0x91E48570...8EA2cc62c
0 ETH0.000623398.0881917
Claim183950722023-10-21 0:19:59255 days ago1697847599IN
0x91E48570...8EA2cc62c
0 ETH0.000764427.8255146
Distribute183911102023-10-20 11:02:23256 days ago1697799743IN
0x91E48570...8EA2cc62c
0 ETH0.0021317113.78751586
Claim183903602023-10-20 8:31:11256 days ago1697790671IN
0x91E48570...8EA2cc62c
0 ETH0.000766379.94320747
Claim183899242023-10-20 7:02:59256 days ago1697785379IN
0x91E48570...8EA2cc62c
0 ETH0.000827717.21106615
Distribute183839442023-10-19 11:01:11257 days ago1697713271IN
0x91E48570...8EA2cc62c
0 ETH0.000965617.02207267
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xfD2832E6...77fb041dA
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
EGMCShareholderPool

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : EGMCShareholderPool.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.19;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

import "./interfaces/IEGMC.sol";
import "./interfaces/IEGMCShareholderDistributor.sol";

contract EGMCShareholderPool is Ownable, ERC1155Holder {
    using SafeMath for uint;
    using SafeERC20 for IERC20;

    IERC20 public immutable token;
    IERC20 public immutable lpToken;
    IERC1155 public nft;

    uint private constant REWARD_FACTOR_ACCURACY = 1_000_000_000_000 ether;

    address public shareholderDistributor;
    uint public allTimeTokenRewards;
    uint public allTimeTokenRewardsClaimed;
    uint public allTimeLpRewards;
    uint public allTimeLpRewardsClaimed;
    uint public totalStaked;
    uint public currentTokenRewardFactor;
    uint public currentLpRewardFactor;
    bool public isDepositingEnabled;

    struct User {
        uint tokenRewardFactor;
        uint tokenHeldRewards;
        uint lpRewardFactor;
        uint lpHeldRewards;
        uint staked;
    }

    mapping(address => User) private _users;
    mapping(address => bool) private _whitelisted;

    event DepositingEnabled();
    event DepositingDisabled();
    event Deposit(address user, uint amount);
    event Withdraw(address user, uint amount);
    event Claimed(address user, uint tokenRewards, uint lpRewards);
    event Distributed(uint tokenRewards, uint lpRewards, uint totalStaked);

    constructor (
        address _token,
        address _nft
    ) {
        token = IERC20(_token);
        lpToken = IERC20(IEGMC(_token).uniswapV2Pair());
        nft = IERC1155(_nft);

        _whitelisted[_msgSender()] = true;
    }

    /** VIEW FUNCTIONS */

    function getAmounts() external view returns (uint tokenAmount, uint lpAmount) {
        (lpAmount, , tokenAmount) = IEGMCShareholderDistributor(shareholderDistributor).getAmounts();
    }

    function getStake(address _user) external view returns (uint) {
        return _users[_user].staked;
    }

    function getReward(address _user) external view returns (uint tokenReward, uint lpReward) {
        tokenReward = _getTokenHeldRewards(_user) + _getTokenCalculatedRewards(_user);
        lpReward = _getLpHeldRewards(_user) + _getLpCalculatedRewards(_user);
    }

    function _getTokenHeldRewards(address _user) private view returns (uint) {
        return _users[_user].tokenHeldRewards;
    }

    function _getLpHeldRewards(address _user) private view returns (uint) {
        return _users[_user].lpHeldRewards;
    }

    function _getTokenCalculatedRewards(address _user) private view returns (uint) {
        uint balance = _users[_user].staked;
        return balance * (currentTokenRewardFactor - _users[_user].tokenRewardFactor) / REWARD_FACTOR_ACCURACY;
    }

    function _getLpCalculatedRewards(address _user) private view returns (uint) {
        uint balance = _users[_user].staked;
        return balance * (currentLpRewardFactor - _users[_user].lpRewardFactor) / REWARD_FACTOR_ACCURACY;
    }

    function _mergeRewards(address _account) private {
        _holdCalculatedRewards(_account);
        _users[_account].tokenRewardFactor = currentTokenRewardFactor;
        _users[_account].lpRewardFactor = currentLpRewardFactor;
    }

    function _holdCalculatedRewards(address _account) private {
        uint calculatedTokenReward = _getTokenCalculatedRewards(_account);
        if (calculatedTokenReward > 0) {
            _users[_account].tokenHeldRewards += calculatedTokenReward;
        }

        uint calculatedLpReward = _getLpCalculatedRewards(_account);
        if (calculatedLpReward > 0) {
            _users[_account].lpHeldRewards += calculatedLpReward;
        }
    }

    /** INTERNAL FUNCTIONS */

    function _distribute() internal {
        if (totalStaked > 0) {
            (uint lpAmount, uint tokenAmount) = IEGMCShareholderDistributor(shareholderDistributor).distribute();

            if (tokenAmount > 0) {
                allTimeTokenRewards += tokenAmount;
                currentTokenRewardFactor += REWARD_FACTOR_ACCURACY * tokenAmount / totalStaked;
            }

            if (lpAmount > 0) {
                allTimeLpRewards += lpAmount;
                currentLpRewardFactor += REWARD_FACTOR_ACCURACY * lpAmount / totalStaked;
            }

            emit Distributed(tokenAmount, lpAmount, totalStaked);
        }
    }

    function _deposit(address _user, uint _amount, bool _transfer) internal {
        require(isDepositingEnabled, "Depositing is not allowed at this time");

        _mergeRewards(_user);
        _users[_user].staked += _amount;
        totalStaked += _amount;
        
        if (_transfer) {
            nft.safeTransferFrom(_user, address(this), 1, _amount, "");
        }

        emit Deposit(_user, _amount);
    }

    /** EXTERNAL FUNCTIONS */

    function deposit(uint _amount) external {
        _deposit(_msgSender(), _amount, true);
    }

    function depositFor(address _user, uint _amount) external {
        require(_msgSender() == address(nft), "Only the NFT contract can call this function");
        _deposit(_user, _amount, false);
    }

    function withdraw(uint _amount) external {
        User storage user = _users[_msgSender()];
        require(_amount > 0, "Amount to withdraw must be greater than zero");
        require(_amount <= user.staked, "Amount exceeds staked");

        _mergeRewards(_msgSender());
        _users[_msgSender()].staked -= _amount;
        totalStaked -= _amount;
        nft.safeTransferFrom(address(this), _msgSender(), 1, _amount, "");

        emit Withdraw(_msgSender(), _amount);
    }

    function claim(uint action) external {
        require(action > 0 && action <= 3, "Invalid action parameter");
        _mergeRewards(_msgSender());

        uint tokenHeldRewards;
        if (action == 1 || action == 3) {
            tokenHeldRewards = _users[_msgSender()].tokenHeldRewards;
            if (tokenHeldRewards > 0) {
                _users[_msgSender()].tokenHeldRewards = 0;
                allTimeTokenRewardsClaimed += tokenHeldRewards;
                token.safeTransfer(_msgSender(), tokenHeldRewards);
            }
        }

        uint lpHeldRewards;
        if (action == 2 || action == 3) {
            lpHeldRewards = _users[_msgSender()].lpHeldRewards;
            if (lpHeldRewards > 0) {
                _users[_msgSender()].lpHeldRewards = 0;
                allTimeLpRewardsClaimed += lpHeldRewards;
                lpToken.safeTransfer(_msgSender(), lpHeldRewards);
            }
        }

        emit Claimed(_msgSender(), tokenHeldRewards, lpHeldRewards);
    }

    /** RESTRICTED FUNCTIONS */

    function distribute() external {
        require(_whitelisted[_msgSender()], "Caller is not whitelisted!");
        _distribute();
    }

    function enableDepositing() external onlyOwner {
        require(!isDepositingEnabled, "Depositing is already enabled");
        isDepositingEnabled = true;
        emit DepositingEnabled();
    }

    function disableDepositing() external onlyOwner {
        require(isDepositingEnabled, "Depositing is already disabled");
        isDepositingEnabled = false;
        emit DepositingDisabled();
    }

    function setShareholderDistributor(address _distributor) external onlyOwner {
        shareholderDistributor = _distributor;
    }

    function setWhitelist(address _account, bool _enabled) external onlyOwner {
        _whitelisted[_account] = _enabled;
    }

    function recover(address _token) external onlyOwner {
        IERC20(_token).transfer(owner(), IERC20(_token).balanceOf(address(this)));
    }
}

File 2 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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 16 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 4 of 16 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 5 of 16 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 6 of 16 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

File 7 of 16 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 */
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].
     */
    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 8 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

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

File 9 of 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../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 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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 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);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

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

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

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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.isContract(address(token));
    }
}

File 10 of 16 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @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, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * 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.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @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`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
        }
    }
}

File 11 of 16 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 12 of 16 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 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);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 13 of 16 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * 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[EIP 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);
}

File 14 of 16 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

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

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 15 of 16 : IEGMC.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IEGMC is IERC20 {
    function uniswapV2Router() external view returns (address);
    function uniswapV2Pair() external view returns (address);
    function WETH() external view returns (address);

    function liquidityWallet() external view returns (address);
}

File 16 of 16 : IEGMCShareholderDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IEGMCShareholderDistributor {
    function getAmounts() external view returns (uint lpAmount, uint devAmount, uint tokenAmount);
    function distribute() external returns (uint lpAmount, uint tokenAmount);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_nft","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpRewards","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[],"name":"DepositingDisabled","type":"event"},{"anonymous":false,"inputs":[],"name":"DepositingEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalStaked","type":"uint256"}],"name":"Distributed","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":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"allTimeLpRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allTimeLpRewardsClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allTimeTokenRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allTimeTokenRewardsClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"action","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentLpRewardFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTokenRewardFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableDepositing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableDepositing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAmounts","outputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"uint256","name":"lpAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getReward","outputs":[{"internalType":"uint256","name":"tokenReward","type":"uint256"},{"internalType":"uint256","name":"lpReward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isDepositingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"contract IERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_distributor","type":"address"}],"name":"setShareholderDistributor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shareholderDistributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","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":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c8063715018a61161010f578063c00007b0116100a2578063ec81532a11610071578063ec81532a14610500578063f23a6e611461051e578063f2fde38b1461054e578063fc0c546a1461056a576101e5565b8063c00007b014610489578063c19cccc9146104ba578063c6d21b65146104d8578063e4fc6b6d146104f6576101e5565b8063927733c9116100de578063927733c914610415578063a5d87d6c14610433578063b6b55f251461043d578063bc197c8114610459576101e5565b8063715018a61461039f5780637a766460146103a9578063817b1cd2146103d95780638da5cb5b146103f7576101e5565b80632f4f21e21161018757806347ccca021161015657806347ccca021461032957806353d6fd59146103475780635fcbd2851461036357806363b111d314610381576101e5565b80632f4f21e2146102b4578063379607f5146102d05780633d370b4e146102ec578063432954c31461030b576101e5565b80630c3ed413116101c35780630c3ed413146102405780630cd865ec1461025e5780631a16fb471461027a5780632e1a7d4d14610298576101e5565b806301ffc9a7146101ea57806304d7ba151461021a57806307ed4ac914610224575b600080fd5b61020460048036038101906101ff9190611e9b565b610588565b6040516102119190611ee3565b60405180910390f35b610222610602565b005b61023e60048036038101906102399190611f5c565b6106a3565b005b6102486106ef565b6040516102559190611fa2565b60405180910390f35b61027860048036038101906102739190611f5c565b6106f5565b005b6102826107ff565b60405161028f9190611fa2565b60405180910390f35b6102b260048036038101906102ad9190611fe9565b610805565b005b6102ce60048036038101906102c99190612016565b610a41565b005b6102ea60048036038101906102e59190611fe9565b610ae8565b005b6102f4610ddd565b604051610302929190612056565b60405180910390f35b610313610e7f565b604051610320919061208e565b60405180910390f35b610331610ea5565b60405161033e9190612108565b60405180910390f35b610361600480360381019061035c919061214f565b610ecb565b005b61036b610f2e565b60405161037891906121b0565b60405180910390f35b610389610f52565b6040516103969190611fa2565b60405180910390f35b6103a7610f58565b005b6103c360048036038101906103be9190611f5c565b610f6c565b6040516103d09190611fa2565b60405180910390f35b6103e1610fb8565b6040516103ee9190611fa2565b60405180910390f35b6103ff610fbe565b60405161040c919061208e565b60405180910390f35b61041d610fe7565b60405161042a9190611fa2565b60405180910390f35b61043b610fed565b005b61045760048036038101906104529190611fe9565b61108d565b005b610473600480360381019061046e91906123d9565b6110a3565b60405161048091906124b7565b60405180910390f35b6104a3600480360381019061049e9190611f5c565b6110b8565b6040516104b1929190612056565b60405180910390f35b6104c26110fc565b6040516104cf9190611fa2565b60405180910390f35b6104e0611102565b6040516104ed9190611fa2565b60405180910390f35b6104fe611108565b005b6105086111a5565b6040516105159190611ee3565b60405180910390f35b610538600480360381019061053391906124d2565b6111b8565b60405161054591906124b7565b60405180910390f35b61056860048036038101906105639190611f5c565b6111cd565b005b610572611250565b60405161057f91906121b0565b60405180910390f35b60007f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806105fb57506105fa82611274565b5b9050919050565b61060a6112de565b600a60009054906101000a900460ff161561065a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610651906125c6565b60405180910390fd5b6001600a60006101000a81548160ff0219169083151502179055507f8d8235615e2606a7fbb90e968cf1f1d51deafcb5ec8e6c339883b812cf5e0c0c60405160405180910390a1565b6106ab6112de565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b6106fd6112de565b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb610721610fbe565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161075a919061208e565b602060405180830381865afa158015610777573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079b91906125fb565b6040518363ffffffff1660e01b81526004016107b8929190612628565b6020604051808303816000875af11580156107d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fb9190612666565b5050565b60085481565b6000600b600061081361135c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008211610892576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088990612705565b60405180910390fd5b80600401548211156108d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d090612771565b60405180910390fd5b6108e96108e461135c565b611364565b81600b60006108f661135c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600082825461094291906127c0565b92505081905550816007600082825461095b91906127c0565b92505081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a306109a961135c565b6001866040518563ffffffff1660e01b81526004016109cb9493929190612866565b600060405180830381600087803b1580156109e557600080fd5b505af11580156109f9573d6000803e3d6000fd5b505050507f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364610a2661135c565b83604051610a35929190612628565b60405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a8261135c565b73ffffffffffffffffffffffffffffffffffffffff1614610ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acf90612930565b60405180910390fd5b610ae482826000611402565b5050565b600081118015610af9575060038111155b610b38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2f9061299c565b60405180910390fd5b610b48610b4361135c565b611364565b60006001821480610b595750600382145b15610c6f57600b6000610b6a61135c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490506000811115610c6e576000600b6000610bc161135c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055508060046000828254610c1491906129bc565b92505081905550610c6d610c2661135c565b827f000000000000000000000000f70e5e46a50bba54917d9cb7aeb8b83610bcd96973ffffffffffffffffffffffffffffffffffffffff166115a59092919063ffffffff16565b5b5b60006002831480610c805750600383145b15610d9657600b6000610c9161135c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015490506000811115610d95576000600b6000610ce861135c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055508060066000828254610d3b91906129bc565b92505081905550610d94610d4d61135c565b827f00000000000000000000000016bba14e417f63202f394986d6c811fa1b81357473ffffffffffffffffffffffffffffffffffffffff166115a59092919063ffffffff16565b5b5b7f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a610dbf61135c565b8383604051610dd0939291906129f0565b60405180910390a1505050565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633d370b4e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612a27565b905080935081925050509091565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ed36112de565b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b7f00000000000000000000000016bba14e417f63202f394986d6c811fa1b81357481565b60095481565b610f606112de565b610f6a600061162b565b565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401549050919050565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60045481565b610ff56112de565b600a60009054906101000a900460ff16611044576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103b90612ac6565b60405180910390fd5b6000600a60006101000a81548160ff0219169083151502179055507f1d2df1f82541c9ce547cfbcb99cb9ea10d959f53ca0c7b47e17640932dadc42060405160405180910390a1565b6110a061109861135c565b826001611402565b50565b600063bc197c8160e01b905095945050505050565b6000806110c4836116ef565b6110cd846117b2565b6110d791906129bc565b91506110e2836117fe565b6110eb846118c1565b6110f591906129bc565b9050915091565b60035481565b60055481565b600c600061111461135c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661119b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119290612b32565b60405180910390fd5b6111a361190d565b565b600a60009054906101000a900460ff1681565b600063f23a6e6160e01b905095945050505050565b6111d56112de565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123b90612bc4565b60405180910390fd5b61124d8161162b565b50565b7f000000000000000000000000f70e5e46a50bba54917d9cb7aeb8b83610bcd96981565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6112e661135c565b73ffffffffffffffffffffffffffffffffffffffff16611304610fbe565b73ffffffffffffffffffffffffffffffffffffffff161461135a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135190612c30565b60405180910390fd5b565b600033905090565b61136d81611ab5565b600854600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600954600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555050565b600a60009054906101000a900460ff16611451576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144890612cc2565b60405180910390fd5b61145a83611364565b81600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282546114ac91906129bc565b9250508190555081600760008282546114c591906129bc565b92505081905550801561156757600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a84306001866040518563ffffffff1660e01b81526004016115349493929190612866565b600060405180830381600087803b15801561154e57600080fd5b505af1158015611562573d6000803e3d6000fd5b505050505b7fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8383604051611598929190612628565b60405180910390a1505050565b6116268363a9059cbb60e01b84846040516024016115c4929190612628565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611b9a565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015490506c0c9f2c9cd04674edea40000000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015460085461179591906127c0565b826117a09190612ce2565b6117aa9190612d53565b915050919050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b600080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015490506c0c9f2c9cd04674edea40000000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546009546118a491906127c0565b826118af9190612ce2565b6118b99190612d53565b915050919050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549050919050565b60006007541115611ab357600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e4fc6b6d6040518163ffffffff1660e01b815260040160408051808303816000875af1158015611989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ad9190612d84565b915091506000811115611a125780600360008282546119cc91906129bc565b92505081905550600754816c0c9f2c9cd04674edea400000006119ef9190612ce2565b6119f99190612d53565b60086000828254611a0a91906129bc565b925050819055505b6000821115611a73578160056000828254611a2d91906129bc565b92505081905550600754826c0c9f2c9cd04674edea40000000611a509190612ce2565b611a5a9190612d53565b60096000828254611a6b91906129bc565b925050819055505b7fc5d35a65af09b3042394b742529d10f7fbf9a37294d6b13e4d63d06f9909a15b8183600754604051611aa893929190612dc4565b60405180910390a150505b565b6000611ac0826116ef565b90506000811115611b255780600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254611b1d91906129bc565b925050819055505b6000611b30836117fe565b90506000811115611b955780600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000828254611b8d91906129bc565b925050819055505b505050565b6000611bfc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611c629092919063ffffffff16565b9050600081511480611c1e575080806020019051810190611c1d9190612666565b5b611c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5490612e6d565b60405180910390fd5b505050565b6060611c718484600085611c7a565b90509392505050565b606082471015611cbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb690612eff565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611ce89190612f90565b60006040518083038185875af1925050503d8060008114611d25576040519150601f19603f3d011682016040523d82523d6000602084013e611d2a565b606091505b5091509150611d3b87838387611d47565b92505050949350505050565b60608315611da9576000835103611da157611d6185611dbc565b611da0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9790612ff3565b60405180910390fd5b5b829050611db4565b611db38383611ddf565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115611df25781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e269190613057565b60405180910390fd5b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611e7881611e43565b8114611e8357600080fd5b50565b600081359050611e9581611e6f565b92915050565b600060208284031215611eb157611eb0611e39565b5b6000611ebf84828501611e86565b91505092915050565b60008115159050919050565b611edd81611ec8565b82525050565b6000602082019050611ef86000830184611ed4565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f2982611efe565b9050919050565b611f3981611f1e565b8114611f4457600080fd5b50565b600081359050611f5681611f30565b92915050565b600060208284031215611f7257611f71611e39565b5b6000611f8084828501611f47565b91505092915050565b6000819050919050565b611f9c81611f89565b82525050565b6000602082019050611fb76000830184611f93565b92915050565b611fc681611f89565b8114611fd157600080fd5b50565b600081359050611fe381611fbd565b92915050565b600060208284031215611fff57611ffe611e39565b5b600061200d84828501611fd4565b91505092915050565b6000806040838503121561202d5761202c611e39565b5b600061203b85828601611f47565b925050602061204c85828601611fd4565b9150509250929050565b600060408201905061206b6000830185611f93565b6120786020830184611f93565b9392505050565b61208881611f1e565b82525050565b60006020820190506120a3600083018461207f565b92915050565b6000819050919050565b60006120ce6120c96120c484611efe565b6120a9565b611efe565b9050919050565b60006120e0826120b3565b9050919050565b60006120f2826120d5565b9050919050565b612102816120e7565b82525050565b600060208201905061211d60008301846120f9565b92915050565b61212c81611ec8565b811461213757600080fd5b50565b60008135905061214981612123565b92915050565b6000806040838503121561216657612165611e39565b5b600061217485828601611f47565b92505060206121858582860161213a565b9150509250929050565b600061219a826120d5565b9050919050565b6121aa8161218f565b82525050565b60006020820190506121c560008301846121a1565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612219826121d0565b810181811067ffffffffffffffff82111715612238576122376121e1565b5b80604052505050565b600061224b611e2f565b90506122578282612210565b919050565b600067ffffffffffffffff821115612277576122766121e1565b5b602082029050602081019050919050565b600080fd5b60006122a061229b8461225c565b612241565b905080838252602082019050602084028301858111156122c3576122c2612288565b5b835b818110156122ec57806122d88882611fd4565b8452602084019350506020810190506122c5565b5050509392505050565b600082601f83011261230b5761230a6121cb565b5b813561231b84826020860161228d565b91505092915050565b600080fd5b600067ffffffffffffffff821115612344576123436121e1565b5b61234d826121d0565b9050602081019050919050565b82818337600083830152505050565b600061237c61237784612329565b612241565b90508281526020810184848401111561239857612397612324565b5b6123a384828561235a565b509392505050565b600082601f8301126123c0576123bf6121cb565b5b81356123d0848260208601612369565b91505092915050565b600080600080600060a086880312156123f5576123f4611e39565b5b600061240388828901611f47565b955050602061241488828901611f47565b945050604086013567ffffffffffffffff81111561243557612434611e3e565b5b612441888289016122f6565b935050606086013567ffffffffffffffff81111561246257612461611e3e565b5b61246e888289016122f6565b925050608086013567ffffffffffffffff81111561248f5761248e611e3e565b5b61249b888289016123ab565b9150509295509295909350565b6124b181611e43565b82525050565b60006020820190506124cc60008301846124a8565b92915050565b600080600080600060a086880312156124ee576124ed611e39565b5b60006124fc88828901611f47565b955050602061250d88828901611f47565b945050604061251e88828901611fd4565b935050606061252f88828901611fd4565b925050608086013567ffffffffffffffff8111156125505761254f611e3e565b5b61255c888289016123ab565b9150509295509295909350565b600082825260208201905092915050565b7f4465706f736974696e6720697320616c726561647920656e61626c6564000000600082015250565b60006125b0601d83612569565b91506125bb8261257a565b602082019050919050565b600060208201905081810360008301526125df816125a3565b9050919050565b6000815190506125f581611fbd565b92915050565b60006020828403121561261157612610611e39565b5b600061261f848285016125e6565b91505092915050565b600060408201905061263d600083018561207f565b61264a6020830184611f93565b9392505050565b60008151905061266081612123565b92915050565b60006020828403121561267c5761267b611e39565b5b600061268a84828501612651565b91505092915050565b7f416d6f756e7420746f207769746864726177206d75737420626520677265617460008201527f6572207468616e207a65726f0000000000000000000000000000000000000000602082015250565b60006126ef602c83612569565b91506126fa82612693565b604082019050919050565b6000602082019050818103600083015261271e816126e2565b9050919050565b7f416d6f756e742065786365656473207374616b65640000000000000000000000600082015250565b600061275b601583612569565b915061276682612725565b602082019050919050565b6000602082019050818103600083015261278a8161274e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006127cb82611f89565b91506127d683611f89565b92508282039050818111156127ee576127ed612791565b5b92915050565b6000819050919050565b600061281961281461280f846127f4565b6120a9565b611f89565b9050919050565b612829816127fe565b82525050565b600082825260208201905092915050565b50565b600061285060008361282f565b915061285b82612840565b600082019050919050565b600060a08201905061287b600083018761207f565b612888602083018661207f565b6128956040830185612820565b6128a26060830184611f93565b81810360808301526128b381612843565b905095945050505050565b7f4f6e6c7920746865204e465420636f6e74726163742063616e2063616c6c207460008201527f6869732066756e6374696f6e0000000000000000000000000000000000000000602082015250565b600061291a602c83612569565b9150612925826128be565b604082019050919050565b600060208201905081810360008301526129498161290d565b9050919050565b7f496e76616c696420616374696f6e20706172616d657465720000000000000000600082015250565b6000612986601883612569565b915061299182612950565b602082019050919050565b600060208201905081810360008301526129b581612979565b9050919050565b60006129c782611f89565b91506129d283611f89565b92508282019050808211156129ea576129e9612791565b5b92915050565b6000606082019050612a05600083018661207f565b612a126020830185611f93565b612a1f6040830184611f93565b949350505050565b600080600060608486031215612a4057612a3f611e39565b5b6000612a4e868287016125e6565b9350506020612a5f868287016125e6565b9250506040612a70868287016125e6565b9150509250925092565b7f4465706f736974696e6720697320616c72656164792064697361626c65640000600082015250565b6000612ab0601e83612569565b9150612abb82612a7a565b602082019050919050565b60006020820190508181036000830152612adf81612aa3565b9050919050565b7f43616c6c6572206973206e6f742077686974656c697374656421000000000000600082015250565b6000612b1c601a83612569565b9150612b2782612ae6565b602082019050919050565b60006020820190508181036000830152612b4b81612b0f565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612bae602683612569565b9150612bb982612b52565b604082019050919050565b60006020820190508181036000830152612bdd81612ba1565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c1a602083612569565b9150612c2582612be4565b602082019050919050565b60006020820190508181036000830152612c4981612c0d565b9050919050565b7f4465706f736974696e67206973206e6f7420616c6c6f7765642061742074686960008201527f732074696d650000000000000000000000000000000000000000000000000000602082015250565b6000612cac602683612569565b9150612cb782612c50565b604082019050919050565b60006020820190508181036000830152612cdb81612c9f565b9050919050565b6000612ced82611f89565b9150612cf883611f89565b9250828202612d0681611f89565b91508282048414831517612d1d57612d1c612791565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612d5e82611f89565b9150612d6983611f89565b925082612d7957612d78612d24565b5b828204905092915050565b60008060408385031215612d9b57612d9a611e39565b5b6000612da9858286016125e6565b9250506020612dba858286016125e6565b9150509250929050565b6000606082019050612dd96000830186611f93565b612de66020830185611f93565b612df36040830184611f93565b949350505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000612e57602a83612569565b9150612e6282612dfb565b604082019050919050565b60006020820190508181036000830152612e8681612e4a565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000612ee9602683612569565b9150612ef482612e8d565b604082019050919050565b60006020820190508181036000830152612f1881612edc565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015612f53578082015181840152602081019050612f38565b60008484015250505050565b6000612f6a82612f1f565b612f748185612f2a565b9350612f84818560208601612f35565b80840191505092915050565b6000612f9c8284612f5f565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612fdd601d83612569565b9150612fe882612fa7565b602082019050919050565b6000602082019050818103600083015261300c81612fd0565b9050919050565b600081519050919050565b600061302982613013565b6130338185612569565b9350613043818560208601612f35565b61304c816121d0565b840191505092915050565b60006020820190508181036000830152613071818461301e565b90509291505056fea26469706673582212209d6de0aa7dd4e5176dc37aa96c7f123d011ae3bd6a26238265fe30f6ace4514f64736f6c63430008130033

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.