Contract 0x902Aa4cC3b463c84541C9C1DeDF50620C99950B9

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xea26bab6444987666abaf7c9ba68ad42c9249ba8aa830d41c046ed2c6db6ee04Allocate306715982023-05-30 4:11:403 hrs 8 mins ago0x9906cd623dbee156d8deee923733277f0e0ce196 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.004285686 26.5
0xe88393d442b6b2d57b619ae2fd1803aeb496723c176a74202d49abee30a0e93bConvert306715782023-05-30 4:11:003 hrs 9 mins ago0x9906cd623dbee156d8deee923733277f0e0ce196 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.00207177 26.5
0x4701d437469a3abbe697d8a33fef1ed253a760e8f56a6fa6e2f8a6a096004918Allocate306516522023-05-29 16:57:3814 hrs 22 mins ago0x93183c5ebd60958f282e12474c5819af1986f2c6 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.006403036 26.5
0x3a8b397603907f97c448184ccb2ad4fe86638e4b219dc610e3d3529254d2beb2Approve Usage306516382023-05-29 16:57:1014 hrs 23 mins ago0x93183c5ebd60958f282e12474c5819af1986f2c6 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.001369202 26.5
0xa760def6d6ca2283c7eed19204e20262d8d75910fd687ad37eaab19780139cf5Convert306516132023-05-29 16:56:1814 hrs 24 mins ago0x93183c5ebd60958f282e12474c5819af1986f2c6 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.002218297444 26.606585324
0xc89bfff42efb6393a20c35f00a47258593e8c9acdc2b9a7f64cde1fb0dbcb164Allocate306496392023-05-29 15:49:2715 hrs 31 mins ago0x5d31fd753ee902bd71ac6cb2976e68a845dedafd IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.006403354 26.5
0x6f6f9d2aac699d15d44697388943433b8ffcf7c566cdd5258a981d68f9273df2Approve Usage306496272023-05-29 15:49:0515 hrs 31 mins ago0x5d31fd753ee902bd71ac6cb2976e68a845dedafd IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.000841852 26.5
0x04a02690e2ac59317abd8e6d47a277034b5fce1803748d1bee8742fb84029327Approve Usage306496232023-05-29 15:48:5715 hrs 31 mins ago0x5d31fd753ee902bd71ac6cb2976e68a845dedafd IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.001369202 26.5
0x3441ef5e091e9ac01200aa6b3589c3270d90422354c922e0e400b84522570359Convert306495992023-05-29 15:48:0915 hrs 32 mins ago0x5d31fd753ee902bd71ac6cb2976e68a845dedafd IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.002209729 26.5
0x245efe31a2be1e8b72abae8533c7708a10e5c2378fc89893163c82bce924db50Convert306324502023-05-29 6:10:061 day 1 hr ago0x90a4693f3158f9e573dc02601fd22eade5d89a7e IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.00210988827
0x4c35ea5e371c589d3d6143f8d6925ba6b6fadb70508efbc2c169753b427b8463Convert306300022023-05-29 4:47:251 day 2 hrs ago0x79e5cf4cf6640c62d69ef24b813470f780bd9ff0 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.00098444727
0x1517a4826e82952ec29faa7d1b7f34ed873bc8a5b8ec2b47f7e3c3028e1a5df8Convert306299932023-05-29 4:47:071 day 2 hrs ago0x79e5cf4cf6640c62d69ef24b813470f780bd9ff0 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.00211021227
0xfa33c758fc7c967b2cc4908aaff96fef561efa861a93584ec68fef420bdbfaaaRedeem306282272023-05-29 3:47:161 day 3 hrs ago0x182a72b9dd205177ad9c31fafb824195cc69fbe5 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.01176720153 29.365
0x8056843dca5dcfbbcf825060beb8e372a2d1c453a09bcf4f7875e5a79fb38afaConvert306282022023-05-29 3:46:231 day 3 hrs ago0x182a72b9dd205177ad9c31fafb824195cc69fbe5 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.002209729 26.5
0xf25098140ad14d54c3d24179edce1fe783f7abc337ffa47bf95c45efced6b0e8Convert306218642023-05-29 0:10:281 day 7 hrs ago0xf84c67af3bb306f96f040bf7cf0ffe5d70785e63 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.002208775 26.5
0x473e3cd1c5434c10e2b0bf1a1ce960897157943c0f213228e96d9b0715fa9ae8Approve Usage306217422023-05-29 0:06:211 day 7 hrs ago0xf84c67af3bb306f96f040bf7cf0ffe5d70785e63 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.001369202 26.5
0x37c7a0f793de7db68b541ce166819018718424e49743ead174489350b2ae5addAllocate306184822023-05-28 22:16:191 day 9 hrs ago0xe59ebbf4a10493cf5833f69cd142c71ccc72428c IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.004677048 27
0x0058b5fee1b8fa9530f339bb7504c26abd800151ea28e1a9b61c9aa29b66fed7Convert306064522023-05-28 15:30:211 day 15 hrs ago0x7d8e7b7ecd1ef8bd6e7a65dbe57bc91bc4ad0bb3 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.002231129033 26.768194768
0xa8974af84bd71de905d60430cb333227f7a97cbf46045f1e5e44ba1a88c29a24Allocate306022232023-05-28 13:06:281 day 18 hrs ago0xacedd0a9945ca2c2b56cad648de82708108dfa6f IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.005319929086 27.151361092
0xfde57807869831a8ef38279000331174485b5ea1cdf90a9c1a1163b6a3eab9d9Convert306022022023-05-28 13:05:461 day 18 hrs ago0xacedd0a9945ca2c2b56cad648de82708108dfa6f IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.00169916288 27.81864572
0x4d88d31f16c8f1522080982659d6a9777a38bd3384a0ae59822a824dfcf6e43bAllocate305996482023-05-28 11:39:221 day 19 hrs ago0x602ce696902678800d3ee4411c4c9de7e9eb26ba IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.006403354 26.5
0xf6eb2e090e531a63f330a25d34ccbb7c0ddf252a931ae29a88c9f40c52171638Approve Usage305996312023-05-28 11:38:491 day 19 hrs ago0x602ce696902678800d3ee4411c4c9de7e9eb26ba IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.001369202 26.5
0xe2f8ceb512466647eaa6efe00e40846257dc52f0d22b4c44281b72ae3403b0f8Convert305995922023-05-28 11:37:261 day 19 hrs ago0x602ce696902678800d3ee4411c4c9de7e9eb26ba IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.002209729 26.5
0xbe184baa6e97104e50047f1165604f344c3261960892106c2efe0b8886c1ed47Allocate305929352023-05-28 7:54:171 day 23 hrs ago0xf4e6232d2f86bd3399d956b3892d6b1893e1e06e IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.004590436 26.5
0xbb8302f9a5754ff006d7728e75d271924c6b65fca5ce535f23ee56898fecd935Allocate305806442023-05-28 0:57:232 days 6 hrs ago0x5b8fc5053a7627c42894051eb6a5c5ecaed226d3 IN  0x902aa4cc3b463c84541c9c1dedf50620c99950b90 AVAX0.004641882492 26.79699402
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
XSteak

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 2 of 17 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 3 of 17 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}

File 4 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 5 of 17 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 6 of 17 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 7 of 17 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 8 of 17 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 9 of 17 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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.5.11/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 10 of 17 : 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 11 of 17 : 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 12 of 17 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 13 of 17 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

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

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }
}

File 14 of 17 : IXSteakTokenUsage.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IXSteakTokenUsage {
    function allocate(
        address userAddress,
        uint256 amount,
        bytes calldata data
    ) external;

    function deallocate(
        address userAddress,
        uint256 amount,
        bytes calldata data
    ) external;
}

File 15 of 17 : IXSteakToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

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

interface IXSteakToken is IERC20 {
    function usageAllocations(
        address userAddress,
        address usageAddress
    ) external view returns (uint256 allocation);

    function allocateFromUsage(address userAddress, uint256 amount) external;

    function convertTo(uint256 amount, address to) external;

    function deallocateFromUsage(address userAddress, uint256 amount) external;

    function isTransferWhitelisted(
        address account
    ) external view returns (bool);
}

File 16 of 17 : allowList.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "openzeppelin/access/Ownable.sol";
import "openzeppelin/token/ERC20/utils/SafeERC20.sol";
import "openzeppelin/security/ReentrancyGuard.sol";
import "openzeppelin/utils/math/SafeMath.sol";
import "openzeppelin/utils/structs/EnumerableSet.sol";
import "openzeppelin/token/ERC721/IERC721.sol";

/*
 * Simple allowlist which checks if NFT collection is held by a user.
 * by @SteakHut Finance
 */
contract AllowList is Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    // NFT collection addresses to whitelist from paying deallocation fee
    EnumerableSet.AddressSet private whitelistedCollections;

    constructor() {}

    /********************************************/
    /****************** EVENTS ******************/
    /********************************************/

    event WhitelistCollection(address collection);
    event RemoveCollection(address collection);

    /********************************************/
    /****************** VIEW ******************/
    /********************************************/

    /// @notice Returns the type id at index `_index` where whitelist has a non-zero balance
    /// @param _index The position index
    /// @return The non-zero position at index `_index`
    function whitelistCollectionPositionAtIndex(
        uint256 _index
    ) external view returns (address) {
        return whitelistedCollections.at(_index);
    }

    /// @notice Returns the number of whitelisted NFT collections
    /// @return The number of whitelisted NFT collections
    function whitelistCollectionPositionNumber()
        external
        view
        returns (uint256)
    {
        return whitelistedCollections.length();
    }

    /// @notice Returns if the user holds NFT collection
    /// @return isAllowListed true if user hold collection
    function isAllowlisted(
        address user
    ) external view returns (bool isAllowListed) {
        for (uint i = 0; i < whitelistedCollections.length(); i++) {
            if (
                address(whitelistedCollections.at(i)) != address(0) &&
                IERC721(whitelistedCollections.at(i)).balanceOf(user) > 0 &&
                user == tx.origin
            ) {
                isAllowListed = true;
            }
        }
    }

    /********************************************/
    /****************** OWNER ******************/
    /********************************************/

    /**
     * @dev Adds a NFT collection to the whitelist
     */
    function addWhitelistedCollection(address collection) external onlyOwner {
        require(
            collection != address(0),
            "addWhitelistedCollection: Cannot whitelist 0 address"
        );

        whitelistedCollections.add(collection);
        emit WhitelistCollection(collection);
    }

    /**
     * @dev removes a NFT collection from the whitelist
     */
    function removeWhitelistedCollection(
        address collection
    ) external onlyOwner {
        require(
            collection != address(0),
            "removeWhitelistedCollection: Cannot remove whitelist of 0 address"
        );

        whitelistedCollections.remove(collection);
        emit RemoveCollection(collection);
    }
}

File 17 of 17 : xSteak.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "openzeppelin/access/Ownable.sol";
import "openzeppelin/utils/math/SafeMath.sol";
import "openzeppelin/token/ERC20/utils/SafeERC20.sol";
import "openzeppelin/token/ERC20/ERC20.sol";
import "openzeppelin/token/ERC20/IERC20.sol";
import "openzeppelin/security/ReentrancyGuard.sol";
import "openzeppelin/utils/structs/EnumerableSet.sol";

import "./interfaces/tokens/IXSteakToken.sol";
import "./interfaces/IXSteakTokenUsage.sol";

import "./plugins/allowList.sol";

/*
 * xSTEAK is SteakHuts escrowed governance token obtainable by converting STEAK to it
 * It's non-transferable, except from/to whitelisted addresses
 * It can be converted back to STEAK through a vesting process
 * This contract is made to receive xSTEAK deposits from users in order to allocate them to Usages (plugins) contracts
 * All Credit to the Camelot Dex team!
 * STEAK will be stuck in this contract in place of burning.
 * If holder has a STEAK.JPEG allows for a reduced redemption fee %. (can also whitelist future collections)
 */

contract XSteak is
    Ownable,
    ReentrancyGuard,
    ERC20("STEAK escrowed token", "xSTEAK"),
    IXSteakToken
{
    using Address for address;
    using SafeMath for uint256;
    using EnumerableSet for EnumerableSet.AddressSet;
    using SafeERC20 for IERC20;

    struct XSteakBalance {
        uint256 allocatedAmount; // Amount of xSTEAK allocated to a Usage
        uint256 redeemingAmount; // Total amount of xSTEAK currently being redeemed
    }

    struct RedeemInfo {
        uint256 steakAmount; // STEAK amount to receive when vesting has ended
        uint256 xSteakAmount; // xSTEAK amount to redeem
        uint256 endTime;
        IXSteakTokenUsage dividendsAddress;
        uint256 dividendsAllocation; // Share of redeeming xSTEAK to allocate to the Dividends Usage contract
    }

    IERC20 public immutable steakToken; // STEAK token to convert to/from
    IXSteakTokenUsage public dividendsAddress; // SteakHut dividends contract
    EnumerableSet.AddressSet private _transferWhitelist; // addresses allowed to send/receive xSTEAK
    address public allowListAddress; // SteakHut allowlist contract address

    mapping(address => mapping(address => uint256)) public usageApprovals; // Usage approvals to allocate xSTEAK
    mapping(address => mapping(address => uint256))
        public
        override usageAllocations; // Active xSTEAK allocations to usages

    uint256 public constant MAX_DEALLOCATION_FEE = 200; // 2%
    mapping(address => uint256) public usagesDeallocationFee; // Fee paid when deallocating xSTEAK

    uint256 public constant MAX_FIXED_RATIO = 100; // 100%

    // Redeeming min/max settings
    uint256 public minRedeemRatio = 50; // 1:0.5
    uint256 public maxRedeemRatio = 100; // 1:1
    uint256 public minRedeemDuration = 15 days; // 1296000s
    uint256 public maxRedeemDuration = 90 days; // 7776000s
    // Adjusted dividends rewards for redeeming xSTEAK
    uint256 public redeemDividendsAdjustment = 50; // 50%

    mapping(address => XSteakBalance) public XSteakBalances; // User's xSTEAK balances
    mapping(address => RedeemInfo[]) public userRedeems; // User's redeeming instances

    constructor(IERC20 steakToken_) {
        steakToken = steakToken_;
        _transferWhitelist.add(address(this));
    }

    /********************************************/
    /****************** EVENTS ******************/
    /********************************************/

    event ApproveUsage(
        address indexed userAddress,
        address indexed usageAddress,
        uint256 amount
    );
    event Convert(address indexed from, address to, uint256 amount);
    event UpdateRedeemSettings(
        uint256 minRedeemRatio,
        uint256 maxRedeemRatio,
        uint256 minRedeemDuration,
        uint256 maxRedeemDuration,
        uint256 redeemDividendsAdjustment
    );
    event UpdateDividendsAddress(
        address previousDividendsAddress,
        address newDividendsAddress
    );
    event UpdateDeallocationFee(address indexed usageAddress, uint256 fee);
    event SetTransferWhitelist(address account, bool add);
    event Redeem(
        address indexed userAddress,
        uint256 xSteakAmount,
        uint256 steakAmount,
        uint256 duration
    );
    event FinalizeRedeem(
        address indexed userAddress,
        uint256 xSteakAmount,
        uint256 steakAmount
    );
    event CancelRedeem(address indexed userAddress, uint256 xSteakAmount);
    event UpdateRedeemDividendsAddress(
        address indexed userAddress,
        uint256 redeemIndex,
        address previousDividendsAddress,
        address newDividendsAddress
    );
    event Allocate(
        address indexed userAddress,
        address indexed usageAddress,
        uint256 amount
    );
    event Deallocate(
        address indexed userAddress,
        address indexed usageAddress,
        uint256 amount,
        uint256 fee
    );

    event SetAllowList(address allowList);
    event TransferExcess(uint256 amount, address recipient);

    /***********************************************/
    /****************** MODIFIERS ******************/
    /***********************************************/

    /*
     * @dev Check if a redeem entry exists
     */
    modifier validateRedeem(address userAddress, uint256 redeemIndex) {
        require(
            redeemIndex < userRedeems[userAddress].length,
            "validateRedeem: redeem entry does not exist"
        );
        _;
    }

    /**************************************************/
    /****************** PUBLIC VIEWS ******************/
    /**************************************************/

    /*
     * @dev Returns user's xSTEAK balances
     */
    function getXSteakBalance(
        address userAddress
    ) external view returns (uint256 allocatedAmount, uint256 redeemingAmount) {
        XSteakBalance storage balance = XSteakBalances[userAddress];
        return (balance.allocatedAmount, balance.redeemingAmount);
    }

    /*
     * @dev returns redeemable STEAK for "amount" of xSTEAK vested for "duration" seconds
     */
    function getSteakByVestingDuration(
        uint256 amount,
        uint256 duration
    ) public view returns (uint256) {
        if (duration < minRedeemDuration) {
            return 0;
        }

        // capped to maxRedeemDuration
        if (duration > maxRedeemDuration) {
            return amount.mul(maxRedeemRatio).div(100);
        }

        //otherwise the ratio is a factor of time
        uint256 ratio = minRedeemRatio.add(
            (duration.sub(minRedeemDuration))
                .mul(maxRedeemRatio.sub(minRedeemRatio))
                .div(maxRedeemDuration.sub(minRedeemDuration))
        );

        return amount.mul(ratio).div(100);
    }

    /**
     * @dev returns quantity of "userAddress" pending redeems
     */
    function getUserRedeemsLength(
        address userAddress
    ) external view returns (uint256) {
        return userRedeems[userAddress].length;
    }

    /**
     * @dev returns "userAddress" info for a pending redeem identified by "redeemIndex"
     */
    function getUserRedeem(
        address userAddress,
        uint256 redeemIndex
    )
        external
        view
        validateRedeem(userAddress, redeemIndex)
        returns (
            uint256 steakAmount,
            uint256 xSteakAmount,
            uint256 endTime,
            address dividendsContract,
            uint256 dividendsAllocation
        )
    {
        RedeemInfo storage _redeem = userRedeems[userAddress][redeemIndex];
        return (
            _redeem.steakAmount,
            _redeem.xSteakAmount,
            _redeem.endTime,
            address(_redeem.dividendsAddress),
            _redeem.dividendsAllocation
        );
    }

    /**
     * @dev returns approved xSTEAK to allocate from "userAddress" to "usageAddress"
     */
    function getUsageApproval(
        address userAddress,
        address usageAddress
    ) external view returns (uint256) {
        return usageApprovals[userAddress][usageAddress];
    }

    /**
     * @dev returns allocated xSTEAK from "userAddress" to "usageAddress"
     */
    function getUsageAllocation(
        address userAddress,
        address usageAddress
    ) external view returns (uint256) {
        return usageAllocations[userAddress][usageAddress];
    }

    /**
     * @dev returns length of transferWhitelist array
     */
    function transferWhitelistLength() external view returns (uint256) {
        return _transferWhitelist.length();
    }

    /**
     * @dev returns transferWhitelist array item's address for "index"
     */
    function transferWhitelist(uint256 index) external view returns (address) {
        return _transferWhitelist.at(index);
    }

    /**
     * @dev returns if "account" is allowed to send/receive xSTEAK
     */
    function isTransferWhitelisted(
        address account
    ) external view override returns (bool) {
        return _transferWhitelist.contains(account);
    }

    /*******************************************************/
    /****************** OWNABLE FUNCTIONS ******************/
    /*******************************************************/

    /**
     * @dev Updates all redeem ratios and durations
     *
     * Must only be called by owner
     */
    function updateRedeemSettings(
        uint256 minRedeemRatio_,
        uint256 maxRedeemRatio_,
        uint256 minRedeemDuration_,
        uint256 maxRedeemDuration_,
        uint256 redeemDividendsAdjustment_
    ) external onlyOwner {
        require(
            minRedeemRatio_ <= maxRedeemRatio_,
            "updateRedeemSettings: wrong ratio values"
        );
        require(
            minRedeemDuration_ < maxRedeemDuration_,
            "updateRedeemSettings: wrong duration values"
        );
        // should never exceed 100%
        require(
            maxRedeemRatio_ <= MAX_FIXED_RATIO &&
                redeemDividendsAdjustment_ <= MAX_FIXED_RATIO,
            "updateRedeemSettings: wrong ratio values"
        );

        minRedeemRatio = minRedeemRatio_;
        maxRedeemRatio = maxRedeemRatio_;
        minRedeemDuration = minRedeemDuration_;
        maxRedeemDuration = maxRedeemDuration_;
        redeemDividendsAdjustment = redeemDividendsAdjustment_;

        emit UpdateRedeemSettings(
            minRedeemRatio_,
            maxRedeemRatio_,
            minRedeemDuration_,
            maxRedeemDuration_,
            redeemDividendsAdjustment_
        );
    }

    /**
     * @dev Updates dividends contract address
     *
     * Must only be called by owner
     */
    function updateDividendsAddress(
        IXSteakTokenUsage dividendsAddress_
    ) external onlyOwner {
        // if set to 0, also set divs earnings while redeeming to 0
        if (address(dividendsAddress_) == address(0)) {
            redeemDividendsAdjustment = 0;
        }

        emit UpdateDividendsAddress(
            address(dividendsAddress),
            address(dividendsAddress_)
        );
        dividendsAddress = dividendsAddress_;
    }

    /**
     * @dev Updates fee paid by users when deallocating from "usageAddress"
     */
    function updateDeallocationFee(
        address usageAddress,
        uint256 fee
    ) external onlyOwner {
        require(fee <= MAX_DEALLOCATION_FEE, "updateDeallocationFee: too high");

        usagesDeallocationFee[usageAddress] = fee;
        emit UpdateDeallocationFee(usageAddress, fee);
    }

    /**
     * @dev Adds or removes addresses from the transferWhitelist
     */
    function updateTransferWhitelist(
        address account,
        bool add
    ) external onlyOwner {
        require(
            account != address(this),
            "updateTransferWhitelist: Cannot remove xSteak from whitelist"
        );

        if (add) _transferWhitelist.add(account);
        else _transferWhitelist.remove(account);

        emit SetTransferWhitelist(account, add);
    }

    /**
     * @dev updates the address of the allowList contract
     */
    function updateAllowListAddress(
        address _allowListAddress
    ) external onlyOwner {
        require(
            _allowListAddress != address(0),
            "updateAllowListAddress: no 0 address"
        );

        allowListAddress = _allowListAddress;

        emit SetAllowList(allowListAddress);
    }

    /// @notice Rescues funds from contract
    /// @param _token address of the token to rescue.
    function inCaseTokensGetStuck(address _token) external onlyOwner {
        uint256 amount = IERC20(_token).balanceOf(address(this));
        IERC20(_token).safeTransfer(msg.sender, amount);
    }

    /// @notice Removes excess steak from the contract
    /// @param _recipient address to send excess steak to
    function removeExcessSteak(address _recipient) external onlyOwner {
        uint256 steakAmount = steakToken.balanceOf(address(this));
        uint256 xSteakAmount = totalSupply();
        require(steakAmount > xSteakAmount, "xSTEAK: no excess STEAK");

        uint256 excessSteak = steakAmount - xSteakAmount;

        steakToken.safeTransfer(_recipient, excessSteak);
        emit TransferExcess(excessSteak, _recipient);
    }

    /*****************************************************************/
    /******************  EXTERNAL PUBLIC FUNCTIONS  ******************/
    /*****************************************************************/

    /**
     * @dev Approves "usage" address to get allocations up to "amount" of xSTEAK from msg.sender
     */
    function approveUsage(
        IXSteakTokenUsage usage,
        uint256 amount
    ) external nonReentrant {
        require(
            address(usage) != address(0),
            "approveUsage: approve to the zero address"
        );

        usageApprovals[msg.sender][address(usage)] = amount;
        emit ApproveUsage(msg.sender, address(usage), amount);
    }

    /**
     * @dev Convert caller's "amount" of STEAK to xSTEAK
     */
    function convert(uint256 amount) external nonReentrant {
        _convert(amount, msg.sender);
    }

    /**
     * @dev Convert caller's "amount" of STEAK to xSTEAK to "to" address
     */
    function convertTo(
        uint256 amount,
        address to
    ) external override nonReentrant {
        require(address(msg.sender).isContract(), "convertTo: not allowed");
        _convert(amount, to);
    }

    /**
     * @dev Initiates redeem process (xSTEAK to STEAK)
     *
     * Handles dividends' compensation allocation during the vesting process if needed
     */
    function redeem(
        uint256 xSteakAmount,
        uint256 duration
    ) external nonReentrant {
        require(xSteakAmount > 0, "redeem: xSteakAmount cannot be null");
        require(duration >= minRedeemDuration, "redeem: duration too low");

        _transfer(msg.sender, address(this), xSteakAmount);
        XSteakBalance storage balance = XSteakBalances[msg.sender];

        // get corresponding STEAK amount
        uint256 steakAmount = getSteakByVestingDuration(xSteakAmount, duration);
        emit Redeem(msg.sender, xSteakAmount, steakAmount, duration);

        // if redeeming is not immediate, go through vesting process
        if (duration > 0) {
            // add to SBT total
            balance.redeemingAmount = balance.redeemingAmount.add(xSteakAmount);

            // handle dividends during the vesting process
            uint256 dividendsAllocation = xSteakAmount
                .mul(redeemDividendsAdjustment)
                .div(100);
            // only if compensation is active
            if (dividendsAllocation > 0) {
                // allocate to dividends

                dividendsAddress.allocate(
                    msg.sender,
                    dividendsAllocation,
                    new bytes(0)
                );
            }

            // add redeeming entry
            userRedeems[msg.sender].push(
                RedeemInfo(
                    steakAmount,
                    xSteakAmount,
                    _currentBlockTimestamp().add(duration),
                    dividendsAddress,
                    dividendsAllocation
                )
            );
        } else {
            // immediately redeem for STEAK
            _finalizeRedeem(msg.sender, xSteakAmount, steakAmount);
        }
    }

    /**
     * @dev Finalizes redeem process when vesting duration has been reached
     *
     * Can only be called by the redeem entry owner
     */
    function finalizeRedeem(
        uint256 redeemIndex
    ) external nonReentrant validateRedeem(msg.sender, redeemIndex) {
        XSteakBalance storage balance = XSteakBalances[msg.sender];
        RedeemInfo storage _redeem = userRedeems[msg.sender][redeemIndex];
        require(
            _currentBlockTimestamp() >= _redeem.endTime,
            "finalizeRedeem: vesting duration has not ended yet"
        );

        // remove from SBT total
        balance.redeemingAmount = balance.redeemingAmount.sub(
            _redeem.xSteakAmount
        );
        _finalizeRedeem(msg.sender, _redeem.xSteakAmount, _redeem.steakAmount);

        // handle dividends compensation if any was active
        if (_redeem.dividendsAllocation > 0) {
            // deallocate from dividends
            IXSteakTokenUsage(_redeem.dividendsAddress).deallocate(
                msg.sender,
                _redeem.dividendsAllocation,
                new bytes(0)
            );
        }

        // remove redeem entry
        _deleteRedeemEntry(redeemIndex);
    }

    /**
     * @dev Updates dividends address for an existing active redeeming process
     *
     * Can only be called by the involved user
     * Should only be used if dividends contract was to be migrated
     */
    function updateRedeemDividendsAddress(
        uint256 redeemIndex
    ) external nonReentrant validateRedeem(msg.sender, redeemIndex) {
        RedeemInfo storage _redeem = userRedeems[msg.sender][redeemIndex];

        // only if the active dividends contract is not the same anymore
        if (
            dividendsAddress != _redeem.dividendsAddress &&
            address(dividendsAddress) != address(0)
        ) {
            if (_redeem.dividendsAllocation > 0) {
                // deallocate from old dividends contract
                _redeem.dividendsAddress.deallocate(
                    msg.sender,
                    _redeem.dividendsAllocation,
                    new bytes(0)
                );
                // allocate to new used dividends contract
                dividendsAddress.allocate(
                    msg.sender,
                    _redeem.dividendsAllocation,
                    new bytes(0)
                );
            }

            emit UpdateRedeemDividendsAddress(
                msg.sender,
                redeemIndex,
                address(_redeem.dividendsAddress),
                address(dividendsAddress)
            );
            _redeem.dividendsAddress = dividendsAddress;
        }
    }

    /**
     * @dev Cancels an ongoing redeem entry
     *
     * Can only be called by its owner
     */
    function cancelRedeem(
        uint256 redeemIndex
    ) external nonReentrant validateRedeem(msg.sender, redeemIndex) {
        XSteakBalance storage balance = XSteakBalances[msg.sender];
        RedeemInfo storage _redeem = userRedeems[msg.sender][redeemIndex];

        // make redeeming xSTEAK available again
        balance.redeemingAmount = balance.redeemingAmount.sub(
            _redeem.xSteakAmount
        );
        _transfer(address(this), msg.sender, _redeem.xSteakAmount);

        // handle dividends compensation if any was active
        if (_redeem.dividendsAllocation > 0) {
            // deallocate from dividends
            IXSteakTokenUsage(_redeem.dividendsAddress).deallocate(
                msg.sender,
                _redeem.dividendsAllocation,
                new bytes(0)
            );
        }

        emit CancelRedeem(msg.sender, _redeem.xSteakAmount);

        // remove redeem entry
        _deleteRedeemEntry(redeemIndex);
    }

    /**
     * @dev Allocates caller's "amount" of available xSTEAK to "usageAddress" contract
     *
     * args specific to usage contract must be passed into "usageData"
     */
    function allocate(
        address usageAddress,
        uint256 amount,
        bytes calldata usageData
    ) external nonReentrant {
        _allocate(msg.sender, usageAddress, amount);

        // allocates xSTEAK to usageContract
        IXSteakTokenUsage(usageAddress).allocate(msg.sender, amount, usageData);
    }

    /**
     * @dev Allocates "amount" of available xSTEAK from "userAddress" to caller (ie usage contract)
     *
     * Caller must have an allocation approval for the required xSteak xSTEAK from "userAddress"
     */
    function allocateFromUsage(
        address userAddress,
        uint256 amount
    ) external override nonReentrant {
        _allocate(userAddress, msg.sender, amount);
    }

    /**
     * @dev Deallocates caller's "amount" of available xSTEAK from "usageAddress" contract
     *
     * args specific to usage contract must be passed into "usageData"
     */
    function deallocate(
        address usageAddress,
        uint256 amount,
        bytes calldata usageData
    ) external nonReentrant {
        _deallocate(msg.sender, usageAddress, amount);

        // deallocate xSTEAK into usageContract
        IXSteakTokenUsage(usageAddress).deallocate(
            msg.sender,
            amount,
            usageData
        );
    }

    /**
     * @dev Deallocates "amount" of allocated xSTEAK belonging to "userAddress" from caller (ie usage contract)
     *
     * Caller can only deallocate xSTEAK from itself
     */
    function deallocateFromUsage(
        address userAddress,
        uint256 amount
    ) external override nonReentrant {
        _deallocate(userAddress, msg.sender, amount);
    }

    /********************************************************/
    /****************** INTERNAL FUNCTIONS ******************/
    /********************************************************/

    /**
     * @dev Convert caller's "amount" of STEAK into xSTEAK to "to"
     */
    function _convert(uint256 amount, address to) internal {
        require(amount != 0, "convert: amount cannot be null");

        steakToken.safeTransferFrom(msg.sender, address(this), amount);
        // mint new xSTEAK
        _mint(to, amount);

        emit Convert(msg.sender, to, amount);
    }

    /**
     * @dev Finalizes the redeeming process for "userAddress" by transferring him "steakAmount" and removing "xSteakAmount" from supply
     *
     * Any vesting check should be ran before calling this
     * STEAK excess is retained in this contract
     */
    function _finalizeRedeem(
        address userAddress,
        uint256 xSteakAmount,
        uint256 steakAmount
    ) internal {
        // sends due STEAK tokens
        steakToken.safeTransfer(userAddress, steakAmount);

        // burns STEAK excess if any (stuck in this contract)
        _burn(address(this), xSteakAmount);

        emit FinalizeRedeem(userAddress, xSteakAmount, steakAmount);
    }

    /**
     * @dev Allocates "userAddress" user's "amount" of available xSTEAK to "usageAddress" contract
     *
     */
    function _allocate(
        address userAddress,
        address usageAddress,
        uint256 amount
    ) internal {
        require(amount > 0, "allocate: amount cannot be null");

        XSteakBalance storage balance = XSteakBalances[userAddress];

        // approval checks if allocation request amount has been approved by userAddress to be allocated to this usageAddress
        uint256 approvedXSteak = usageApprovals[userAddress][usageAddress];
        require(approvedXSteak >= amount, "allocate: non authorized amount");

        // remove allocated amount from usage's approved amount
        usageApprovals[userAddress][usageAddress] = approvedXSteak.sub(amount);

        // update usage's allocatedAmount for userAddress
        usageAllocations[userAddress][usageAddress] = usageAllocations[
            userAddress
        ][usageAddress].add(amount);

        // adjust user's xSTEAK balances
        balance.allocatedAmount = balance.allocatedAmount.add(amount);
        _transfer(userAddress, address(this), amount);

        emit Allocate(userAddress, usageAddress, amount);
    }

    /**
     * @dev Deallocates "amount" of available xSTEAK to "usageAddress" contract
     *
     * args specific to usage contract must be passed into "usageData"
     */
    function _deallocate(
        address userAddress,
        address usageAddress,
        uint256 amount
    ) internal {
        require(amount > 0, "deallocate: amount cannot be null");

        // check if there is enough allocated xSTEAK to this usage to deallocate
        uint256 allocatedAmount = usageAllocations[userAddress][usageAddress];
        require(allocatedAmount >= amount, "deallocate: non authorized amount");

        // remove deallocated amount from usage's allocation
        usageAllocations[userAddress][usageAddress] = allocatedAmount.sub(
            amount
        );

        uint256 deallocationFeeAmount = amount
            .mul(usagesDeallocationFee[usageAddress])
            .div(10000);

        //remove the deallocation fee if user holds an allowlist
        if (AllowList(allowListAddress).isAllowlisted(msg.sender)) {
            deallocationFeeAmount = 0;
        }

        // adjust user's xSTEAK balances
        XSteakBalance storage balance = XSteakBalances[userAddress];
        balance.allocatedAmount = balance.allocatedAmount.sub(amount);
        _transfer(
            address(this),
            userAddress,
            amount.sub(deallocationFeeAmount)
        );

        // burn corresponding xSTEAK
        _burn(address(this), deallocationFeeAmount);

        emit Deallocate(
            userAddress,
            usageAddress,
            amount,
            deallocationFeeAmount
        );
    }

    function _deleteRedeemEntry(uint256 index) internal {
        userRedeems[msg.sender][index] = userRedeems[msg.sender][
            userRedeems[msg.sender].length - 1
        ];
        userRedeems[msg.sender].pop();
    }

    /**
     * @dev Hook override to forbid transfers except from whitelisted addresses and minting
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 /*amount*/
    ) internal view override {
        require(
            from == address(0) ||
                _transferWhitelist.contains(from) ||
                _transferWhitelist.contains(to),
            "transfer: not allowed"
        );
    }

    /**
     * @dev Utility function to get the current block timestamp
     */
    function _currentBlockTimestamp() internal view virtual returns (uint256) {
        /* solhint-disable not-rely-on-time */
        return block.timestamp;
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"steakToken_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"},{"indexed":true,"internalType":"address","name":"usageAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Allocate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"},{"indexed":true,"internalType":"address","name":"usageAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ApproveUsage","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"xSteakAmount","type":"uint256"}],"name":"CancelRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Convert","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"},{"indexed":true,"internalType":"address","name":"usageAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"Deallocate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"xSteakAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"steakAmount","type":"uint256"}],"name":"FinalizeRedeem","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":true,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"xSteakAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"steakAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"allowList","type":"address"}],"name":"SetAllowList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"add","type":"bool"}],"name":"SetTransferWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"TransferExcess","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usageAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"UpdateDeallocationFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousDividendsAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newDividendsAddress","type":"address"}],"name":"UpdateDividendsAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"redeemIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"previousDividendsAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newDividendsAddress","type":"address"}],"name":"UpdateRedeemDividendsAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minRedeemRatio","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxRedeemRatio","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minRedeemDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxRedeemDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemDividendsAdjustment","type":"uint256"}],"name":"UpdateRedeemSettings","type":"event"},{"inputs":[],"name":"MAX_DEALLOCATION_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FIXED_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"XSteakBalances","outputs":[{"internalType":"uint256","name":"allocatedAmount","type":"uint256"},{"internalType":"uint256","name":"redeemingAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"usageAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"usageData","type":"bytes"}],"name":"allocate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"allocateFromUsage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowListAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IXSteakTokenUsage","name":"usage","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approveUsage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemIndex","type":"uint256"}],"name":"cancelRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"convert","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"convertTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"usageAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"usageData","type":"bytes"}],"name":"deallocate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deallocateFromUsage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dividendsAddress","outputs":[{"internalType":"contract IXSteakTokenUsage","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemIndex","type":"uint256"}],"name":"finalizeRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"getSteakByVestingDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"address","name":"usageAddress","type":"address"}],"name":"getUsageAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"address","name":"usageAddress","type":"address"}],"name":"getUsageApproval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"uint256","name":"redeemIndex","type":"uint256"}],"name":"getUserRedeem","outputs":[{"internalType":"uint256","name":"steakAmount","type":"uint256"},{"internalType":"uint256","name":"xSteakAmount","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"dividendsContract","type":"address"},{"internalType":"uint256","name":"dividendsAllocation","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"}],"name":"getUserRedeemsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"}],"name":"getXSteakBalance","outputs":[{"internalType":"uint256","name":"allocatedAmount","type":"uint256"},{"internalType":"uint256","name":"redeemingAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"inCaseTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isTransferWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRedeemDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRedeemRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minRedeemDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minRedeemRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"xSteakAmount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemDividendsAdjustment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"removeExcessSteak","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"steakToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"transferWhitelist","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferWhitelistLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_allowListAddress","type":"address"}],"name":"updateAllowListAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"usageAddress","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"updateDeallocationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IXSteakTokenUsage","name":"dividendsAddress_","type":"address"}],"name":"updateDividendsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemIndex","type":"uint256"}],"name":"updateRedeemDividendsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minRedeemRatio_","type":"uint256"},{"internalType":"uint256","name":"maxRedeemRatio_","type":"uint256"},{"internalType":"uint256","name":"minRedeemDuration_","type":"uint256"},{"internalType":"uint256","name":"maxRedeemDuration_","type":"uint256"},{"internalType":"uint256","name":"redeemDividendsAdjustment_","type":"uint256"}],"name":"updateRedeemSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"add","type":"bool"}],"name":"updateTransferWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"usageAllocations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"usageApprovals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"usagesDeallocationFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userRedeems","outputs":[{"internalType":"uint256","name":"steakAmount","type":"uint256"},{"internalType":"uint256","name":"xSteakAmount","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"contract IXSteakTokenUsage","name":"dividendsAddress","type":"address"},{"internalType":"uint256","name":"dividendsAllocation","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a06040526032600e556064600f556213c6806010556276a70060115560326012553480156200002e57600080fd5b50604051620037ab380380620037ab8339810160408190526200005191620001d8565b6040518060400160405280601481526020017f535445414b20657363726f77656420746f6b656e0000000000000000000000008152506040518060400160405280600681526020016578535445414b60d01b815250620000c0620000ba6200011260201b60201c565b62000116565b600180556005620000d28382620002af565b506006620000e18282620002af565b5050506001600160a01b0381166080526200010a60083062000166602090811b62001d0c17901c565b50506200037b565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006200017d836001600160a01b03841662000186565b90505b92915050565b6000818152600183016020526040812054620001cf5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000180565b50600062000180565b600060208284031215620001eb57600080fd5b81516001600160a01b03811681146200020357600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200023557607f821691505b6020821081036200025657634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002aa57600081815260208120601f850160051c81016020861015620002855750805b601f850160051c820191505b81811015620002a65782815560010162000291565b5050505b505050565b81516001600160401b03811115620002cb57620002cb6200020a565b620002e381620002dc845462000220565b846200025c565b602080601f8311600181146200031b5760008415620003025750858301515b600019600386901b1c1916600185901b178555620002a6565b600085815260208120601f198616915b828110156200034c578886015182559484019460019091019084016200032b565b50858210156200036b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516133f8620003b36000396000818161088901528181610b2d01528181610c1901528181612776015261284601526133f86000f3fe608060405234801561001057600080fd5b50600436106103785760003560e01c80634f62b7ec116101d3578063a3908e1b11610104578063cc6c5423116100a2578063e3a2950b1161007c578063e3a2950b1461085f578063e9ed87f814610868578063f2fde38b14610871578063fdba1c451461088457600080fd5b8063cc6c542314610826578063dd62ed3e14610839578063def68a9c1461084c57600080fd5b8063aff6cbf1116100de578063aff6cbf1146107ce578063b90c2b52146107e1578063c360ed1c1461080a578063c4b107661461081d57600080fd5b8063a3908e1b14610795578063a457c2d7146107a8578063a9059cbb146107bb57600080fd5b80637cbc2373116101715780638da5cb5b1161014b5780638da5cb5b146107565780638ea15c2a1461076757806395d89b411461077a578063a0bdc7cb1461078257600080fd5b80637cbc23731461071057806389083654146107235780638975f9181461073657600080fd5b80635a1d34dc116101ad5780635a1d34dc146106c4578063619ac95b146106d757806370a08231146106df578063715018a61461070857600080fd5b80634f62b7ec1461065a578063539ffb771461069e578063549230c9146106b157600080fd5b806323b872dd116102ad578063395093511161024b578063497965ee11610225578063497965ee146106005780634a5b406e1461062b5780634a977826146106345780634b359d381461064757600080fd5b806339509351146105af5780633b90f9a0146105c2578063488c8303146105d557600080fd5b80632e9a76e4116102875780632e9a76e41461054157806331124ce31461057a578063313ce5671461058d5780633735edfe1461059c57600080fd5b806323b872dd146104ca5780632b489679146104dd5780632cc2f5ce1461051657600080fd5b80630f7d3a691161031a57806318160ddd116102f457806318160ddd146104935780631c3526791461049b5780631c75e369146104a45780631eee7e60146104b757600080fd5b80630f7d3a6914610447578063161aab431461045a57806317b0a3de1461046257600080fd5b8063073888751161035657806307388875146103c2578063093220b7146103fe578063095ea7b3146104115780630ba5923e1461043457600080fd5b806302f91e551461037d57806306045a211461039857806306fdde03146103ad575b600080fd5b61038560c881565b6040519081526020015b60405180910390f35b6103ab6103a6366004612f04565b6108ab565b005b6103b5610930565b60405161038f9190612f71565b6103e96103d0366004612f04565b6013602052600090815260409020805460019091015482565b6040805192835260208301919091520161038f565b6103ab61040c366004612f84565b6109c2565b61042461041f366004612fbf565b610af3565b604051901515815260200161038f565b6103ab610442366004612f04565b610b0d565b6103ab610455366004612fbf565b610c87565b610385610d39565b6103e9610470366004612f04565b6001600160a01b0316600090815260136020526040902080546001909101549091565b600454610385565b610385600e5481565b6103ab6104b2366004612feb565b610d4a565b6104246104c5366004612f04565b610dd0565b6104246104d8366004613074565b610ddd565b6103856104eb3660046130b5565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205490565b6103856105243660046130b5565b600c60209081526000928352604080842090915290825290205481565b61038561054f3660046130b5565b6001600160a01b039182166000908152600c6020908152604080832093909416825291909152205490565b6103ab6105883660046130ee565b610e01565b6040516012815260200161038f565b6103856105aa366004613107565b611024565b6104246105bd366004612fbf565b6110d8565b6103ab6105d0366004612fbf565b6110fa565b6103856105e33660046130b5565b600b60209081526000928352604080842090915290825290205481565b600754610613906001600160a01b031681565b6040516001600160a01b03909116815260200161038f565b61038560125481565b6103ab610642366004612f04565b61111a565b6106136106553660046130ee565b6111d8565b61066d610668366004612fbf565b6111e5565b604080519586526020860194909452928401919091526001600160a01b03166060830152608082015260a00161038f565b6103ab6106ac3660046130ee565b61123c565b6103ab6106bf366004612feb565b6113b8565b6103ab6106d2366004613129565b6113fd565b610385606481565b6103856106ed366004612f04565b6001600160a01b031660009081526002602052604090205490565b6103ab611456565b6103ab61071e366004613107565b61146a565b6103ab61073136600461315c565b6116fe565b610385610744366004612f04565b600d6020526000908152604090205481565b6000546001600160a01b0316610613565b600a54610613906001600160a01b031681565b6103b56117ef565b6103ab610790366004612fbf565b6117fe565b6103ab6107a33660046130ee565b611811565b6104246107b6366004612fbf565b61182c565b6104246107c9366004612fbf565b6118a7565b6103ab6107dc3660046130ee565b6118b5565b6103856107ef366004612f04565b6001600160a01b031660009081526014602052604090205490565b6103ab610818366004612fbf565b611a5b565b61038560105481565b61066d610834366004612fbf565b611b2f565b6103856108473660046130b5565b611be2565b6103ab61085a366004612f04565b611c0d565b610385600f5481565b61038560115481565b6103ab61087f366004612f04565b611c96565b6106137f000000000000000000000000000000000000000000000000000000000000000081565b6108b3611d28565b6001600160a01b0381166108c75760006012555b600754604080516001600160a01b03928316815291831660208301527f044c75b8fa43ce72364b4c23fdb8451beafbda46505bf44c76f0853a01ed4ade910160405180910390a1600780546001600160a01b0319166001600160a01b0392909216919091179055565b60606005805461093f9061318a565b80601f016020809104026020016040519081016040528092919081815260200182805461096b9061318a565b80156109b85780601f1061098d576101008083540402835291602001916109b8565b820191906000526020600020905b81548152906001019060200180831161099b57829003601f168201915b5050505050905090565b6109ca611d28565b838511156109f35760405162461bcd60e51b81526004016109ea906131c4565b60405180910390fd5b818310610a565760405162461bcd60e51b815260206004820152602b60248201527f75706461746552656465656d53657474696e67733a2077726f6e67206475726160448201526a74696f6e2076616c75657360a81b60648201526084016109ea565b60648411158015610a68575060648111155b610a845760405162461bcd60e51b81526004016109ea906131c4565b600e859055600f849055601083905560118290556012819055604080518681526020810186905290810184905260608101839052608081018290527f5b37d10782e41a6539b50d59366d4112a880236e4187e85b6d1514d20e07d9b89060a00160405180910390a15050505050565b600033610b01818585611d82565b60019150505b92915050565b610b15611d28565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba0919061320c565b90506000610bad60045490565b9050808211610bfe5760405162461bcd60e51b815260206004820152601760248201527f78535445414b3a206e6f2065786365737320535445414b00000000000000000060448201526064016109ea565b6000610c0a828461323b565b9050610c406001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168583611ea6565b604080518281526001600160a01b03861660208201527fe1340a8492243084101c7ee480b1a336f24d28033fbf2b1ba171924ba01f0a2f910160405180910390a150505050565b610c8f611d28565b60c8811115610ce05760405162461bcd60e51b815260206004820152601f60248201527f7570646174654465616c6c6f636174696f6e4665653a20746f6f20686967680060448201526064016109ea565b6001600160a01b0382166000818152600d602052604090819020839055517f6ff024152fc2cd8071bc701f966036513eb03e243863f21d8218646faac0eaef90610d2d9084815260200190565b60405180910390a25050565b6000610d456008611f0e565b905090565b610d52611f18565b610d5d338585611f71565b604051631c75e36960e01b81526001600160a01b03851690631c75e36990610d8f90339087908790879060040161324e565b600060405180830381600087803b158015610da957600080fd5b505af1158015610dbd573d6000803e3d6000fd5b50505050610dca60018055565b50505050565b6000610b07600883612125565b600033610deb858285612147565b610df68585856121bb565b506001949350505050565b610e09611f18565b3360008181526014602052604090205482908110610e395760405162461bcd60e51b81526004016109ea90613296565b336000908152601460205260408120805485908110610e5a57610e5a6132e1565b6000918252602090912060059091020160038101546007549192506001600160a01b03908116911614801590610e9a57506007546001600160a01b031615155b1561101557600481015415610f9a57600381015460048201546040805160008152602081019182905263549230c960e01b9091526001600160a01b039092169163549230c991610ef091339190602481016132f7565b600060405180830381600087803b158015610f0a57600080fd5b505af1158015610f1e573d6000803e3d6000fd5b5050600754600484015460408051600081526020810191829052631c75e36960e01b9091526001600160a01b039092169350631c75e3699250610f6791339190602481016132f7565b600060405180830381600087803b158015610f8157600080fd5b505af1158015610f95573d6000803e3d6000fd5b505050505b6003810154600754604080518781526001600160a01b039384166020820152929091169082015233907fa60c8f9118be22c9277a8129333d64ffda3de44ca7a5831d077a3127f1237a189060600160405180910390a26007546003820180546001600160a01b0319166001600160a01b039092169190911790555b50505061102160018055565b50565b600060105482101561103857506000610b07565b60115482111561106957611062606461105c600f548661237190919063ffffffff16565b9061237d565b9050610b07565b60006110bf6110b661108860105460115461238990919063ffffffff16565b61105c6110a2600e54600f5461238990919063ffffffff16565b6010546110b0908990612389565b90612371565b600e5490612395565b90506110d0606461105c8684612371565b949350505050565b600033610b018185856110eb8383611be2565b6110f59190613327565b611d82565b611102611f18565b61110d823383611f71565b61111660018055565b5050565b611122611d28565b6001600160a01b0381166111845760405162461bcd60e51b8152602060048201526024808201527f757064617465416c6c6f774c697374416464726573733a206e6f2030206164646044820152637265737360e01b60648201526084016109ea565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f8ecdaab4c863dd4142ed97df898c3419b0ab395e3541101340983f9d0c62bf169060200160405180910390a150565b6000610b076008836123a1565b6014602052816000526040600020818154811061120157600080fd5b600091825260209091206005909102018054600182015460028301546003840154600490940154929550909350916001600160a01b03169085565b611244611f18565b33600081815260146020526040902054829081106112745760405162461bcd60e51b81526004016109ea90613296565b336000908152601360209081526040808320601490925282208054919291869081106112a2576112a26132e1565b906000526020600020906005020190506112cd8160010154836001015461238990919063ffffffff16565b82600101819055506112e4303383600101546121bb565b60048101541561136857600381015460048201546040805160008152602081019182905263549230c960e01b9091526001600160a01b039092169163549230c99161133591339190602481016132f7565b600060405180830381600087803b15801561134f57600080fd5b505af1158015611363573d6000803e3d6000fd5b505050505b600181015460405190815233907f56d7520e387607a8daa892e3fed116badc2a636307bdc794b1c1aed97ae203f49060200160405180910390a26113ab856123ad565b5050505061102160018055565b6113c0611f18565b6113cb3385856124d7565b60405163549230c960e01b81526001600160a01b0385169063549230c990610d8f90339087908790879060040161324e565b611405611f18565b333b61144c5760405162461bcd60e51b815260206004820152601660248201527518dbdb9d995c9d151bce881b9bdd08185b1b1bddd95960521b60448201526064016109ea565b61110d8282612719565b61145e611d28565b61146860006127e9565b565b611472611f18565b600082116114ce5760405162461bcd60e51b815260206004820152602360248201527f72656465656d3a2078537465616b416d6f756e742063616e6e6f74206265206e6044820152621d5b1b60ea1b60648201526084016109ea565b6010548110156115205760405162461bcd60e51b815260206004820152601860248201527f72656465656d3a206475726174696f6e20746f6f206c6f77000000000000000060448201526064016109ea565b61152b3330846121bb565b336000908152601360205260408120906115458484611024565b604080518681526020810183905290810185905290915033907fbd5034ffbd47e4e72a94baa2cdb74c6fad73cb3bcdc13036b72ec8306f5a76469060600160405180910390a282156116e85760018201546115a09085612395565b60018301556012546000906115bd9060649061105c908890612371565b905080156116395760075460408051600081526020810191829052631c75e36960e01b9091526001600160a01b0390911690631c75e369906116069033908590602481016132f7565b600060405180830381600087803b15801561162057600080fd5b505af1158015611634573d6000803e3d6000fd5b505050505b33600090815260146020908152604091829020825160a08101845285815291820188905291810161166a4288612395565b81526007546001600160a01b0390811660208084019190915260409283019590955283546001808201865560009586529486902084516005909202019081559483015193850193909355810151600284015560608101516003840180546001600160a01b0319169190931617909155608001516004909101556116f3565b6116f3338583612839565b505061111660018055565b611706611d28565b306001600160a01b038316036117845760405162461bcd60e51b815260206004820152603c60248201527f7570646174655472616e7366657257686974656c6973743a2043616e6e6f742060448201527f72656d6f76652078537465616b2066726f6d2077686974656c6973740000000060648201526084016109ea565b801561179b57611795600883611d0c565b506117a8565b6117a66008836128c0565b505b604080516001600160a01b038416815282151560208201527f3a34209cb941a5d23a56dea730a13738454bc7daefd4bb32e8d7df58c1bd920d910160405180910390a15050565b60606006805461093f9061318a565b611806611f18565b61110d8233836124d7565b611819611f18565b6118238133612719565b61102160018055565b6000338161183a8286611be2565b90508381101561189a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016109ea565b610df68286868403611d82565b600033610b018185856121bb565b6118bd611f18565b33600081815260146020526040902054829081106118ed5760405162461bcd60e51b81526004016109ea90613296565b3360009081526013602090815260408083206014909252822080549192918690811061191b5761191b6132e1565b9060005260206000209060050201905080600201546119374290565b10156119a05760405162461bcd60e51b815260206004820152603260248201527f66696e616c697a6552656465656d3a2076657374696e67206475726174696f6e604482015271081a185cc81b9bdd08195b991959081e595d60721b60648201526084016109ea565b600180820154908301546119b391612389565b82600101819055506119ce3382600101548360000154612839565b600481015415611a5257600381015460048201546040805160008152602081019182905263549230c960e01b9091526001600160a01b039092169163549230c991611a1f91339190602481016132f7565b600060405180830381600087803b158015611a3957600080fd5b505af1158015611a4d573d6000803e3d6000fd5b505050505b6113ab856123ad565b611a63611f18565b6001600160a01b038216611acb5760405162461bcd60e51b815260206004820152602960248201527f617070726f766555736167653a20617070726f766520746f20746865207a65726044820152686f206164647265737360b81b60648201526084016109ea565b336000818152600b602090815260408083206001600160a01b03871680855290835292819020859055518481529192917fe75ec259c38e4601f24580968665ec00b21cca4f996689b260ec598aec5c08db910160405180910390a361111660018055565b6001600160a01b0382166000908152601460205260408120548190819081908190879087908110611b725760405162461bcd60e51b81526004016109ea90613296565b6001600160a01b038916600090815260146020526040812080548a908110611b9c57611b9c6132e1565b600091825260209091206005909102018054600182015460028301546003840154600490940154929e919d509b506001600160a01b039092169950975095505050505050565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b611c15611d28565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c80919061320c565b90506111166001600160a01b0383163383611ea6565b611c9e611d28565b6001600160a01b038116611d035760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109ea565b611021816127e9565b6000611d21836001600160a01b0384166128d5565b9392505050565b6000546001600160a01b031633146114685760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109ea565b6001600160a01b038316611de45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016109ea565b6001600160a01b038216611e455760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016109ea565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6040516001600160a01b038316602482015260448101829052611f0990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612924565b505050565b6000610b07825490565b600260015403611f6a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109ea565b6002600155565b60008111611fc15760405162461bcd60e51b815260206004820152601f60248201527f616c6c6f636174653a20616d6f756e742063616e6e6f74206265206e756c6c0060448201526064016109ea565b6001600160a01b038084166000908152601360209081526040808320600b8352818420948716845293909152902054828110156120405760405162461bcd60e51b815260206004820152601f60248201527f616c6c6f636174653a206e6f6e20617574686f72697a656420616d6f756e740060448201526064016109ea565b61204a8184612389565b6001600160a01b038087166000818152600b60209081526040808320948a1680845294825280832095909555918152600c825283812092815291905220546120929084612395565b6001600160a01b038087166000908152600c602090815260408083209389168352929052205581546120c49084612395565b82556120d18530856121bb565b836001600160a01b0316856001600160a01b03167f5168bfb88d6125d4580e2b91ecb103a730312c3e8b0be9c4031a0fc794e2cd5f8560405161211691815260200190565b60405180910390a35050505050565b6001600160a01b03811660009081526001830160205260408120541515611d21565b60006121538484611be2565b90506000198114610dca57818110156121ae5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016109ea565b610dca8484848403611d82565b6001600160a01b03831661221f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016109ea565b6001600160a01b0382166122815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016109ea565b61228c8383836129f9565b6001600160a01b038316600090815260026020526040902054818110156123045760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016109ea565b6001600160a01b0380851660008181526002602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906123649086815260200190565b60405180910390a3610dca565b6000611d21828461333a565b6000611d218284613351565b6000611d21828461323b565b6000611d218284613327565b6000611d218383612a6a565b33600090815260146020526040902080546123ca9060019061323b565b815481106123da576123da6132e1565b906000526020600020906005020160146000336001600160a01b03166001600160a01b03168152602001908152602001600020828154811061241e5761241e6132e1565b600091825260208083208454600590930201918255600180850154908301556002808501549083015560038085015490830180546001600160a01b0319166001600160a01b03909216919091179055600493840154939091019290925533815260149091526040902080548061249657612496613373565b60008281526020812060056000199093019283020181815560018101829055600281018290556003810180546001600160a01b031916905560040155905550565b600081116125315760405162461bcd60e51b815260206004820152602160248201527f6465616c6c6f636174653a20616d6f756e742063616e6e6f74206265206e756c6044820152601b60fa1b60648201526084016109ea565b6001600160a01b038084166000908152600c6020908152604080832093861683529290522054818110156125b15760405162461bcd60e51b815260206004820152602160248201527f6465616c6c6f636174653a206e6f6e20617574686f72697a656420616d6f756e6044820152601d60fa1b60648201526084016109ea565b6125bb8183612389565b6001600160a01b038086166000908152600c60209081526040808320938816835292815282822093909355600d909252812054612601906127109061105c908690612371565b600a546040516305a3b80960e01b81523360048201529192506001600160a01b0316906305a3b80990602401602060405180830381865afa15801561264a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266e9190613389565b15612677575060005b6001600160a01b0385166000908152601360205260409020805461269b9085612389565b81556126b130876126ac8786612389565b6121bb565b6126bb3083612a94565b846001600160a01b0316866001600160a01b03167f7d613f7bd1a777aeeefdd38ae61201003086575188df50618d02482220f5c1478685604051612709929190918252602082015260400190565b60405180910390a3505050505050565b816000036127695760405162461bcd60e51b815260206004820152601e60248201527f636f6e766572743a20616d6f756e742063616e6e6f74206265206e756c6c000060448201526064016109ea565b61279e6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085612bd4565b6127a88183612c0c565b604080516001600160a01b03831681526020810184905233917fccfaeb3043a96a967dc036ab72e078a9632af809671bc2a1ac30a8043645f89e9101610d2d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61286d6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168483611ea6565b6128773083612a94565b60408051838152602081018390526001600160a01b038516917f0da072ebd7a5649099f43a3776eb0cda17aca79426ee9f28aae203f5dfa04eda910160405180910390a2505050565b6000611d21836001600160a01b038416612cd9565b600081815260018301602052604081205461291c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b07565b506000610b07565b6000612979826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612dcc9092919063ffffffff16565b905080516000148061299a57508080602001905181019061299a9190613389565b611f095760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016109ea565b6001600160a01b0383161580612a155750612a15600884612125565b80612a265750612a26600883612125565b611f095760405162461bcd60e51b81526020600482015260156024820152741d1c985b9cd9995c8e881b9bdd08185b1b1bddd959605a1b60448201526064016109ea565b6000826000018281548110612a8157612a816132e1565b9060005260206000200154905092915050565b6001600160a01b038216612af45760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016109ea565b612b00826000836129f9565b6001600160a01b03821660009081526002602052604090205481811015612b745760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016109ea565b6001600160a01b03831660008181526002602090815260408083208686039055600480548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610dca9085906323b872dd60e01b90608401611ed2565b6001600160a01b038216612c625760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016109ea565b612c6e600083836129f9565b8060046000828254612c809190613327565b90915550506001600160a01b0382166000818152600260209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60008181526001830160205260408120548015612dc2576000612cfd60018361323b565b8554909150600090612d119060019061323b565b9050818114612d76576000866000018281548110612d3157612d316132e1565b9060005260206000200154905080876000018481548110612d5457612d546132e1565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612d8757612d87613373565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610b07565b6000915050610b07565b60606110d0848460008585600080866001600160a01b03168587604051612df391906133a6565b60006040518083038185875af1925050503d8060008114612e30576040519150601f19603f3d011682016040523d82523d6000602084013e612e35565b606091505b5091509150612e4687838387612e51565b979650505050505050565b60608315612ec0578251600003612eb9576001600160a01b0385163b612eb95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109ea565b50816110d0565b6110d08383815115612ed55781518083602001fd5b8060405162461bcd60e51b81526004016109ea9190612f71565b6001600160a01b038116811461102157600080fd5b600060208284031215612f1657600080fd5b8135611d2181612eef565b60005b83811015612f3c578181015183820152602001612f24565b50506000910152565b60008151808452612f5d816020860160208601612f21565b601f01601f19169290920160200192915050565b602081526000611d216020830184612f45565b600080600080600060a08688031215612f9c57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60008060408385031215612fd257600080fd5b8235612fdd81612eef565b946020939093013593505050565b6000806000806060858703121561300157600080fd5b843561300c81612eef565b935060208501359250604085013567ffffffffffffffff8082111561303057600080fd5b818701915087601f83011261304457600080fd5b81358181111561305357600080fd5b88602082850101111561306557600080fd5b95989497505060200194505050565b60008060006060848603121561308957600080fd5b833561309481612eef565b925060208401356130a481612eef565b929592945050506040919091013590565b600080604083850312156130c857600080fd5b82356130d381612eef565b915060208301356130e381612eef565b809150509250929050565b60006020828403121561310057600080fd5b5035919050565b6000806040838503121561311a57600080fd5b50508035926020909101359150565b6000806040838503121561313c57600080fd5b8235915060208301356130e381612eef565b801515811461102157600080fd5b6000806040838503121561316f57600080fd5b823561317a81612eef565b915060208301356130e38161314e565b600181811c9082168061319e57607f821691505b6020821081036131be57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526028908201527f75706461746552656465656d53657474696e67733a2077726f6e6720726174696040820152676f2076616c75657360c01b606082015260800190565b60006020828403121561321e57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610b0757610b07613225565b6001600160a01b0385168152602081018490526060604082018190528101829052818360808301376000818301608090810191909152601f909201601f191601019392505050565b6020808252602b908201527f76616c696461746552656465656d3a2072656465656d20656e74727920646f6560408201526a1cc81b9bdd08195e1a5cdd60aa1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60018060a01b038416815282602082015260606040820152600061331e6060830184612f45565b95945050505050565b80820180821115610b0757610b07613225565b8082028115828204841417610b0757610b07613225565b60008261336e57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fd5b60006020828403121561339b57600080fd5b8151611d218161314e565b600082516133b8818460208701612f21565b919091019291505056fea26469706673582212200997da160b88632f1f27ce62edc1117f26ce7a0eee3e36a65c6b780fbeea2bf064736f6c63430008110033000000000000000000000000b279f8dd152b99ec1d84a489d32c35bc0c7f5674

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

000000000000000000000000b279f8dd152b99ec1d84a489d32c35bc0c7f5674

-----Decoded View---------------
Arg [0] : steakToken_ (address): 0xb279f8dd152b99ec1d84a489d32c35bc0c7f5674

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


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.