ETH Price: $3,396.17 (+1.93%)

Token

Sandclock (vested rewards) (vestedQUARTZ)
 

Overview

Max Total Supply

4,468.557434906115653864 vestedQUARTZ

Holders

71

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
2.426477444608737628 vestedQUARTZ

Value
$0.00
0xa7687975c0Af79F9D821cd27fc01722a2eC0d8c3
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
VestedRewards

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license
File 1 of 8 : VestedRewards.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;

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

/**
 * A contract that locks QUARTZ in exchange for freshly minted vestedQUARTZ
 * Meant to be used to give away rewards that then get subject to vesting rules.
 *
 * @notice A start date and a duration are specified on deploy. Before the
 * start date, QUARTZ may be sent to the contract, to mint vestedQUARTZ. Once
 * `start` is reached, no deposits are allowed (to prevent mistakes), and
 * withdrawals are now enabled. Withdrawal limits increase linearly during
 * `duration`, so that after the final end date, holders of vestedQUARTZ are
 * able to exchange 100% of it for QUARTZ.
 *
 * @notice In order to prevent users from circumventing the vesting logic,
 * we block outgoing transfer for any account that has redeemed vestedQUARTZ.
 * This prevents redeemers from redeeming in the middle of the period,
 * then sending remaining tokens to a separate wallet, where they'd be able to
 * redeem an extra share again (effectively being able to redeem 75% when only
 * 50% would be allowed)
 *
 * @notice Quartz can only be redeemed by user-accounts, not contracts. This is implemented to prevent staking contracts and other Dapps from maliciously redeeming user tokens
 */
contract VestedRewards is ERC20, Ownable {
    using SafeERC20 for IERC20;
    using Address for address;

    IERC20 public immutable quartz;
    uint64 public immutable start;
    uint64 public immutable duration;
    uint64 public immutable gracePeriod;

    mapping(address => uint256) public withdrawals;

    // useful to keep 2 decimal precision when dealing with percentages
    uint64 constant MUL = 10000;

    // start                  50%                     100%
    // G 100
    // N 50

    /**
     * @param _quartz the address of the QUARTZ token contract
     * @param _start timestamp at which withdrawals are enabled
     * @param _duration time (in seconds) it takes for vesting to allow full withdrawals
     * @param _gracePeriod time (in seconds) after the original duration until
     * admin clawback actions are enabled
     */
    constructor(
        IERC20 _quartz,
        uint64 _start,
        uint64 _duration,
        uint64 _gracePeriod
    ) ERC20("Sandclock (vested rewards)", "vestedQUARTZ") {
        require(_start > block.timestamp, "start date cannot be in the past");
        require(_duration > 0, "duration cannot be 0");
        require(_gracePeriod > 0, "gracePeriod cannot be 0");

        quartz = _quartz;
        start = _start;
        duration = _duration;
        gracePeriod = _gracePeriod;
    }

    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal override(ERC20) {
        //slither-disable-next-line incorrect-equality
        require(
            withdrawals[sender] == 0,
            "outgoing transfers are locked for this account"
        );

        super._transfer(sender, recipient, amount);
    }

    /**
     * Locks QUARTZ into the contract, in exchange for an equal amount of freshly minted vestedQUARTZ
     *
     * @notice Can only be called before the specified start date
     *
     * @param _amount Amount of QUARTZ to lock
     */
    function deposit(uint256 _amount) external onlyBeforeStart {
        quartz.safeTransferFrom(_msgSender(), address(this), _amount);

        _mint(_msgSender(), _amount);
    }

    /**
     * Burns vestedQUARTZ from the sender's balance, and transfers him an
     * equal amount of QUARTZ
     *
     * @notice Can only be called after the specified start date
     *
     * @notice Amount to transfer is given the sender's current
     * vestedQUARTZ balance, and restricted by vesting rules
     *
     * @notice Withdrawing blocks future outgoing transfers from this account
     */
    function withdraw() external onlyAfterStart {
        _withdraw(_msgSender());
    }

    /**
     * Burns vestedQUARTZ from a given beneficiary's balance, and transfers him
     * an equal amount of QUARTZ
     *
     * @notice Can only be called after the specified start date
     *
     * @notice Amount to transfer is given the beneficiary's current
     * vestedQUARTZ balance, and restricted by vesting rules
     *
     * @notice Can only be called by the owner, to force rewards to be
     * redeemed if necessary
     *
     * @notice Withdrawing blocks future outgoing transfers from this account
     *
     * @param _beneficiary Beneficiary account to withdraw from
     */
    function withdrawFor(address _beneficiary)
        external
        onlyAfterStart
        onlyOwner
    {
        _withdraw(_beneficiary);
    }

    /**
     * Once grace period is over, allows owner to retrieve back any remaining quartz
     * and selfdestruct the contract
     */
    function clawback() external onlyAfterGracePeriod onlyOwner {
        uint256 balance = quartz.balanceOf(address(this));
        quartz.safeTransfer(_msgSender(), balance);

        selfdestruct(payable(_msgSender()));
    }

    /**
     * Calculates how much vestedQUARTZ can be currently redeemed by a beneficiary
     *
     * @notice If start date hasn't been reached yet, or if beneficiary is a contract, withdrawable amount is always 0.
     *
     * @param _beneficiary Beneficiary account
     */
    function withdrawable(address _beneficiary) public view returns (uint256) {
        if (!_started() || _beneficiary.isContract()) {
            return 0;
        }

        uint256 balance = balanceOf(_beneficiary);
        uint256 withdrawn = withdrawals[_beneficiary];

        uint256 unlocked = ((balance + withdrawn) * _durationPercent()) / MUL;

        if (unlocked <= withdrawn) {
            unlocked = 0;
        } else {
            unchecked {
                unlocked -= withdrawn;
            }
        }

        if (unlocked > balance) {
            unlocked = balance;
        }

        return unlocked;
    }

    /**
     * Burns an amount of vestedQUARTZ from beneficiary, and sends him
     * a corresponding amount of QUARTZ
     *
     * @notice Marks the beneficiary as redeemer, which blocks future outgoing
     * transfers from him
     */
    function _withdraw(address _beneficiary) private {
        uint256 amount = withdrawable(_beneficiary);
        require(amount > 0, "nothing to withdraw");

        _burn(_beneficiary, amount);

        withdrawals[_beneficiary] += amount;

        quartz.safeTransfer(_beneficiary, amount);
    }

    /**
     * Calculates the percentage of the timespan given by `start` and `duration`
     *
     * @notice Return value is multiplied by `MUL`, so as to keep precision.
     * Any calculation from this value must later be divided by `MUL` to
     * retrieve the original value
     */
    function _durationPercent() private view returns (uint64) {
        uint64 timestamp = _getBlockTimestamp();

        if (timestamp < start) {
            return 0;
        }

        if (timestamp >= _end()) {
            return MUL;
        }

        return ((timestamp - start) * MUL) / duration;
    }

    function _end() private view returns (uint256) {
        return start + duration;
    }

    function _started() private view returns (bool) {
        return start <= _getBlockTimestamp();
    }

    modifier onlyBeforeStart() {
        require(!_started(), "already started");
        _;
    }

    modifier onlyAfterStart() {
        require(_started(), "not started yet");
        _;
    }

    modifier onlyAfterGracePeriod() {
        require(
            (_end() + gracePeriod) <= block.timestamp,
            "grace period not over yet"
        );
        _;
    }

    function _getBlockTimestamp() private view returns (uint64) {
        return uint64(block.timestamp);
    }
}

File 2 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT

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() {
        _setOwner(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 8 : ERC20.sol
// SPDX-License-Identifier: MIT

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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * 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}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * 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 value {ERC20} uses, unless this function is
     * 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:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, 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}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), 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}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - 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) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][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) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * 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:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, 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;
        _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;
        }
        _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 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 8 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 5 of 8 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

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 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.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;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    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));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    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");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @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");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 7 of 8 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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://diligence.consensys.net/posts/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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 8 : Context.sol
// SPDX-License-Identifier: MIT

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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_quartz","type":"address"},{"internalType":"uint64","name":"_start","type":"uint64"},{"internalType":"uint64","name":"_duration","type":"uint64"},{"internalType":"uint64","name":"_gracePeriod","type":"uint64"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"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":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"clawback","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":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gracePeriod","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","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":[],"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":[],"name":"quartz","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"start","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"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":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","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":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"withdrawFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"withdrawable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101006040523480156200001257600080fd5b5060405162001ce038038062001ce0833981016040819052620000359162000329565b604080518082018252601a81527f53616e64636c6f636b202876657374656420726577617264732900000000000060208083019182528351808501909452600c84526b3b32b9ba32b228aaa0a92a2d60a11b9084015281519192916200009e9160039162000266565b508051620000b490600490602084019062000266565b505050620000d1620000cb6200021060201b60201c565b62000214565b42836001600160401b0316116200012f5760405162461bcd60e51b815260206004820181905260248201527f737461727420646174652063616e6e6f7420626520696e20746865207061737460448201526064015b60405180910390fd5b6000826001600160401b0316116200018a5760405162461bcd60e51b815260206004820152601460248201527f6475726174696f6e2063616e6e6f742062652030000000000000000000000000604482015260640162000126565b6000816001600160401b031611620001e55760405162461bcd60e51b815260206004820152601760248201527f6772616365506572696f642063616e6e6f742062652030000000000000000000604482015260640162000126565b6001600160a01b039093166080526001600160401b0391821660a052811660c0521660e052620003d0565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620002749062000393565b90600052602060002090601f016020900481019282620002985760008555620002e3565b82601f10620002b357805160ff1916838001178555620002e3565b82800160010185558215620002e3579182015b82811115620002e3578251825591602001919060010190620002c6565b50620002f1929150620002f5565b5090565b5b80821115620002f15760008155600101620002f6565b80516001600160401b03811681146200032457600080fd5b919050565b600080600080608085870312156200034057600080fd5b84516001600160a01b03811681146200035857600080fd5b935062000368602086016200030c565b925062000378604086016200030c565b915062000388606086016200030c565b905092959194509250565b600181811c90821680620003a857607f821691505b60208210811415620003ca57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161188962000457600039600081816102cd01526105310152600081816101a301528181610c2a0152610fab01526000818161032d01528181610c4b01528181610cef01528181610f560152610fd2015260008181610354015281816105fc01528181610685015281816108f50152610dae01526118896000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c80638da5cb5b116100c3578063b6b55f251161007c578063b6b55f2514610315578063be9a655514610328578063c0d22e941461034f578063ce513b6f14610376578063dd62ed3e14610389578063f2fde38b146103c257600080fd5b80638da5cb5b1461028857806395d89b41146102ad5780639eca672c146102b5578063a06db7dc146102c8578063a457c2d7146102ef578063a9059cbb1461030257600080fd5b8063313ce56711610115578063313ce5671461020d578063395093511461021c5780633ccfd60b1461022f57806370a0823114610237578063715018a6146102605780637a9262a21461026857600080fd5b806306fdde031461015d578063095ea7b31461017b5780630fb5a6b41461019e57806318160ddd146101de57806323b872dd146101f05780632526d96014610203575b600080fd5b6101656103d5565b6040516101729190611536565b60405180910390f35b61018e610189366004611585565b610467565b6040519015158152602001610172565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b60405167ffffffffffffffff9091168152602001610172565b6002545b604051908152602001610172565b61018e6101fe3660046115af565b61047d565b61020b61052e565b005b60405160128152602001610172565b61018e61022a366004611585565b6106b7565b61020b6106f3565b6101e26102453660046115eb565b6001600160a01b031660009081526020819052604090205490565b61020b610744565b6101e26102763660046115eb565b60066020526000908152604090205481565b6005546001600160a01b03165b6040516001600160a01b039091168152602001610172565b610165610778565b61020b6102c33660046115eb565b610787565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b61018e6102fd366004611585565b610803565b61018e610310366004611585565b61089c565b61020b610323366004611606565b6108a9565b6101c57f000000000000000000000000000000000000000000000000000000000000000081565b6102957f000000000000000000000000000000000000000000000000000000000000000081565b6101e26103843660046115eb565b61092f565b6101e261039736600461161f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61020b6103d03660046115eb565b6109da565b6060600380546103e490611652565b80601f016020809104026020016040519081016040528092919081815260200182805461041090611652565b801561045d5780601f106104325761010080835404028352916020019161045d565b820191906000526020600020905b81548152906001019060200180831161044057829003601f168201915b5050505050905090565b6000610474338484610a72565b50600192915050565b600061048a848484610b96565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156105145760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6105218533858403610a72565b60019150505b9392505050565b427f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16610562610c23565b61056c91906116a3565b11156105ba5760405162461bcd60e51b815260206004820152601960248201527f677261636520706572696f64206e6f74206f7665722079657400000000000000604482015260640161050b565b6005546001600160a01b031633146105e45760405162461bcd60e51b815260040161050b906116bb565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561064657600080fd5b505afa15801561065a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067e91906116f0565b90506106b47f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163383610c7e565b33ff5b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104749185906106ee9086906116a3565b610a72565b6106fb610ce1565b6107395760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cdd185c9d1959081e595d608a1b604482015260640161050b565b61074233610d16565b565b6005546001600160a01b0316331461076e5760405162461bcd60e51b815260040161050b906116bb565b6107426000610dd9565b6060600480546103e490611652565b61078f610ce1565b6107cd5760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cdd185c9d1959081e595d608a1b604482015260640161050b565b6005546001600160a01b031633146107f75760405162461bcd60e51b815260040161050b906116bb565b61080081610d16565b50565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156108855760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161050b565b6108923385858403610a72565b5060019392505050565b6000610474338484610b96565b6108b1610ce1565b156108f05760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e481cdd185c9d1959608a1b604482015260640161050b565b6109257f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316333084610e2b565b6108003382610e69565b6000610939610ce1565b158061094e57506001600160a01b0382163b15155b1561095b57506000919050565b6001600160a01b038216600090815260208181526040808320546006909252822054909161271061098a610f48565b67ffffffffffffffff1661099e84866116a3565b6109a89190611709565b6109b2919061173e565b90508181116109c3575060006109c7565b8190035b828111156109d25750815b949350505050565b6005546001600160a01b03163314610a045760405162461bcd60e51b815260040161050b906116bb565b6001600160a01b038116610a695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161050b565b61080081610dd9565b6001600160a01b038316610ad45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161050b565b6001600160a01b038216610b355760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161050b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526006602052604090205415610c135760405162461bcd60e51b815260206004820152602e60248201527f6f7574676f696e67207472616e736665727320617265206c6f636b656420666f60448201526d1c881d1a1a5cc81858d8dbdd5b9d60921b606482015260840161050b565b610c1e838383611011565b505050565b6000610c6f7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611752565b67ffffffffffffffff16905090565b6040516001600160a01b038316602482015260448101829052610c1e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111df565b67ffffffffffffffff4281167f0000000000000000000000000000000000000000000000000000000000000000909116111590565b6000610d218261092f565b905060008111610d695760405162461bcd60e51b81526020600482015260136024820152726e6f7468696e6720746f20776974686472617760681b604482015260640161050b565b610d7382826112b1565b6001600160a01b03821660009081526006602052604081208054839290610d9b9084906116a3565b90915550610dd590506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168383610c7e565b5050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e639085906323b872dd60e01b90608401610caa565b50505050565b6001600160a01b038216610ebf5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161050b565b8060026000828254610ed191906116a3565b90915550506001600160a01b03821660009081526020819052604081208054839290610efe9084906116a3565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60004267ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081169082161015610f8857600091505090565b610f90610c23565b8167ffffffffffffffff1610610fa95761271091505090565b7f0000000000000000000000000000000000000000000000000000000000000000612710610ff77f00000000000000000000000000000000000000000000000000000000000000008461177e565b61100191906117a7565b61100b91906117d7565b91505090565b6001600160a01b0383166110755760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161050b565b6001600160a01b0382166110d75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161050b565b6001600160a01b0383166000908152602081905260409020548181101561114f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161050b565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906111869084906116a3565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111d291815260200190565b60405180910390a3610e63565b6000611234826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113ff9092919063ffffffff16565b805190915015610c1e578080602001905181019061125291906117fe565b610c1e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161050b565b6001600160a01b0382166113115760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161050b565b6001600160a01b038216600090815260208190526040902054818110156113855760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161050b565b6001600160a01b03831660009081526020819052604081208383039055600280548492906113b4908490611820565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60606109d2848460008585843b6114585760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161050b565b600080866001600160a01b031685876040516114749190611837565b60006040518083038185875af1925050503d80600081146114b1576040519150601f19603f3d011682016040523d82523d6000602084013e6114b6565b606091505b50915091506114c68282866114d1565b979650505050505050565b606083156114e0575081610527565b8251156114f05782518084602001fd5b8160405162461bcd60e51b815260040161050b9190611536565b60005b8381101561152557818101518382015260200161150d565b83811115610e635750506000910152565b602081526000825180602084015261155581604085016020870161150a565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461158057600080fd5b919050565b6000806040838503121561159857600080fd5b6115a183611569565b946020939093013593505050565b6000806000606084860312156115c457600080fd5b6115cd84611569565b92506115db60208501611569565b9150604084013590509250925092565b6000602082840312156115fd57600080fd5b61052782611569565b60006020828403121561161857600080fd5b5035919050565b6000806040838503121561163257600080fd5b61163b83611569565b915061164960208401611569565b90509250929050565b600181811c9082168061166657607f821691505b6020821081141561168757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156116b6576116b661168d565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561170257600080fd5b5051919050565b60008160001904831182151516156117235761172361168d565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261174d5761174d611728565b500490565b600067ffffffffffffffff8083168185168083038211156117755761177561168d565b01949350505050565b600067ffffffffffffffff8381169083168181101561179f5761179f61168d565b039392505050565b600067ffffffffffffffff808316818516818304811182151516156117ce576117ce61168d565b02949350505050565b600067ffffffffffffffff808416806117f2576117f2611728565b92169190910492915050565b60006020828403121561181057600080fd5b8151801515811461052757600080fd5b6000828210156118325761183261168d565b500390565b6000825161184981846020870161150a565b919091019291505056fea264697066735822122027b562a8b612d8c23cf6ba53822853e4a2cbe189530fb2f6f5d732c8691559e564736f6c63430008090033000000000000000000000000ba8a621b4a54e61c442f5ec623687e2a942225ef0000000000000000000000000000000000000000000000000000000061866e40000000000000000000000000000000000000000000000000000000000076a7000000000000000000000000000000000000000000000000000000000000ed4e00

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101585760003560e01c80638da5cb5b116100c3578063b6b55f251161007c578063b6b55f2514610315578063be9a655514610328578063c0d22e941461034f578063ce513b6f14610376578063dd62ed3e14610389578063f2fde38b146103c257600080fd5b80638da5cb5b1461028857806395d89b41146102ad5780639eca672c146102b5578063a06db7dc146102c8578063a457c2d7146102ef578063a9059cbb1461030257600080fd5b8063313ce56711610115578063313ce5671461020d578063395093511461021c5780633ccfd60b1461022f57806370a0823114610237578063715018a6146102605780637a9262a21461026857600080fd5b806306fdde031461015d578063095ea7b31461017b5780630fb5a6b41461019e57806318160ddd146101de57806323b872dd146101f05780632526d96014610203575b600080fd5b6101656103d5565b6040516101729190611536565b60405180910390f35b61018e610189366004611585565b610467565b6040519015158152602001610172565b6101c57f000000000000000000000000000000000000000000000000000000000076a70081565b60405167ffffffffffffffff9091168152602001610172565b6002545b604051908152602001610172565b61018e6101fe3660046115af565b61047d565b61020b61052e565b005b60405160128152602001610172565b61018e61022a366004611585565b6106b7565b61020b6106f3565b6101e26102453660046115eb565b6001600160a01b031660009081526020819052604090205490565b61020b610744565b6101e26102763660046115eb565b60066020526000908152604090205481565b6005546001600160a01b03165b6040516001600160a01b039091168152602001610172565b610165610778565b61020b6102c33660046115eb565b610787565b6101c57f0000000000000000000000000000000000000000000000000000000000ed4e0081565b61018e6102fd366004611585565b610803565b61018e610310366004611585565b61089c565b61020b610323366004611606565b6108a9565b6101c57f0000000000000000000000000000000000000000000000000000000061866e4081565b6102957f000000000000000000000000ba8a621b4a54e61c442f5ec623687e2a942225ef81565b6101e26103843660046115eb565b61092f565b6101e261039736600461161f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61020b6103d03660046115eb565b6109da565b6060600380546103e490611652565b80601f016020809104026020016040519081016040528092919081815260200182805461041090611652565b801561045d5780601f106104325761010080835404028352916020019161045d565b820191906000526020600020905b81548152906001019060200180831161044057829003601f168201915b5050505050905090565b6000610474338484610a72565b50600192915050565b600061048a848484610b96565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156105145760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6105218533858403610a72565b60019150505b9392505050565b427f0000000000000000000000000000000000000000000000000000000000ed4e0067ffffffffffffffff16610562610c23565b61056c91906116a3565b11156105ba5760405162461bcd60e51b815260206004820152601960248201527f677261636520706572696f64206e6f74206f7665722079657400000000000000604482015260640161050b565b6005546001600160a01b031633146105e45760405162461bcd60e51b815260040161050b906116bb565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000ba8a621b4a54e61c442f5ec623687e2a942225ef6001600160a01b0316906370a082319060240160206040518083038186803b15801561064657600080fd5b505afa15801561065a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067e91906116f0565b90506106b47f000000000000000000000000ba8a621b4a54e61c442f5ec623687e2a942225ef6001600160a01b03163383610c7e565b33ff5b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104749185906106ee9086906116a3565b610a72565b6106fb610ce1565b6107395760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cdd185c9d1959081e595d608a1b604482015260640161050b565b61074233610d16565b565b6005546001600160a01b0316331461076e5760405162461bcd60e51b815260040161050b906116bb565b6107426000610dd9565b6060600480546103e490611652565b61078f610ce1565b6107cd5760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cdd185c9d1959081e595d608a1b604482015260640161050b565b6005546001600160a01b031633146107f75760405162461bcd60e51b815260040161050b906116bb565b61080081610d16565b50565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156108855760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161050b565b6108923385858403610a72565b5060019392505050565b6000610474338484610b96565b6108b1610ce1565b156108f05760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e481cdd185c9d1959608a1b604482015260640161050b565b6109257f000000000000000000000000ba8a621b4a54e61c442f5ec623687e2a942225ef6001600160a01b0316333084610e2b565b6108003382610e69565b6000610939610ce1565b158061094e57506001600160a01b0382163b15155b1561095b57506000919050565b6001600160a01b038216600090815260208181526040808320546006909252822054909161271061098a610f48565b67ffffffffffffffff1661099e84866116a3565b6109a89190611709565b6109b2919061173e565b90508181116109c3575060006109c7565b8190035b828111156109d25750815b949350505050565b6005546001600160a01b03163314610a045760405162461bcd60e51b815260040161050b906116bb565b6001600160a01b038116610a695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161050b565b61080081610dd9565b6001600160a01b038316610ad45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161050b565b6001600160a01b038216610b355760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161050b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526006602052604090205415610c135760405162461bcd60e51b815260206004820152602e60248201527f6f7574676f696e67207472616e736665727320617265206c6f636b656420666f60448201526d1c881d1a1a5cc81858d8dbdd5b9d60921b606482015260840161050b565b610c1e838383611011565b505050565b6000610c6f7f000000000000000000000000000000000000000000000000000000000076a7007f0000000000000000000000000000000000000000000000000000000061866e40611752565b67ffffffffffffffff16905090565b6040516001600160a01b038316602482015260448101829052610c1e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111df565b67ffffffffffffffff4281167f0000000000000000000000000000000000000000000000000000000061866e40909116111590565b6000610d218261092f565b905060008111610d695760405162461bcd60e51b81526020600482015260136024820152726e6f7468696e6720746f20776974686472617760681b604482015260640161050b565b610d7382826112b1565b6001600160a01b03821660009081526006602052604081208054839290610d9b9084906116a3565b90915550610dd590506001600160a01b037f000000000000000000000000ba8a621b4a54e61c442f5ec623687e2a942225ef168383610c7e565b5050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e639085906323b872dd60e01b90608401610caa565b50505050565b6001600160a01b038216610ebf5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161050b565b8060026000828254610ed191906116a3565b90915550506001600160a01b03821660009081526020819052604081208054839290610efe9084906116a3565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60004267ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000061866e4081169082161015610f8857600091505090565b610f90610c23565b8167ffffffffffffffff1610610fa95761271091505090565b7f000000000000000000000000000000000000000000000000000000000076a700612710610ff77f0000000000000000000000000000000000000000000000000000000061866e408461177e565b61100191906117a7565b61100b91906117d7565b91505090565b6001600160a01b0383166110755760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161050b565b6001600160a01b0382166110d75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161050b565b6001600160a01b0383166000908152602081905260409020548181101561114f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161050b565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906111869084906116a3565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111d291815260200190565b60405180910390a3610e63565b6000611234826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113ff9092919063ffffffff16565b805190915015610c1e578080602001905181019061125291906117fe565b610c1e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161050b565b6001600160a01b0382166113115760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161050b565b6001600160a01b038216600090815260208190526040902054818110156113855760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161050b565b6001600160a01b03831660009081526020819052604081208383039055600280548492906113b4908490611820565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60606109d2848460008585843b6114585760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161050b565b600080866001600160a01b031685876040516114749190611837565b60006040518083038185875af1925050503d80600081146114b1576040519150601f19603f3d011682016040523d82523d6000602084013e6114b6565b606091505b50915091506114c68282866114d1565b979650505050505050565b606083156114e0575081610527565b8251156114f05782518084602001fd5b8160405162461bcd60e51b815260040161050b9190611536565b60005b8381101561152557818101518382015260200161150d565b83811115610e635750506000910152565b602081526000825180602084015261155581604085016020870161150a565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461158057600080fd5b919050565b6000806040838503121561159857600080fd5b6115a183611569565b946020939093013593505050565b6000806000606084860312156115c457600080fd5b6115cd84611569565b92506115db60208501611569565b9150604084013590509250925092565b6000602082840312156115fd57600080fd5b61052782611569565b60006020828403121561161857600080fd5b5035919050565b6000806040838503121561163257600080fd5b61163b83611569565b915061164960208401611569565b90509250929050565b600181811c9082168061166657607f821691505b6020821081141561168757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156116b6576116b661168d565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561170257600080fd5b5051919050565b60008160001904831182151516156117235761172361168d565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261174d5761174d611728565b500490565b600067ffffffffffffffff8083168185168083038211156117755761177561168d565b01949350505050565b600067ffffffffffffffff8381169083168181101561179f5761179f61168d565b039392505050565b600067ffffffffffffffff808316818516818304811182151516156117ce576117ce61168d565b02949350505050565b600067ffffffffffffffff808416806117f2576117f2611728565b92169190910492915050565b60006020828403121561181057600080fd5b8151801515811461052757600080fd5b6000828210156118325761183261168d565b500390565b6000825161184981846020870161150a565b919091019291505056fea264697066735822122027b562a8b612d8c23cf6ba53822853e4a2cbe189530fb2f6f5d732c8691559e564736f6c63430008090033

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

000000000000000000000000ba8a621b4a54e61c442f5ec623687e2a942225ef0000000000000000000000000000000000000000000000000000000061866e40000000000000000000000000000000000000000000000000000000000076a7000000000000000000000000000000000000000000000000000000000000ed4e00

-----Decoded View---------------
Arg [0] : _quartz (address): 0xbA8A621b4a54e61C442F5Ec623687e2a942225ef
Arg [1] : _start (uint64): 1636200000
Arg [2] : _duration (uint64): 7776000
Arg [3] : _gracePeriod (uint64): 15552000

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000ba8a621b4a54e61c442f5ec623687e2a942225ef
Arg [1] : 0000000000000000000000000000000000000000000000000000000061866e40
Arg [2] : 000000000000000000000000000000000000000000000000000000000076a700
Arg [3] : 0000000000000000000000000000000000000000000000000000000000ed4e00


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.