MATIC Price: $1.02 (+3.70%)
Gas: 65 Gwei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x61018060253930262022-02-27 17:34:05723 days 8 hrs ago1645983245IN
 Create: PurposeV1
0 MATIC0.73489222300.0002125

Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PurposeV1

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 200 runs

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

import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "./shared/ERC20Upgradeable.sol";
import "./shared/Interfaces.sol";
import "./shared/MintMath.sol";

contract PurposeV1 is ERC20Upgradeable, UUPSUpgradeable, IPurpose {
    event Burned(uint256 amount, bytes32[] hodlKeys, bytes data);

    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    IDubi private immutable _dubi;
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    IHodl private immutable _hodl;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor(
        address dubi,
        address hodl,
        address externalAddress1,
        address externalAddress2,
        address externalAddress3,
        address externalAddress4,
        address trustedForwarder
    )
        ERC20Upgradeable(
            externalAddress1,
            externalAddress2,
            externalAddress3,
            externalAddress4,
            trustedForwarder
        )
    {
        require(
            dubi != address(0) || hodl != address(0),
            "PRPS_V1: bad initialize"
        );

        _dubi = IDubi(dubi);
        _hodl = IHodl(hodl);
    }

    struct UnpackedBalance {
        uint96 balance;
        uint96 hodlBalance;
        uint64 __reserved;
    }

    function initialize() public initializer {
        __ERC20_init_unchained("Purpose", "PRPS");
    }

    function balanceOf(address tokenHolder)
        public
        view
        override
        returns (uint256)
    {
        return uint96(_balances[tokenHolder]);
    }

    function hodlBalanceOf(address tokenHolder) public view returns (uint256) {
        return uint96(_balances[tokenHolder] >> 96);
    }

    function mint(address account, uint96 amount) public onlyOwner {
        require(account != address(0), "PRPS_V1: mint to zero address");

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

        UnpackedBalance memory unpacked = _unpackBalance(_balances[account]);
        unpacked.balance += amount;

        _totalSupply += amount;
        _balances[account] = _packBalance(unpacked);

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

    function burn(
        uint96 amount,
        bytes32[] calldata hodlKeys,
        bytes calldata data
    ) public {
        address account = _msgSender();

        require(account != address(0), "PRPS_V1: burn from zero address");

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

        UnpackedBalance memory unpacked = _unpackBalance(_balances[account]);

        uint96 totalDubiToMint;

        // 1) Try to burn unlocked PRPS
        uint96 lockedPrpsToBurn = amount;
        uint96 burnableUnlockedPrps = unpacked.balance;

        // Catch underflow i.e. don't burn more than we need to
        if (burnableUnlockedPrps > amount) {
            burnableUnlockedPrps = amount;
        }

        // Calculate DUBI to mint based on unlocked PRPS we can burn
        totalDubiToMint = MintMath.calculateDubiToMintMax(burnableUnlockedPrps);
        lockedPrpsToBurn -= burnableUnlockedPrps;

        // 2) Burn locked PRPS if there's not enough unlocked PRPS
        if (lockedPrpsToBurn > 0) {
            require(
                unpacked.hodlBalance >= lockedPrpsToBurn,
                "PRPS_V1: insufficient locked"
            );
            require(hodlKeys.length > 0, "PRPS_V1: no hodl keys provided");
            unpacked.hodlBalance -= lockedPrpsToBurn;

            // Reverts if `lockedPrpsToBurn` does not reach 0
            uint96 dubiToMintFromLockedPrps = _hodl.purposeLockedBurn({
                from: account,
                amount: lockedPrpsToBurn,
                dubiMintTimestamp: uint32(block.timestamp),
                hodlKeys: hodlKeys
            });

            totalDubiToMint += dubiToMintFromLockedPrps;
        }

        // Mint DUBI taking differences between burned locked/unlocked into account
        if (totalDubiToMint > 0) {
            _dubi.purposeMint(account, totalDubiToMint);
        }

        require(
            unpacked.balance >= burnableUnlockedPrps,
            "PRPS_V1: not enough unlocked"
        );
        unchecked {
            unpacked.balance -= burnableUnlockedPrps;
        }

        _totalSupply -= burnableUnlockedPrps;
        _balances[account] = _packBalance(unpacked);

        // The `Burned` event is emitted with the total amount that got burned (i.e. locked PRPS + unlocked PRPS).
        emit Burned(amount, hodlKeys, data);

        // We emit a transfer event with the actual burn amount excluding burned locked PRPS.
        emit Transfer(account, address(0), burnableUnlockedPrps);
    }

    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal override {
        require(from != address(0), "PRPS_V1: transfer from zero");
        require(to != address(0), "PRPS_V1: transfer to zero");
        require(amount <= type(uint96).max, "PRPS_V1: bad amount");

        _beforeTokenTransfer(from, to, amount);

        UnpackedBalance memory unpackedFrom = _unpackBalance(_balances[from]);
        UnpackedBalance memory unpackedTo = unpackedFrom;

        // edge case
        if (from != to) {
            unpackedTo = _unpackBalance(_balances[to]);
        }

        uint96 _amount = uint96(amount);

        require(
            unpackedFrom.balance >= _amount,
            "PRPS_V1: insufficient balance"
        );
        unchecked {
            unpackedFrom.balance -= _amount;
        }

        unpackedTo.balance += _amount;

        // We only need to pack twice if from != to
        if (from != to) {
            _balances[to] = _packBalance(unpackedTo);
        }

        _balances[from] = _packBalance(unpackedFrom);

        emit Transfer(from, to, _amount);
    }

    // helper

    function migrateLockedPrps(address account, uint96 hodlAmount) external {
        require(msg.sender == address(_hodl), "PRPS_V1: bad caller");

        UnpackedBalance memory unpacked = _unpackBalance(_balances[account]);
        unpacked.hodlBalance += hodlAmount;

        _balances[account] = _packBalance(unpacked);
    }

    function lockPrps(
        address from,
        address to,
        uint96 amount
    ) external {
        // NOTE: msg.sender is intentional
        require(msg.sender == address(_hodl), "PRPS_V1: bad caller");
        require(from != address(0), "PRPS_V1: transfer from zero");
        require(to != address(0), "PRPS_V1: transfer to zero");

        UnpackedBalance memory unpackedFrom = _unpackBalance(_balances[from]);
        UnpackedBalance memory unpackedTo = unpackedFrom;

        // edge case
        if (from != to) {
            unpackedTo = _unpackBalance(_balances[to]);
        }

        unpackedFrom.balance -= amount;
        unpackedTo.hodlBalance += amount;

        // Reduce totalSupply by locked amount
        _totalSupply -= amount;

        // We only need to pack twice if from != to
        if (from != to) {
            _balances[to] = _packBalance(unpackedTo);
        }

        _balances[from] = _packBalance(unpackedFrom);
    }

    function unlockPrps(address from, uint96 amount) external {
        // NOTE: msg.sender is intentional
        require(msg.sender == address(_hodl), "PRPS_V1: bad caller");
        require(from != address(0), "PRPS_V1: from is zero ");

        UnpackedBalance memory unpackedFrom = _unpackBalance(_balances[from]);
        unpackedFrom.hodlBalance -= amount;
        unpackedFrom.balance += amount;

        // Increase totalSupply by locked amount
        _totalSupply += amount;

        _balances[from] = _packBalance(unpackedFrom);
    }

    function _unpackBalance(uint256 packedData)
        internal
        pure
        returns (UnpackedBalance memory)
    {
        UnpackedBalance memory unpacked;

        // 1) Read balance from the first 96 bits
        unpacked.balance = uint96(packedData);

        // 2) Read hodlBalance from the next 96 bits
        unpacked.hodlBalance = uint96(packedData >> 96);

        // 3) Read __reserved from the next 64 bits
        unpacked.__reserved = uint64(packedData >> (96 + 96));

        return unpacked;
    }

    function _packBalance(UnpackedBalance memory unpacked)
        internal
        pure
        returns (uint256)
    {
        uint256 packedData;

        // 1) Write balance to the first 96 bits
        packedData |= unpacked.balance;

        // 2) Write hodlBalance to the the next 96 bits
        packedData |= uint256(unpacked.hodlBalance) << 96;

        // 3) Write __reserved to the next 64 bits
        packedData |= uint256(unpacked.__reserved) << (96 + 96);

        return packedData;
    }

    // Upgradability

    function _authorizeUpgrade(address) internal view override onlyOwner {}

    function implementation() public view returns (address) {
        return _getImplementation();
    }
}

File 2 of 16 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate that the this implementation remains valid after an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 3 of 16 : ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol)
// https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/tree/ac9661a4957daf94f1512d710e7a7c4df2cb7385

pragma solidity 0.8.12;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.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 ERC20Upgradeable is
    Initializable,
    OwnableUpgradeable,
    ERC2771ContextUpgradeable,
    IERC20Upgradeable,
    IERC20MetadataUpgradeable
{
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable _externalAddress1;
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable _externalAddress2;
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable _externalAddress3;
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable _externalAddress4;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor(
        address externalAddress1,
        address externalAddress2,
        address externalAddress3,
        address externalAddress4,
        address trustedForwarder
    ) ERC2771ContextUpgradeable(trustedForwarder) {
        // IMPORTANT: external addresses cannot include trusted-forwarded address! (breaks approval logic)
        assert(externalAddress1 != trustedForwarder);
        assert(externalAddress2 != trustedForwarder);
        assert(externalAddress3 != trustedForwarder);
        assert(externalAddress4 != trustedForwarder);

        _externalAddress1 = externalAddress1;
        _externalAddress2 = externalAddress2;
        _externalAddress3 = externalAddress3;
        _externalAddress4 = externalAddress4;
    }

    mapping(address => uint256) internal _balances;

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

    uint256 internal _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.
     */
    function __ERC20_init(string memory name_, string memory symbol_)
        internal
        onlyInitializing
    {
        __ERC20_init_unchained(name_, symbol_);
    }

    function __ERC20_init_unchained(string memory name_, string memory symbol_)
        internal
        onlyInitializing
    {
        _name = name_;
        _symbol = symbol_;

        __Ownable_init_unchained();
    }

    /**
     * @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:
     *
     * - `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)
        external
        view
        virtual
        override
        returns (uint256)
    {
        // If msg.sender is equal to trustedForwarder, then this is not accurate.
        if (_skipAllowance(spender)) {
            return type(uint256).max;
        }

        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, _allowances[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 = _allowances[owner][spender];
        require(currentAllowance >= subtractedValue, "ERC20: bad allowance");
        unchecked {
            _approve(owner, 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:
     *
     * - `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 zero");
        require(to != address(0), "ERC20: transfer to zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: bad transfer");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _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;
        _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 zero address");

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

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: bad burn");
        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 zero address");
        require(spender != address(0), "ERC20: approve to zero address");

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

    /**
     * @dev Spend `amount` form the allowance of `owner` toward `spender`.
     *
     * 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 {
        if (_skipAllowance(msg.sender)) {
            return;
        }

        uint256 currentAllowance = _allowances[owner][spender];
        if (currentAllowance != type(uint256).max) {
            require(
                currentAllowance >= amount,
                "ERC20: insufficient allowance"
            );
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    function _skipAllowance(address caller)
        internal
        view
        virtual
        returns (bool)
    {
        return
            (caller == _externalAddress1 && _externalAddress1 != address(0)) ||
            (caller == _externalAddress2 && _externalAddress2 != address(0)) ||
            (caller == _externalAddress3 && _externalAddress3 != address(0)) ||
            (caller == _externalAddress4 && _externalAddress4 != address(0));
    }

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

    function _msgSender()
        internal
        view
        virtual
        override(ERC2771ContextUpgradeable, ContextUpgradeable)
        returns (address sender)
    {
        sender = ERC2771ContextUpgradeable._msgSender();
    }

    function _msgData()
        internal
        view
        virtual
        override(ERC2771ContextUpgradeable, ContextUpgradeable)
        returns (bytes calldata)
    {
        return ERC2771ContextUpgradeable._msgData();
    }

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[45] private __gap;
}

File 4 of 16 : Interfaces.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

interface IDubi {
    function purposeMint(address to, uint96 amount) external;

    function hodlMint(address to, uint96 amount) external;
}

interface IPurpose {
    function migrateLockedPrps(address to, uint96 amount) external;

    function lockPrps(
        address creator,
        address prpsBeneficiary,
        uint96 amount
    ) external;

    function unlockPrps(address from, uint96 amount) external;
}

interface IHodl {
    function purposeLockedBurn(
        address from,
        uint96 amount,
        uint32 dubiMintTimestamp,
        bytes32[] calldata hodlKeys
    ) external returns (uint96);
}

File 5 of 16 : MintMath.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

// NOTE: we ignore leap-seconds etc.
library MintMath {
    // The maximum number of seconds per month (365 * 24 * 60 * 60 / 12)
    uint32 public constant SECONDS_PER_MONTH = 2628000;
    // The maximum number of days PRPS can be finitely locked for
    uint16 public constant MAX_FINITE_LOCK_DURATION_DAYS = 365;
    // The maximum number of seconds PRPS can be finitely locked for
    uint32 public constant MAX_FINITE_LOCK_DURATION_SECONDS =
        uint32(MAX_FINITE_LOCK_DURATION_DAYS) * 24 * 60 * 60;

    /**
     * @dev Calculates the DUBI to mint based on the given amount of PRPS and duration in days.
     * NOTE: We trust the caller to ensure that the duration between 1 and 365.
     */
    function calculateDubiToMintByDays(
        uint256 amountPrps,
        uint16 durationInDays
    ) internal pure returns (uint96) {
        uint32 durationInSeconds = uint32(durationInDays) * 24 * 60 * 60;
        return calculateDubiToMintBySeconds(amountPrps, durationInSeconds);
    }

    /**
     * @dev Calculates the DUBI to mint based on the given amount of PRPS and duration in seconds.
     */
    function calculateDubiToMintBySeconds(
        uint256 amountPrps,
        uint32 durationInSeconds
    ) internal pure returns (uint96) {
        uint256 _percentage = percentage(
            durationInSeconds,
            MAX_FINITE_LOCK_DURATION_SECONDS,
            18 // precision in WEI, 10^18
        ) * 4; // A full lock grants 4%, so multiply by 4.

        // Multiply PRPS by the percentage and then divide by the precision (=10^8)
        // from the previous step
        uint256 _dubiToMint = (amountPrps * _percentage) / (1 ether * 100); // multiply by 100, because we deal with percentages

        // Assert that the calculated DUBI never overflows uint96
        assert(_dubiToMint < 2**96);

        return uint96(_dubiToMint);
    }

    function calculateDubiToMintMax(uint96 amount)
        internal
        pure
        returns (uint96)
    {
        return
            calculateDubiToMintBySeconds(
                amount,
                MAX_FINITE_LOCK_DURATION_SECONDS
            );
    }

    function calculateMintDuration(uint32 _now, uint32 lastWithdrawal)
        internal
        pure
        returns (uint32)
    {
        require(lastWithdrawal > 0 && lastWithdrawal <= _now, "MINT-1");

        uint256 _elapsedTotal = _now - lastWithdrawal;
        uint256 _proRatedYears = _elapsedTotal / SECONDS_PER_MONTH / 12;
        uint256 _elapsedInYear = _elapsedTotal %
            MAX_FINITE_LOCK_DURATION_SECONDS;

        //
        // Examples (using months instead of seconds):
        // calculation formula: (monthsSinceWithdrawal % 12) + (_proRatedYears * 12)

        // 1) Burn after 11 months since last withdrawal (number of years = 11 / 12 + 1 = 1)
        // => (11 % 12) + (years * 12) => 23 months worth of DUBI
        // => 23 months

        // 1) Burn after 4 months since last withdrawal (number of years = 4 / 12 + 1 = 1)
        // => (4 % 12) + (years * 12) => 16 months worth of DUBI
        // => 16 months

        // 2) Burn 0 months after withdrawal after 4 months (number of years = 0 / 12 + 1 = 1):
        // => (0 % 12) + (years * 12) => 12 months worth of DUBI (+ 4 months worth of withdrawn DUBI)
        // => 16 months

        // 3) Burn after 36 months since last withdrawal (number of years = 36 / 12 + 1 = 4)
        // => (36 % 12) + (years * 12) => 48 months worth of DUBI
        // => 48 months

        // 4) Burn 1 month after withdrawal after 35 months (number of years = 1 / 12 + 1 = 1):
        // => (1 % 12) + (years * 12) => 12 month worth of DUBI (+ 35 months worth of withdrawn DUBI)
        // => 47 months
        uint32 _mintDuration = uint32(
            _elapsedInYear + _proRatedYears * MAX_FINITE_LOCK_DURATION_SECONDS
        );

        return _mintDuration;
    }

    function percentage(
        uint256 numerator,
        uint256 denominator,
        uint256 precision
    ) internal pure returns (uint256) {
        return
            ((numerator * (uint256(10)**(precision + 1))) / denominator + 5) /
            uint256(10);
    }
}

File 6 of 16 : draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822ProxiableUpgradeable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 7 of 16 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

    /**
     * @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) private returns (bytes memory) {
        require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 8 of 16 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 9 of 16 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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
     * ====
     *
     * [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://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 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 11 of 16 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

File 12 of 16 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_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 {
        _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);
    }

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 13 of 16 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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);

    /**
     * @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 14 of 16 : IERC20MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
    /**
     * @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 15 of 16 : ERC2771ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (metatx/ERC2771Context.sol)

pragma solidity ^0.8.9;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Context variant with ERC2771 support.
 */
abstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable _trustedForwarder;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor(address trustedForwarder) {
        _trustedForwarder = trustedForwarder;
    }

    function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
        return forwarder == _trustedForwarder;
    }

    function _msgSender() internal view virtual override returns (address sender) {
        if (isTrustedForwarder(msg.sender)) {
            // The assembly code is more direct than the Solidity version using `abi.decode`.
            assembly {
                sender := shr(96, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            return super._msgSender();
        }
    }

    function _msgData() internal view virtual override returns (bytes calldata) {
        if (isTrustedForwarder(msg.sender)) {
            return msg.data[:msg.data.length - 20];
        } else {
            return super._msgData();
        }
    }

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    /**
     * This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"dubi","type":"address"},{"internalType":"address","name":"hodl","type":"address"},{"internalType":"address","name":"externalAddress1","type":"address"},{"internalType":"address","name":"externalAddress2","type":"address"},{"internalType":"address","name":"externalAddress3","type":"address"},{"internalType":"address","name":"externalAddress4","type":"address"},{"internalType":"address","name":"trustedForwarder","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","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":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32[]","name":"hodlKeys","type":"bytes32[]"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"Burned","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","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":"tokenHolder","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint96","name":"amount","type":"uint96"},{"internalType":"bytes32[]","name":"hodlKeys","type":"bytes32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"burn","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":"address","name":"tokenHolder","type":"address"}],"name":"hodlBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint96","name":"amount","type":"uint96"}],"name":"lockPrps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint96","name":"hodlAmount","type":"uint96"}],"name":"migrateLockedPrps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint96","name":"amount","type":"uint96"}],"name":"mint","outputs":[],"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":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","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":"address","name":"from","type":"address"},{"internalType":"uint96","name":"amount","type":"uint96"}],"name":"unlockPrps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]

61018060405230610120523480156200001757600080fd5b5060405162002e3838038062002e388339810160408190526200003a916200019b565b6001600160a01b038082166080819052869186918691869186918616141562000067576200006762000230565b806001600160a01b0316846001600160a01b031614156200008c576200008c62000230565b806001600160a01b0316836001600160a01b03161415620000b157620000b162000230565b806001600160a01b0316826001600160a01b03161415620000d657620000d662000230565b506001600160a01b0393841660a05291831660c052821660e05281166101005287161515806200010e57506001600160a01b03861615155b6200015f5760405162461bcd60e51b815260206004820152601760248201527f505250535f56313a2062616420696e697469616c697a65000000000000000000604482015260640160405180910390fd5b5050506001600160a01b03938416610140525050166101605262000246565b80516001600160a01b03811681146200019657600080fd5b919050565b600080600080600080600060e0888a031215620001b757600080fd5b620001c2886200017e565b9650620001d2602089016200017e565b9550620001e2604089016200017e565b9450620001f2606089016200017e565b935062000202608089016200017e565b92506200021260a089016200017e565b91506200022260c089016200017e565b905092959891949750929550565b634e487b7160e01b600052600160045260246000fd5b60805160a05160c05160e05161010051610120516101405161016051612b386200030060003960008181610a1501528181610e4b015281816110db015261122801526000610f2d015260008181610784015281816107c401528181610899015281816108d90152610955015260008181611df50152611e3b015260008181611d860152611dc2015260008181611d170152611d53015260008181611ca80152611ce40152600081816102e30152611e640152612b386000f3fe6080604052600436106101815760003560e01c806370a08231116100d157806395d89b411161008a578063afaf7cc411610064578063afaf7cc41461047c578063ca56f1771461049c578063dd62ed3e146104de578063f2fde38b146104fe57600080fd5b806395d89b4114610427578063a457c2d71461043c578063a9059cbb1461045c57600080fd5b806370a0823114610360578063715018a61461039f5780638129fc1c146103b45780638b430ff6146103c95780638bdf0651146103e95780638da5cb5b1461040957600080fd5b80633659cfe61161013e57806352d1902d1161011857806352d1902d146102b1578063572b6c05146102c65780635c60da1b146103135780636d5c084f1461034057600080fd5b80633659cfe61461025e578063395093511461027e5780634f1ef2861461029e57600080fd5b806306fdde0314610186578063095ea7b3146101b157806318160ddd146101e15780631b025a401461020057806323b872dd14610222578063313ce56714610242575b600080fd5b34801561019257600080fd5b5061019b61051e565b6040516101a8919061229a565b60405180910390f35b3480156101bd57600080fd5b506101d16101cc3660046122e9565b6105b0565b60405190151581526020016101a8565b3480156101ed57600080fd5b506099545b6040519081526020016101a8565b34801561020c57600080fd5b5061022061021b366004612328565b6105d4565b005b34801561022e57600080fd5b506101d161023d36600461235f565b610749565b34801561024e57600080fd5b50604051601281526020016101a8565b34801561026a57600080fd5b5061022061027936600461239b565b610779565b34801561028a57600080fd5b506101d16102993660046122e9565b610842565b6102206102ac3660046123cc565b61088e565b3480156102bd57600080fd5b506101f2610948565b3480156102d257600080fd5b506101d16102e136600461239b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b34801561031f57600080fd5b506103286109fb565b6040516001600160a01b0390911681526020016101a8565b34801561034c57600080fd5b5061022061035b366004612328565b610a0a565b34801561036c57600080fd5b506101f261037b36600461239b565b6001600160a01b03166000908152609760205260409020546001600160601b031690565b3480156103ab57600080fd5b50610220610b4a565b3480156103c057600080fd5b50610220610b9f565b3480156103d557600080fd5b506102206103e43660046124d7565b610c9c565b3480156103f557600080fd5b50610220610404366004612328565b6110d0565b34801561041557600080fd5b506033546001600160a01b0316610328565b34801561043357600080fd5b5061019b611163565b34801561044857600080fd5b506101d16104573660046122e9565b611172565b34801561046857600080fd5b506101d16104773660046122e9565b611205565b34801561048857600080fd5b5061022061049736600461258b565b61121d565b3480156104a857600080fd5b506101f26104b736600461239b565b6001600160a01b031660009081526097602052604090205460601c6001600160601b031690565b3480156104ea57600080fd5b506101f26104f93660046125d2565b611429565b34801561050a57600080fd5b5061022061051936600461239b565b61146e565b6060609a805461052d90612605565b80601f016020809104026020016040519081016040528092919081815260200182805461055990612605565b80156105a65780601f1061057b576101008083540402835291602001916105a6565b820191906000526020600020905b81548152906001019060200180831161058957829003601f168201915b5050505050905090565b6000806105bb611525565b90506105c881858561152f565b60019150505b92915050565b6105dc611525565b6001600160a01b03166105f76033546001600160a01b031690565b6001600160a01b0316146106265760405162461bcd60e51b815260040161061d90612640565b60405180910390fd5b6001600160a01b03821661067c5760405162461bcd60e51b815260206004820152601d60248201527f505250535f56313a206d696e7420746f207a65726f2061646472657373000000604482015260640161061d565b6001600160a01b03821660009081526097602052604081205461069e90611639565b905081816000018181516106b2919061268b565b6001600160601b03908116909152609980549185169250906000906106d89084906126b6565b909155506106e7905081611684565b6001600160a01b03841660008181526097602090815260408083209490945592516001600160601b0386168152919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91015b60405180910390a3505050565b600080610754611525565b90506107618582856116cb565b61076c858585611770565b60019150505b9392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156107c25760405162461bcd60e51b815260040161061d906126ce565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166107f46119f4565b6001600160a01b03161461081a5760405162461bcd60e51b815260040161061d9061271a565b61082381611a10565b6040805160008082526020820190925261083f91839190611a59565b50565b60008061084d611525565b6001600160a01b038082166000908152609860209081526040808320938916835292905220549091506105c890829086906108899087906126b6565b61152f565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108d75760405162461bcd60e51b815260040161061d906126ce565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166109096119f4565b6001600160a01b03161461092f5760405162461bcd60e51b815260040161061d9061271a565b61093882611a10565b61094482826001611a59565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109e85760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000606482015260840161061d565b50600080516020612abc83398151915290565b6000610a056119f4565b905090565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a525760405162461bcd60e51b815260040161061d90612766565b6001600160a01b038216610aa15760405162461bcd60e51b8152602060048201526016602482015275028292829afab189d10333937b69034b9903d32b937960551b604482015260640161061d565b6001600160a01b038216600090815260976020526040812054610ac390611639565b90508181602001818151610ad79190612793565b6001600160601b0316905250805182908290610af490839061268b565b6001600160601b0390811690915260998054918516925090600090610b1a9084906126b6565b90915550610b29905081611684565b6001600160a01b039093166000908152609760205260409020929092555050565b610b52611525565b6001600160a01b0316610b6d6033546001600160a01b031690565b6001600160a01b031614610b935760405162461bcd60e51b815260040161061d90612640565b610b9d6000611bc4565b565b600054610100900460ff16610bba5760005460ff1615610bbe565b303b155b610c215760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061d565b600054610100900460ff16158015610c43576000805461ffff19166101011790555b610c8860405180604001604052806007815260200166507572706f736560c81b815250604051806040016040528060048152602001635052505360e01b815250611c16565b801561083f576000805461ff001916905550565b6000610ca6611525565b90506001600160a01b038116610cfe5760405162461bcd60e51b815260206004820152601f60248201527f505250535f56313a206275726e2066726f6d207a65726f206164647265737300604482015260640161061d565b6001600160a01b038116600090815260976020526040812054610d2090611639565b805190915060009088906001600160601b038083169082161115610d415750885b610d4a81611c6d565b9250610d568183612793565b91506001600160601b03821615610ef057816001600160601b031684602001516001600160601b03161015610dcd5760405162461bcd60e51b815260206004820152601c60248201527f505250535f56313a20696e73756666696369656e74206c6f636b656400000000604482015260640161061d565b87610e1a5760405162461bcd60e51b815260206004820152601e60248201527f505250535f56313a206e6f20686f646c206b6579732070726f76696465640000604482015260640161061d565b8184602001818151610e2c9190612793565b9150906001600160601b031690816001600160601b03168152505060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c4af3b1e8785428e8e6040518663ffffffff1660e01b8152600401610e9d9594939291906127f1565b6020604051808303816000875af1158015610ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee0919061283c565b9050610eec818561268b565b9350505b6001600160601b03831615610f8a57604051638637f7a160e01b81526001600160a01b0386811660048301526001600160601b03851660248301527f00000000000000000000000000000000000000000000000000000000000000001690638637f7a190604401600060405180830381600087803b158015610f7157600080fd5b505af1158015610f85573d6000803e3d6000fd5b505050505b83516001600160601b0380831691161015610fe75760405162461bcd60e51b815260206004820152601c60248201527f505250535f56313a206e6f7420656e6f75676820756e6c6f636b656400000000604482015260640161061d565b83516001600160601b039082900381168552609980549183169160009061100f908490612859565b9091555061101e905084611684565b6001600160a01b0386166000908152609760205260409081902091909155517f4192ece38df87b9f0bffdc4e3fa17f609dfb22442a04e54b55264137babea08e90611072908c908c908c908c908c90612870565b60405180910390a16040516001600160601b03821681526000906001600160a01b038716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111185760405162461bcd60e51b815260040161061d90612766565b6001600160a01b03821660009081526097602052604081205461113a90611639565b9050818160200181815161114e919061268b565b6001600160601b0316905250610b2981611684565b6060609b805461052d90612605565b60008061117d611525565b6001600160a01b03808216600090815260986020908152604080832093891683529290522054909150838110156111ed5760405162461bcd60e51b815260206004820152601460248201527345524332303a2062616420616c6c6f77616e636560601b604482015260640161061d565b6111fa828686840361152f565b506001949350505050565b600080611210611525565b90506105c8818585611770565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112655760405162461bcd60e51b815260040161061d90612766565b6001600160a01b0383166112bb5760405162461bcd60e51b815260206004820152601b60248201527f505250535f56313a207472616e736665722066726f6d207a65726f0000000000604482015260640161061d565b6001600160a01b03821661130d5760405162461bcd60e51b8152602060048201526019602482015278505250535f56313a207472616e7366657220746f207a65726f60381b604482015260640161061d565b6001600160a01b03831660009081526097602052604081205461132f90611639565b9050806001600160a01b038581169085161461136a576001600160a01b03841660009081526097602052604090205461136790611639565b90505b828260000181815161137c9190612793565b6001600160601b031690525060208101805184919061139c90839061268b565b6001600160601b03908116909152609980549186169250906000906113c2908490612859565b90915550506001600160a01b03858116908516146113fd576113e381611684565b6001600160a01b0385166000908152609760205260409020555b61140682611684565b6001600160a01b0390951660009081526097602052604090209490945550505050565b600061143482611ca4565b1561144257506000196105ce565b506001600160a01b03918216600090815260986020908152604080832093909416825291909152205490565b611476611525565b6001600160a01b03166114916033546001600160a01b031690565b6001600160a01b0316146114b75760405162461bcd60e51b815260040161061d90612640565b6001600160a01b03811661151c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061d565b61083f81611bc4565b6000610a05611e60565b6001600160a01b0383166115855760405162461bcd60e51b815260206004820181905260248201527f45524332303a20617070726f76652066726f6d207a65726f2061646472657373604482015260640161061d565b6001600160a01b0382166115db5760405162461bcd60e51b815260206004820152601e60248201527f45524332303a20617070726f766520746f207a65726f20616464726573730000604482015260640161061d565b6001600160a01b0383811660008181526098602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910161073c565b505050565b60408051606080820183526000808352602080840182905292840152825180820184526001600160601b0385811682529185901c9091169181019190915260c09290921c9082015290565b805160208201516040909201516001600160c01b031960c09190911b166bffffffffffffffffffffffff60601b60609390931b929092166001600160601b03909116171790565b6116d433611ca4565b156116de57505050565b6001600160a01b03808416600090815260986020908152604080832093861683529290522054600019811461176a578181101561175d5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161061d565b61176a848484840361152f565b50505050565b6001600160a01b0383166117c65760405162461bcd60e51b815260206004820152601b60248201527f505250535f56313a207472616e736665722066726f6d207a65726f0000000000604482015260640161061d565b6001600160a01b0382166118185760405162461bcd60e51b8152602060048201526019602482015278505250535f56313a207472616e7366657220746f207a65726f60381b604482015260640161061d565b6001600160601b038111156118655760405162461bcd60e51b815260206004820152601360248201527214149414d7d58c4e8818985908185b5bdd5b9d606a1b604482015260640161061d565b6001600160a01b03831660009081526097602052604081205461188790611639565b9050806001600160a01b03858116908516146118c2576001600160a01b0384166000908152609760205260409020546118bf90611639565b90505b815183906001600160601b03808316911610156119215760405162461bcd60e51b815260206004820152601d60248201527f505250535f56313a20696e73756666696369656e742062616c616e6365000000604482015260640161061d565b82518190036001600160601b0316835281518190839061194290839061268b565b6001600160601b03169052506001600160a01b03868116908616146119845761196a82611684565b6001600160a01b0386166000908152609760205260409020555b61198d83611684565b6001600160a01b0387811660008181526097602090815260409182902094909455516001600160601b03851681529188169290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600080516020612abc833981519152546001600160a01b031690565b611a18611525565b6001600160a01b0316611a336033546001600160a01b031690565b6001600160a01b03161461083f5760405162461bcd60e51b815260040161061d90612640565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611a8c5761163483611ea5565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611ae6575060408051601f3d908101601f19168201909252611ae3918101906128c8565b60015b611b495760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b606482015260840161061d565b600080516020612abc8339815191528114611bb85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b606482015260840161061d565b50611634838383611f41565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16611c3d5760405162461bcd60e51b815260040161061d906128e1565b8151611c5090609a9060208501906121d5565b508051611c6490609b9060208401906121d5565b50610944611f66565b60006105ce6001600160601b038316611c8961016d601861292c565b611c9490603c61292c565b611c9f90603c61292c565b611f9d565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316148015611d0f57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b80611d7e57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316148015611d7e57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b80611ded57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316148015611ded57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b806105ce57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161480156105ce575050506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016151590565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316331415611ea0575060131936013560601c90565b503390565b6001600160a01b0381163b611f125760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161061d565b600080516020612abc83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611f4a83612024565b600082511180611f575750805b156116345761176a8383612064565b600054610100900460ff16611f8d5760405162461bcd60e51b815260040161061d906128e1565b610b9d611f98611525565b611bc4565b600080611fda63ffffffff8416611fb761016d601861292c565b611fc290603c61292c565b611fcd90603c61292c565b63ffffffff166012612158565b611fe5906004612958565b9050600068056bc75e2d63100000611ffd8387612958565b6120079190612977565b9050600160601b811061201c5761201c612999565b949350505050565b61202d81611ea5565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6120cc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161061d565b600080846001600160a01b0316846040516120e791906129af565b600060405180830381855af49150503d8060008114612122576040519150601f19603f3d011682016040523d82523d6000602084013e612127565b606091505b509150915061214f8282604051806060016040528060278152602001612adc6027913961219c565b95945050505050565b6000600a836121688460016126b6565b61217390600a612aaf565b61217d9087612958565b6121879190612977565b6121929060056126b6565b61201c9190612977565b606083156121ab575081610772565b8251156121bb5782518084602001fd5b8160405162461bcd60e51b815260040161061d919061229a565b8280546121e190612605565b90600052602060002090601f0160209004810192826122035760008555612249565b82601f1061221c57805160ff1916838001178555612249565b82800160010185558215612249579182015b8281111561224957825182559160200191906001019061222e565b50612255929150612259565b5090565b5b80821115612255576000815560010161225a565b60005b83811015612289578181015183820152602001612271565b8381111561176a5750506000910152565b60208152600082518060208401526122b981604085016020870161226e565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146122e457600080fd5b919050565b600080604083850312156122fc57600080fd5b612305836122cd565b946020939093013593505050565b6001600160601b038116811461083f57600080fd5b6000806040838503121561233b57600080fd5b612344836122cd565b9150602083013561235481612313565b809150509250929050565b60008060006060848603121561237457600080fd5b61237d846122cd565b925061238b602085016122cd565b9150604084013590509250925092565b6000602082840312156123ad57600080fd5b610772826122cd565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156123df57600080fd5b6123e8836122cd565b9150602083013567ffffffffffffffff8082111561240557600080fd5b818501915085601f83011261241957600080fd5b81358181111561242b5761242b6123b6565b604051601f8201601f19908116603f01168101908382118183101715612453576124536123b6565b8160405282815288602084870101111561246c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f8401126124a057600080fd5b50813567ffffffffffffffff8111156124b857600080fd5b6020830191508360208285010111156124d057600080fd5b9250929050565b6000806000806000606086880312156124ef57600080fd5b85356124fa81612313565b9450602086013567ffffffffffffffff8082111561251757600080fd5b818801915088601f83011261252b57600080fd5b81358181111561253a57600080fd5b8960208260051b850101111561254f57600080fd5b60208301965080955050604088013591508082111561256d57600080fd5b5061257a8882890161248e565b969995985093965092949392505050565b6000806000606084860312156125a057600080fd5b6125a9846122cd565b92506125b7602085016122cd565b915060408401356125c781612313565b809150509250925092565b600080604083850312156125e557600080fd5b6125ee836122cd565b91506125fc602084016122cd565b90509250929050565b600181811c9082168061261957607f821691505b6020821081141561263a57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60006001600160601b038083168185168083038211156126ad576126ad612675565b01949350505050565b600082198211156126c9576126c9612675565b500190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526013908201527228292829afab189d103130b21031b0b63632b960691b604082015260600190565b60006001600160601b03838116908316818110156127b3576127b3612675565b039392505050565b81835260006001600160fb1b038311156127d457600080fd5b8260051b8083602087013760009401602001938452509192915050565b6001600160a01b03861681526001600160601b038516602082015263ffffffff8416604082015260806060820181905260009061283190830184866127bb565b979650505050505050565b60006020828403121561284e57600080fd5b815161077281612313565b60008282101561286b5761286b612675565b500390565b6001600160601b03861681526060602082015260006128936060830186886127bb565b8281036040840152838152838560208301376000602085830101526020601f19601f8601168201019150509695505050505050565b6000602082840312156128da57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600063ffffffff8083168185168183048111821515161561294f5761294f612675565b02949350505050565b600081600019048311821515161561297257612972612675565b500290565b60008261299457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052600160045260246000fd5b600082516129c181846020870161226e565b9190910192915050565b600181815b80851115612a065781600019048211156129ec576129ec612675565b808516156129f957918102915b93841c93908002906129d0565b509250929050565b600082612a1d575060016105ce565b81612a2a575060006105ce565b8160018114612a405760028114612a4a57612a66565b60019150506105ce565b60ff841115612a5b57612a5b612675565b50506001821b6105ce565b5060208310610133831016604e8410600b8410161715612a89575081810a6105ce565b612a9383836129cb565b8060001904821115612aa757612aa7612675565b029392505050565b60006107728383612a0e56fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201b07fd30220f17d35dca01646f9d41fb05f8e0a8f75b8c6e1ce152f85e324e9564736f6c634300080c0033000000000000000000000000950e1561b7a7deb1a32a6419fd435410daf851b00000000000000000000000000ff652f7e5389ef66cb0c1add614f5a50d1e2e340000000000000000000000002d6b4a5fba283a7d95948a3730d4913ed2a63b4f000000000000000000000000a5e0829caced8ffdd4de3c43696c57f7d7a678ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000086c80a8aa58e0a4fa09a69624c31ab2a6cad56b8

Deployed Bytecode

0x6080604052600436106101815760003560e01c806370a08231116100d157806395d89b411161008a578063afaf7cc411610064578063afaf7cc41461047c578063ca56f1771461049c578063dd62ed3e146104de578063f2fde38b146104fe57600080fd5b806395d89b4114610427578063a457c2d71461043c578063a9059cbb1461045c57600080fd5b806370a0823114610360578063715018a61461039f5780638129fc1c146103b45780638b430ff6146103c95780638bdf0651146103e95780638da5cb5b1461040957600080fd5b80633659cfe61161013e57806352d1902d1161011857806352d1902d146102b1578063572b6c05146102c65780635c60da1b146103135780636d5c084f1461034057600080fd5b80633659cfe61461025e578063395093511461027e5780634f1ef2861461029e57600080fd5b806306fdde0314610186578063095ea7b3146101b157806318160ddd146101e15780631b025a401461020057806323b872dd14610222578063313ce56714610242575b600080fd5b34801561019257600080fd5b5061019b61051e565b6040516101a8919061229a565b60405180910390f35b3480156101bd57600080fd5b506101d16101cc3660046122e9565b6105b0565b60405190151581526020016101a8565b3480156101ed57600080fd5b506099545b6040519081526020016101a8565b34801561020c57600080fd5b5061022061021b366004612328565b6105d4565b005b34801561022e57600080fd5b506101d161023d36600461235f565b610749565b34801561024e57600080fd5b50604051601281526020016101a8565b34801561026a57600080fd5b5061022061027936600461239b565b610779565b34801561028a57600080fd5b506101d16102993660046122e9565b610842565b6102206102ac3660046123cc565b61088e565b3480156102bd57600080fd5b506101f2610948565b3480156102d257600080fd5b506101d16102e136600461239b565b7f00000000000000000000000086c80a8aa58e0a4fa09a69624c31ab2a6cad56b86001600160a01b0390811691161490565b34801561031f57600080fd5b506103286109fb565b6040516001600160a01b0390911681526020016101a8565b34801561034c57600080fd5b5061022061035b366004612328565b610a0a565b34801561036c57600080fd5b506101f261037b36600461239b565b6001600160a01b03166000908152609760205260409020546001600160601b031690565b3480156103ab57600080fd5b50610220610b4a565b3480156103c057600080fd5b50610220610b9f565b3480156103d557600080fd5b506102206103e43660046124d7565b610c9c565b3480156103f557600080fd5b50610220610404366004612328565b6110d0565b34801561041557600080fd5b506033546001600160a01b0316610328565b34801561043357600080fd5b5061019b611163565b34801561044857600080fd5b506101d16104573660046122e9565b611172565b34801561046857600080fd5b506101d16104773660046122e9565b611205565b34801561048857600080fd5b5061022061049736600461258b565b61121d565b3480156104a857600080fd5b506101f26104b736600461239b565b6001600160a01b031660009081526097602052604090205460601c6001600160601b031690565b3480156104ea57600080fd5b506101f26104f93660046125d2565b611429565b34801561050a57600080fd5b5061022061051936600461239b565b61146e565b6060609a805461052d90612605565b80601f016020809104026020016040519081016040528092919081815260200182805461055990612605565b80156105a65780601f1061057b576101008083540402835291602001916105a6565b820191906000526020600020905b81548152906001019060200180831161058957829003601f168201915b5050505050905090565b6000806105bb611525565b90506105c881858561152f565b60019150505b92915050565b6105dc611525565b6001600160a01b03166105f76033546001600160a01b031690565b6001600160a01b0316146106265760405162461bcd60e51b815260040161061d90612640565b60405180910390fd5b6001600160a01b03821661067c5760405162461bcd60e51b815260206004820152601d60248201527f505250535f56313a206d696e7420746f207a65726f2061646472657373000000604482015260640161061d565b6001600160a01b03821660009081526097602052604081205461069e90611639565b905081816000018181516106b2919061268b565b6001600160601b03908116909152609980549185169250906000906106d89084906126b6565b909155506106e7905081611684565b6001600160a01b03841660008181526097602090815260408083209490945592516001600160601b0386168152919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91015b60405180910390a3505050565b600080610754611525565b90506107618582856116cb565b61076c858585611770565b60019150505b9392505050565b306001600160a01b037f0000000000000000000000002f7c6856c2f080b729d19675307642ecc174748e1614156107c25760405162461bcd60e51b815260040161061d906126ce565b7f0000000000000000000000002f7c6856c2f080b729d19675307642ecc174748e6001600160a01b03166107f46119f4565b6001600160a01b03161461081a5760405162461bcd60e51b815260040161061d9061271a565b61082381611a10565b6040805160008082526020820190925261083f91839190611a59565b50565b60008061084d611525565b6001600160a01b038082166000908152609860209081526040808320938916835292905220549091506105c890829086906108899087906126b6565b61152f565b306001600160a01b037f0000000000000000000000002f7c6856c2f080b729d19675307642ecc174748e1614156108d75760405162461bcd60e51b815260040161061d906126ce565b7f0000000000000000000000002f7c6856c2f080b729d19675307642ecc174748e6001600160a01b03166109096119f4565b6001600160a01b03161461092f5760405162461bcd60e51b815260040161061d9061271a565b61093882611a10565b61094482826001611a59565b5050565b6000306001600160a01b037f0000000000000000000000002f7c6856c2f080b729d19675307642ecc174748e16146109e85760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000606482015260840161061d565b50600080516020612abc83398151915290565b6000610a056119f4565b905090565b336001600160a01b037f0000000000000000000000000ff652f7e5389ef66cb0c1add614f5a50d1e2e341614610a525760405162461bcd60e51b815260040161061d90612766565b6001600160a01b038216610aa15760405162461bcd60e51b8152602060048201526016602482015275028292829afab189d10333937b69034b9903d32b937960551b604482015260640161061d565b6001600160a01b038216600090815260976020526040812054610ac390611639565b90508181602001818151610ad79190612793565b6001600160601b0316905250805182908290610af490839061268b565b6001600160601b0390811690915260998054918516925090600090610b1a9084906126b6565b90915550610b29905081611684565b6001600160a01b039093166000908152609760205260409020929092555050565b610b52611525565b6001600160a01b0316610b6d6033546001600160a01b031690565b6001600160a01b031614610b935760405162461bcd60e51b815260040161061d90612640565b610b9d6000611bc4565b565b600054610100900460ff16610bba5760005460ff1615610bbe565b303b155b610c215760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061d565b600054610100900460ff16158015610c43576000805461ffff19166101011790555b610c8860405180604001604052806007815260200166507572706f736560c81b815250604051806040016040528060048152602001635052505360e01b815250611c16565b801561083f576000805461ff001916905550565b6000610ca6611525565b90506001600160a01b038116610cfe5760405162461bcd60e51b815260206004820152601f60248201527f505250535f56313a206275726e2066726f6d207a65726f206164647265737300604482015260640161061d565b6001600160a01b038116600090815260976020526040812054610d2090611639565b805190915060009088906001600160601b038083169082161115610d415750885b610d4a81611c6d565b9250610d568183612793565b91506001600160601b03821615610ef057816001600160601b031684602001516001600160601b03161015610dcd5760405162461bcd60e51b815260206004820152601c60248201527f505250535f56313a20696e73756666696369656e74206c6f636b656400000000604482015260640161061d565b87610e1a5760405162461bcd60e51b815260206004820152601e60248201527f505250535f56313a206e6f20686f646c206b6579732070726f76696465640000604482015260640161061d565b8184602001818151610e2c9190612793565b9150906001600160601b031690816001600160601b03168152505060007f0000000000000000000000000ff652f7e5389ef66cb0c1add614f5a50d1e2e346001600160a01b031663c4af3b1e8785428e8e6040518663ffffffff1660e01b8152600401610e9d9594939291906127f1565b6020604051808303816000875af1158015610ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee0919061283c565b9050610eec818561268b565b9350505b6001600160601b03831615610f8a57604051638637f7a160e01b81526001600160a01b0386811660048301526001600160601b03851660248301527f000000000000000000000000950e1561b7a7deb1a32a6419fd435410daf851b01690638637f7a190604401600060405180830381600087803b158015610f7157600080fd5b505af1158015610f85573d6000803e3d6000fd5b505050505b83516001600160601b0380831691161015610fe75760405162461bcd60e51b815260206004820152601c60248201527f505250535f56313a206e6f7420656e6f75676820756e6c6f636b656400000000604482015260640161061d565b83516001600160601b039082900381168552609980549183169160009061100f908490612859565b9091555061101e905084611684565b6001600160a01b0386166000908152609760205260409081902091909155517f4192ece38df87b9f0bffdc4e3fa17f609dfb22442a04e54b55264137babea08e90611072908c908c908c908c908c90612870565b60405180910390a16040516001600160601b03821681526000906001600160a01b038716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050505050505050565b336001600160a01b037f0000000000000000000000000ff652f7e5389ef66cb0c1add614f5a50d1e2e3416146111185760405162461bcd60e51b815260040161061d90612766565b6001600160a01b03821660009081526097602052604081205461113a90611639565b9050818160200181815161114e919061268b565b6001600160601b0316905250610b2981611684565b6060609b805461052d90612605565b60008061117d611525565b6001600160a01b03808216600090815260986020908152604080832093891683529290522054909150838110156111ed5760405162461bcd60e51b815260206004820152601460248201527345524332303a2062616420616c6c6f77616e636560601b604482015260640161061d565b6111fa828686840361152f565b506001949350505050565b600080611210611525565b90506105c8818585611770565b336001600160a01b037f0000000000000000000000000ff652f7e5389ef66cb0c1add614f5a50d1e2e3416146112655760405162461bcd60e51b815260040161061d90612766565b6001600160a01b0383166112bb5760405162461bcd60e51b815260206004820152601b60248201527f505250535f56313a207472616e736665722066726f6d207a65726f0000000000604482015260640161061d565b6001600160a01b03821661130d5760405162461bcd60e51b8152602060048201526019602482015278505250535f56313a207472616e7366657220746f207a65726f60381b604482015260640161061d565b6001600160a01b03831660009081526097602052604081205461132f90611639565b9050806001600160a01b038581169085161461136a576001600160a01b03841660009081526097602052604090205461136790611639565b90505b828260000181815161137c9190612793565b6001600160601b031690525060208101805184919061139c90839061268b565b6001600160601b03908116909152609980549186169250906000906113c2908490612859565b90915550506001600160a01b03858116908516146113fd576113e381611684565b6001600160a01b0385166000908152609760205260409020555b61140682611684565b6001600160a01b0390951660009081526097602052604090209490945550505050565b600061143482611ca4565b1561144257506000196105ce565b506001600160a01b03918216600090815260986020908152604080832093909416825291909152205490565b611476611525565b6001600160a01b03166114916033546001600160a01b031690565b6001600160a01b0316146114b75760405162461bcd60e51b815260040161061d90612640565b6001600160a01b03811661151c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061d565b61083f81611bc4565b6000610a05611e60565b6001600160a01b0383166115855760405162461bcd60e51b815260206004820181905260248201527f45524332303a20617070726f76652066726f6d207a65726f2061646472657373604482015260640161061d565b6001600160a01b0382166115db5760405162461bcd60e51b815260206004820152601e60248201527f45524332303a20617070726f766520746f207a65726f20616464726573730000604482015260640161061d565b6001600160a01b0383811660008181526098602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910161073c565b505050565b60408051606080820183526000808352602080840182905292840152825180820184526001600160601b0385811682529185901c9091169181019190915260c09290921c9082015290565b805160208201516040909201516001600160c01b031960c09190911b166bffffffffffffffffffffffff60601b60609390931b929092166001600160601b03909116171790565b6116d433611ca4565b156116de57505050565b6001600160a01b03808416600090815260986020908152604080832093861683529290522054600019811461176a578181101561175d5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161061d565b61176a848484840361152f565b50505050565b6001600160a01b0383166117c65760405162461bcd60e51b815260206004820152601b60248201527f505250535f56313a207472616e736665722066726f6d207a65726f0000000000604482015260640161061d565b6001600160a01b0382166118185760405162461bcd60e51b8152602060048201526019602482015278505250535f56313a207472616e7366657220746f207a65726f60381b604482015260640161061d565b6001600160601b038111156118655760405162461bcd60e51b815260206004820152601360248201527214149414d7d58c4e8818985908185b5bdd5b9d606a1b604482015260640161061d565b6001600160a01b03831660009081526097602052604081205461188790611639565b9050806001600160a01b03858116908516146118c2576001600160a01b0384166000908152609760205260409020546118bf90611639565b90505b815183906001600160601b03808316911610156119215760405162461bcd60e51b815260206004820152601d60248201527f505250535f56313a20696e73756666696369656e742062616c616e6365000000604482015260640161061d565b82518190036001600160601b0316835281518190839061194290839061268b565b6001600160601b03169052506001600160a01b03868116908616146119845761196a82611684565b6001600160a01b0386166000908152609760205260409020555b61198d83611684565b6001600160a01b0387811660008181526097602090815260409182902094909455516001600160601b03851681529188169290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600080516020612abc833981519152546001600160a01b031690565b611a18611525565b6001600160a01b0316611a336033546001600160a01b031690565b6001600160a01b03161461083f5760405162461bcd60e51b815260040161061d90612640565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611a8c5761163483611ea5565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611ae6575060408051601f3d908101601f19168201909252611ae3918101906128c8565b60015b611b495760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b606482015260840161061d565b600080516020612abc8339815191528114611bb85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b606482015260840161061d565b50611634838383611f41565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16611c3d5760405162461bcd60e51b815260040161061d906128e1565b8151611c5090609a9060208501906121d5565b508051611c6490609b9060208401906121d5565b50610944611f66565b60006105ce6001600160601b038316611c8961016d601861292c565b611c9490603c61292c565b611c9f90603c61292c565b611f9d565b60007f0000000000000000000000002d6b4a5fba283a7d95948a3730d4913ed2a63b4f6001600160a01b0316826001600160a01b0316148015611d0f57507f0000000000000000000000002d6b4a5fba283a7d95948a3730d4913ed2a63b4f6001600160a01b031615155b80611d7e57507f000000000000000000000000a5e0829caced8ffdd4de3c43696c57f7d7a678ff6001600160a01b0316826001600160a01b0316148015611d7e57507f000000000000000000000000a5e0829caced8ffdd4de3c43696c57f7d7a678ff6001600160a01b031615155b80611ded57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316148015611ded57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b806105ce57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161480156105ce575050506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016151590565b60007f00000000000000000000000086c80a8aa58e0a4fa09a69624c31ab2a6cad56b86001600160a01b0316331415611ea0575060131936013560601c90565b503390565b6001600160a01b0381163b611f125760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161061d565b600080516020612abc83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611f4a83612024565b600082511180611f575750805b156116345761176a8383612064565b600054610100900460ff16611f8d5760405162461bcd60e51b815260040161061d906128e1565b610b9d611f98611525565b611bc4565b600080611fda63ffffffff8416611fb761016d601861292c565b611fc290603c61292c565b611fcd90603c61292c565b63ffffffff166012612158565b611fe5906004612958565b9050600068056bc75e2d63100000611ffd8387612958565b6120079190612977565b9050600160601b811061201c5761201c612999565b949350505050565b61202d81611ea5565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6120cc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161061d565b600080846001600160a01b0316846040516120e791906129af565b600060405180830381855af49150503d8060008114612122576040519150601f19603f3d011682016040523d82523d6000602084013e612127565b606091505b509150915061214f8282604051806060016040528060278152602001612adc6027913961219c565b95945050505050565b6000600a836121688460016126b6565b61217390600a612aaf565b61217d9087612958565b6121879190612977565b6121929060056126b6565b61201c9190612977565b606083156121ab575081610772565b8251156121bb5782518084602001fd5b8160405162461bcd60e51b815260040161061d919061229a565b8280546121e190612605565b90600052602060002090601f0160209004810192826122035760008555612249565b82601f1061221c57805160ff1916838001178555612249565b82800160010185558215612249579182015b8281111561224957825182559160200191906001019061222e565b50612255929150612259565b5090565b5b80821115612255576000815560010161225a565b60005b83811015612289578181015183820152602001612271565b8381111561176a5750506000910152565b60208152600082518060208401526122b981604085016020870161226e565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146122e457600080fd5b919050565b600080604083850312156122fc57600080fd5b612305836122cd565b946020939093013593505050565b6001600160601b038116811461083f57600080fd5b6000806040838503121561233b57600080fd5b612344836122cd565b9150602083013561235481612313565b809150509250929050565b60008060006060848603121561237457600080fd5b61237d846122cd565b925061238b602085016122cd565b9150604084013590509250925092565b6000602082840312156123ad57600080fd5b610772826122cd565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156123df57600080fd5b6123e8836122cd565b9150602083013567ffffffffffffffff8082111561240557600080fd5b818501915085601f83011261241957600080fd5b81358181111561242b5761242b6123b6565b604051601f8201601f19908116603f01168101908382118183101715612453576124536123b6565b8160405282815288602084870101111561246c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f8401126124a057600080fd5b50813567ffffffffffffffff8111156124b857600080fd5b6020830191508360208285010111156124d057600080fd5b9250929050565b6000806000806000606086880312156124ef57600080fd5b85356124fa81612313565b9450602086013567ffffffffffffffff8082111561251757600080fd5b818801915088601f83011261252b57600080fd5b81358181111561253a57600080fd5b8960208260051b850101111561254f57600080fd5b60208301965080955050604088013591508082111561256d57600080fd5b5061257a8882890161248e565b969995985093965092949392505050565b6000806000606084860312156125a057600080fd5b6125a9846122cd565b92506125b7602085016122cd565b915060408401356125c781612313565b809150509250925092565b600080604083850312156125e557600080fd5b6125ee836122cd565b91506125fc602084016122cd565b90509250929050565b600181811c9082168061261957607f821691505b6020821081141561263a57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60006001600160601b038083168185168083038211156126ad576126ad612675565b01949350505050565b600082198211156126c9576126c9612675565b500190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526013908201527228292829afab189d103130b21031b0b63632b960691b604082015260600190565b60006001600160601b03838116908316818110156127b3576127b3612675565b039392505050565b81835260006001600160fb1b038311156127d457600080fd5b8260051b8083602087013760009401602001938452509192915050565b6001600160a01b03861681526001600160601b038516602082015263ffffffff8416604082015260806060820181905260009061283190830184866127bb565b979650505050505050565b60006020828403121561284e57600080fd5b815161077281612313565b60008282101561286b5761286b612675565b500390565b6001600160601b03861681526060602082015260006128936060830186886127bb565b8281036040840152838152838560208301376000602085830101526020601f19601f8601168201019150509695505050505050565b6000602082840312156128da57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600063ffffffff8083168185168183048111821515161561294f5761294f612675565b02949350505050565b600081600019048311821515161561297257612972612675565b500290565b60008261299457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052600160045260246000fd5b600082516129c181846020870161226e565b9190910192915050565b600181815b80851115612a065781600019048211156129ec576129ec612675565b808516156129f957918102915b93841c93908002906129d0565b509250929050565b600082612a1d575060016105ce565b81612a2a575060006105ce565b8160018114612a405760028114612a4a57612a66565b60019150506105ce565b60ff841115612a5b57612a5b612675565b50506001821b6105ce565b5060208310610133831016604e8410600b8410161715612a89575081810a6105ce565b612a9383836129cb565b8060001904821115612aa757612aa7612675565b029392505050565b60006107728383612a0e56fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201b07fd30220f17d35dca01646f9d41fb05f8e0a8f75b8c6e1ce152f85e324e9564736f6c634300080c0033

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

000000000000000000000000950e1561b7a7deb1a32a6419fd435410daf851b00000000000000000000000000ff652f7e5389ef66cb0c1add614f5a50d1e2e340000000000000000000000002d6b4a5fba283a7d95948a3730d4913ed2a63b4f000000000000000000000000a5e0829caced8ffdd4de3c43696c57f7d7a678ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000086c80a8aa58e0a4fa09a69624c31ab2a6cad56b8

-----Decoded View---------------
Arg [0] : dubi (address): 0x950e1561B7A7dEB1A32A6419FD435410daf851B0
Arg [1] : hodl (address): 0x0ff652F7E5389EF66cB0c1Add614F5a50d1e2E34
Arg [2] : externalAddress1 (address): 0x2D6b4A5fbA283a7D95948a3730D4913ed2a63b4f
Arg [3] : externalAddress2 (address): 0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff
Arg [4] : externalAddress3 (address): 0x0000000000000000000000000000000000000000
Arg [5] : externalAddress4 (address): 0x0000000000000000000000000000000000000000
Arg [6] : trustedForwarder (address): 0x86C80a8aa58e0A4fa09A69624c31Ab2a6CAD56b8

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000950e1561b7a7deb1a32a6419fd435410daf851b0
Arg [1] : 0000000000000000000000000ff652f7e5389ef66cb0c1add614f5a50d1e2e34
Arg [2] : 0000000000000000000000002d6b4a5fba283a7d95948a3730d4913ed2a63b4f
Arg [3] : 000000000000000000000000a5e0829caced8ffdd4de3c43696c57f7d7a678ff
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 00000000000000000000000086c80a8aa58e0a4fa09a69624c31ab2a6cad56b8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.