ETH Price: $3,387.83 (+3.97%)

Contract

0xA2642dF0139faeBB1D45526a46d5c54B805Be02c
 
Transaction Hash
Method
Block
From
To
Mint And Stake143595462022-03-10 14:09:201019 days ago1646921360IN
0xA2642dF0...B805Be02c
0 ETH0.0005335221.92606791
Mint And Stake142865272022-02-27 6:11:131030 days ago1645942273IN
0xA2642dF0...B805Be02c
0 ETH0.0005484222.52707901
Mint And Stake142865272022-02-27 6:11:131030 days ago1645942273IN
0xA2642dF0...B805Be02c
0 ETH0.0005384422.11707901
Mint And Stake142865272022-02-27 6:11:131030 days ago1645942273IN
0xA2642dF0...B805Be02c
0 ETH0.000542722.29207901
Mint And Stake142865262022-02-27 6:11:051030 days ago1645942265IN
0xA2642dF0...B805Be02c
0 ETH0.000486920
Transfer141473532022-02-05 17:30:321052 days ago1644082232IN
0xA2642dF0...B805Be02c
0.10024828 ETH0.0016015176.26250486
Transfer141473352022-02-05 17:27:011052 days ago1644082021IN
0xA2642dF0...B805Be02c
0.08350368 ETH0.0016161776.96057624
Transfer141473272022-02-05 17:25:381052 days ago1644081938IN
0xA2642dF0...B805Be02c
0.10021881 ETH0.0016619279.13914974
Mint And Stake138691162021-12-24 16:58:161095 days ago1640365096IN
0xA2642dF0...B805Be02c
0 ETH0.0020479484.12187411
Mint And Stake138627722021-12-23 17:30:311096 days ago1640280631IN
0xA2642dF0...B805Be02c
0 ETH0.0023743297.52836352
Mint And Stake138627722021-12-23 17:30:311096 days ago1640280631IN
0xA2642dF0...B805Be02c
0 ETH0.0023743297.52836352
Mint And Stake138627722021-12-23 17:30:311096 days ago1640280631IN
0xA2642dF0...B805Be02c
0 ETH0.0023721397.43836352
Mint And Stake138627722021-12-23 17:30:311096 days ago1640280631IN
0xA2642dF0...B805Be02c
0 ETH0.0023700797.35376352
Mint And Stake138380312021-12-19 21:38:531100 days ago1639949933IN
0xA2642dF0...B805Be02c
0 ETH0.0014356458.97084492
Add Guest User138373072021-12-19 18:49:251100 days ago1639939765IN
0xA2642dF0...B805Be02c
0 ETH0.0034519760.64285445
Mint And Stake138366982021-12-19 16:29:401100 days ago1639931380IN
0xA2642dF0...B805Be02c
0 ETH0.0018332475.26547751
Mint And Stake138359462021-12-19 13:44:131100 days ago1639921453IN
0xA2642dF0...B805Be02c
0 ETH0.0010717644.00236723
Mint And Stake138349232021-12-19 10:06:061100 days ago1639908366IN
0xA2642dF0...B805Be02c
0 ETH0.0007303530
Mint And Stake138329802021-12-19 2:49:131100 days ago1639882153IN
0xA2642dF0...B805Be02c
0 ETH0.001041842.77235889
Mint And Stake138329472021-12-19 2:41:371100 days ago1639881697IN
0xA2642dF0...B805Be02c
0 ETH0.0008598635.30243159
Mint And Stake138329332021-12-19 2:40:061100 days ago1639881606IN
0xA2642dF0...B805Be02c
0 ETH0.0011183245.91410892
Mint And Stake138329282021-12-19 2:38:241100 days ago1639881504IN
0xA2642dF0...B805Be02c
0 ETH0.0011016545.22958054
Mint And Stake138325102021-12-19 0:58:211101 days ago1639875501IN
0xA2642dF0...B805Be02c
0 ETH0.0014902361.18287076
Mint And Stake138325052021-12-19 0:57:131101 days ago1639875433IN
0xA2642dF0...B805Be02c
0 ETH0.0014763560.61318255
Mint And Stake138312812021-12-18 20:27:131101 days ago1639859233IN
0xA2642dF0...B805Be02c
0 ETH0.0012651451.96726093
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
135724582021-11-07 23:54:161142 days ago1636329256
0xA2642dF0...B805Be02c
1.7256072 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OpeningCeremony

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 27 : OpeningCeremony.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

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

import "./TempleERC20Token.sol";
import "./SandalwoodToken.sol";
import "./TempleTreasury.sol";
import "./TreasuryManagementProxy.sol";
import "./TempleStaking.sol";
import "./PresaleAllocation.sol";
import "./LockedOGTemple.sol";

/**
 * Mint and Stake for those who have quested in the Opening Ceremony
 */
contract OpeningCeremony is Ownable, Pausable, AccessControl {
    bytes32 public constant CAN_ADD_VERIFIED_USER = keccak256("CAN_ADD_VERIFIED_USER");
    uint256 constant SECONDS_IN_DAY = 24 * 60 * 60;

    IERC20 public stablecToken; // contract address for stable coin used in treasury
    TempleERC20Token public templeToken; // temple ERC20 contract
    TempleTreasury public treasury; // temple treasury
    TreasuryManagementProxy public treasuryManagement; // temple treasury
    TempleStaking public staking; // Staking contract
    LockedOGTemple public lockedOGTemple; // contract where OG Temple is locked

    uint256 public unlockDelaySeconds = SECONDS_IN_DAY * 7 * 6; // How long after after buying can templars unlock
    uint256 public mintMultiple = 6; // presale mint multiple
    uint256 public harvestThresholdStablec; // At what mint level do stakers trigger a harvest
    uint256 public inviteThresholdStablec; // How much does a verified user have to spend before they can invite others
    uint256 public maxInvitesPerVerifiedUser; // How many guests can each verified user invite

    // how much to multiple a verified users day 1 mint limit to work out
    // their total at a given point in time. So for a user who quests 
    // on day 1 => 3 day limit will be DAY_ONE_LIMIT * 4 / 1
    // on day 2 => 3 day limit will be DAY_ONE_LIMIT * 4 / 2
    uint256 public globalDoublingIndex = 1; 
    uint256 public lastUpdatedTimestamp; // when was the limitFactor last updated

    struct Limit {
      uint256 guestMax;
      uint256 verifiedMax;
      uint256 verifiedDayOne;
    }

    Limit public limitStablec = Limit({guestMax: 10000 * 1e18,  verifiedMax: 480000 * 1e18, verifiedDayOne: 30000 * 1e18});
    Limit public limitTemple = Limit({guestMax: 10000 * 1e18,  verifiedMax: 480000 * 1e18, verifiedDayOne: 30000 * 1e18});

    struct Factor {
      uint256 numerator;
      uint256 denominator;
    }
    Factor public verifiedBonusFactor; // Factor applied to verified user, to boost APY
    Factor public guestBonusFactor;    // Factor applied to temple guests, to boost APY

    struct User {
      bool isVerified;
      bool isGuest;
      uint8 numInvited;

      uint256 doublingIndexAtVerification;
      uint256 totalSacrificedStablec;
      uint256 totalSacrificedTemple;
    }

    mapping(address => User) public users;

    event MintComplete(address minter, uint256 acceptedStablec, uint256 mintedTemple, uint256 bonusTemple, uint256 mintedOGTemple);
    event StakeComplete(address staker, uint256 acceptedTemple, uint256 bonusTemple, uint256 mintedOGTemple);
    event VerifiedUserAdded(address user);

    constructor(
      IERC20 _stablecToken,
      TempleERC20Token _templeToken,
      TempleStaking _staking,
      LockedOGTemple _lockedOGTemple,
      TempleTreasury _treasury,
      TreasuryManagementProxy _treasuryManagement,
      uint256 _harvestThresholdStablec,
      uint256 _inviteThresholdStablec,
      uint256 _maxInvitesPerVerifiedUser,
      Factor memory _verifiedBonusFactor,
      Factor memory _guestBonusFactor
    ) {

      stablecToken = _stablecToken;
      templeToken = _templeToken;
      staking = _staking;
      lockedOGTemple = _lockedOGTemple;
      treasury = _treasury;
      treasuryManagement = _treasuryManagement;

      harvestThresholdStablec = _harvestThresholdStablec;
      inviteThresholdStablec = _inviteThresholdStablec;
      maxInvitesPerVerifiedUser = _maxInvitesPerVerifiedUser;
      verifiedBonusFactor = _verifiedBonusFactor;
      guestBonusFactor = _guestBonusFactor;

      lastUpdatedTimestamp = block.timestamp;

      _setupRole(DEFAULT_ADMIN_ROLE, owner());
    }

    function setUnlockDelay(uint256 _unlockDelaySeconds) external onlyOwner {
      unlockDelaySeconds = _unlockDelaySeconds;
    }

    function setMintMultiple(uint256 _mintMultiple) external onlyOwner {
      mintMultiple = _mintMultiple;
    }

    function setHarvestThreshold(uint256 _harvestThresholdStablec) external onlyOwner {
      harvestThresholdStablec = _harvestThresholdStablec;
    }

    function setInviteThreshold(uint256 _inviteThresholdStablec) external onlyOwner {
      inviteThresholdStablec = _inviteThresholdStablec;
    }

    function setMaxInvitesPerVerifiedUser(uint256 _maxInvitesPerVerifiedUser) external onlyOwner {
      maxInvitesPerVerifiedUser = _maxInvitesPerVerifiedUser;
    }

    function setVerifiedBonusFactor(uint256 _numerator, uint256 _denominator) external onlyOwner {
      verifiedBonusFactor.numerator = _numerator;
      verifiedBonusFactor.denominator = _denominator;
    }

    function setGuestBonusFactor(uint256 _numerator, uint256 _denominator) external onlyOwner {
      guestBonusFactor.numerator = _numerator;
      guestBonusFactor.denominator = _denominator;
    }


    function setLimitStablec(uint256 guestMax, uint256 verifiedMax, uint256 verifiedDayOne) external onlyOwner {
      limitStablec.guestMax = guestMax;
      limitStablec.verifiedMax = verifiedMax;
      limitStablec.verifiedDayOne = verifiedDayOne;
    }

    function setLimitTemple(uint256 guestMax, uint256 verifiedMax) external onlyOwner {
      limitTemple.guestMax = guestMax;
      limitTemple.verifiedMax = verifiedMax;
      // unused limitTemple.verifiedDayOne
    }

    function addVerifier(address account) external onlyOwner {
      grantRole(CAN_ADD_VERIFIED_USER, account);
    }

    function removeVerifier(address account) external onlyOwner {
      revokeRole(CAN_ADD_VERIFIED_USER, account);
    }

    function addVerifiedUser(address userAddress) external {
      require(hasRole(CAN_ADD_VERIFIED_USER, msg.sender), "Caller cannot add verified user");
      require(!users[userAddress].isVerified, "Address already verified");
      users[userAddress].isVerified = true;
      users[userAddress].doublingIndexAtVerification = globalDoublingIndex;

      emit VerifiedUserAdded(userAddress);
    }

    function addGuestUser(address userAddress) external {
      require(users[msg.sender].isVerified, "only verified users can invite guests");
      require(users[msg.sender].totalSacrificedStablec >= inviteThresholdStablec, 
        "Need to sacrifice more frax before you can invite others");
      require(users[msg.sender].numInvited < maxInvitesPerVerifiedUser,
        "Exceed maximum number of invites");

      users[userAddress].isGuest = true;
      users[msg.sender].numInvited += 1;
    }

    /** mint temple and immediately stake, on behalf of a staker, with a bonus + lockin period */
    function mintAndStakeFor(address _staker, uint256 _amountPaidStablec) public whenNotPaused {
      User storage userInfo = users[_staker];

      // update max limit. This happens before checks, to ensure maxSacrificable
      // is correctly calculated.
      if ((block.timestamp - lastUpdatedTimestamp) > SECONDS_IN_DAY) {
        globalDoublingIndex *= 2;
        lastUpdatedTimestamp += SECONDS_IN_DAY;
      }

      Factor storage bonusFactor;
      if (userInfo.isVerified) {
        require(
          userInfo.totalSacrificedStablec + _amountPaidStablec <= maxSacrificableStablec(userInfo.doublingIndexAtVerification),
          "Exceeded max mint limit");
        bonusFactor = verifiedBonusFactor;
      } else if (userInfo.isGuest) {
        require(userInfo.totalSacrificedStablec + _amountPaidStablec <= limitStablec.guestMax, "Exceeded max mint limit");
        bonusFactor = guestBonusFactor;
      } else {
        revert("Only verified templars and their guests can partake in the opening ceremony");
      }

      (uint256 _stablec, uint256 _temple) = treasury.intrinsicValueRatio();
      uint256 _boughtTemple = _amountPaidStablec * _temple / _stablec / mintMultiple;
      
      // Calculate extra temple required to account for bonus APY
      uint256 _bonusTemple = _boughtTemple * bonusFactor.numerator / bonusFactor.denominator;
      uint256 _totalTemple = _boughtTemple + _bonusTemple;

      userInfo.totalSacrificedStablec += _amountPaidStablec;

      // pull stablec from staker and immediately transfer back to treasury
      SafeERC20.safeTransferFrom(stablecToken, msg.sender, address(treasury), _amountPaidStablec);

      // mint temple
      templeToken.mint(address(this), _totalTemple);

      // Stake both minted and bonus temple. Locking up any OGTemple
      SafeERC20.safeIncreaseAllowance(templeToken, address(staking), _totalTemple);
      uint256 _amountOgTemple = staking.stake(_totalTemple);
      SafeERC20.safeIncreaseAllowance(staking.OG_TEMPLE(), address(lockedOGTemple), _amountOgTemple);
      lockedOGTemple.lockFor(_staker, _amountOgTemple, block.timestamp + unlockDelaySeconds);

      // Finally, run harvest if amount sacrificed is 10k or greater
      if (_amountPaidStablec >= harvestThresholdStablec) {
        treasuryManagement.harvest();
      }

      emit MintComplete(_staker, _amountPaidStablec, _boughtTemple, _bonusTemple, _amountOgTemple);
    }

    /** mint temple and immediately stake, with a bonus + lockin period */
    function mintAndStake(uint256 _amountPaidStablec) external whenNotPaused {
      mintAndStakeFor(msg.sender, _amountPaidStablec);
    }

    /** Stake temple, consuming sandalwood to get bonus APY **/
    function stakeFor(address _staker, uint256 _amountTemple) public whenNotPaused {
      User storage userInfo = users[_staker];

      Factor storage bonusFactor;
      if (userInfo.isVerified) {
        require(userInfo.totalSacrificedTemple + _amountTemple <= limitTemple.verifiedMax, "exceeded max limit");
        bonusFactor = verifiedBonusFactor;
      } else if (userInfo.isGuest) {
        require(userInfo.totalSacrificedTemple + _amountTemple <= limitTemple.guestMax, "exceeded max limit");
        bonusFactor = guestBonusFactor;
      } else {
        revert("Only verified templars and their guests can partake in the opening ceremony");
      }

      // Calculate extra temple required to account for bonus APY
      uint256 _bonusTemple = _amountTemple * bonusFactor.numerator / bonusFactor.denominator;
      uint256 _totalTemple = _amountTemple + _bonusTemple;

      userInfo.totalSacrificedTemple += _amountTemple;

      // pull temple from caller (to be staked)
      SafeERC20.safeTransferFrom(templeToken, msg.sender, address(this), _amountTemple);

      // mint bonus APY temple
      templeToken.mint(address(this), _bonusTemple);

      // Stake both minted and bonus temple. Locking up any OGTemple
      SafeERC20.safeIncreaseAllowance(templeToken, address(staking), _totalTemple);
      uint256 _amountOgTemple = staking.stake(_totalTemple);
      SafeERC20.safeIncreaseAllowance(staking.OG_TEMPLE(), address(lockedOGTemple), _amountOgTemple);
      lockedOGTemple.lockFor(_staker, _amountOgTemple, block.timestamp + unlockDelaySeconds);

      emit StakeComplete(_staker, _amountTemple, _bonusTemple, _amountOgTemple);
    }

    /** Stake temple, consuming sandalwood to get bonus APY **/
    function stake(uint256 _amountTemple) external whenNotPaused {
      stakeFor(msg.sender, _amountTemple);
    }

    /**
     * Pause contract. Either emergency or at the end of presale
     */
    function pause() external onlyOwner {
        _pause();
    }

    /**
     * Revert pause
     */
    function unpause() external onlyOwner {
        _unpause();
    }

    function maxSacrificableStablec(uint256 doublingIndexAtVerification) public view returns(uint256 maxLimit) {
      maxLimit = limitStablec.verifiedDayOne * globalDoublingIndex / doublingIndexAtVerification;
      if (maxLimit > limitStablec.verifiedMax) {
        maxLimit = limitStablec.verifiedMax;
      }
    }
}

File 2 of 27 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 3 of 27 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

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

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

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

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 27 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

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

File 5 of 27 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

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

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

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

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

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

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

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

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

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

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 6 of 27 : TempleERC20Token.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

contract TempleERC20Token is ERC20, ERC20Burnable, Ownable, AccessControl {
    bytes32 public constant CAN_MINT = keccak256("CAN_MINT");

    constructor() ERC20("Temple", "TEMPLE") {
        _setupRole(DEFAULT_ADMIN_ROLE, owner());
    }

    function mint(address to, uint256 amount) external {
      require(hasRole(CAN_MINT, msg.sender), "Caller cannot mint");
      _mint(to, amount);
    }

    function addMinter(address account) external onlyOwner {
        grantRole(CAN_MINT, account);
    }

    function removeMinter(address account) external onlyOwner {
        revokeRole(CAN_MINT, account);
    }
}

File 7 of 27 : SandalwoodToken.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

/**
 * Sandalwood rewarded as part of the Opening Ceremony quests
 */
contract SandalwoodToken is ERC20, ERC20Burnable {
    constructor() ERC20("Sandalwood", "Sandalwood") {
      _mint(_msgSender(), 1e12 * 1e18);
    }
}

File 8 of 27 : TempleTreasury.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./TempleERC20Token.sol";
import "./ITreasuryAllocation.sol";
import "./MintAllowance.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

// import "hardhat/console.sol";

contract TempleTreasury is Ownable {
    // Underlying TEMPLE token
    TempleERC20Token private TEMPLE;

    // underlying stable token we are holding and valuing treasury with
    IERC20 private STABLEC;

    // Minted temple allocated to various investment contracts
    MintAllowance public MINT_ALLOWANCE;

    // Ratio of treasury value in stablec to open supply of temple.
    struct IntrinsicValueRatio {
      uint256 stablec;
      uint256 temple;
    } 
    IntrinsicValueRatio public intrinsicValueRatio;

    // Temple rewards harvested, and (yet) to be allocated to a pool
    uint256 public harvestedRewardsTemple;

    // Has treasury been seeded with STABLEC yet (essentially, has seedMint been called)
    // this will bootstrap IV
    bool public seeded = false;

    // all active pools. A pool is anything
    // that gets allocated some portion of harvest
    address[] public pools;
    mapping(address => uint96) public poolHarvestShare;
    uint96 public totalHarvestShares;

    // Current treasury STABLEC allocations
    mapping(ITreasuryAllocation => uint256) public treasuryAllocationsStablec;
    uint256 public totalAllocationStablec;

    event RewardsHarvested(uint256 _amount);
    event HarvestDistributed(address _contract, uint256 _amount);

    constructor(TempleERC20Token _TEMPLE, IERC20 _STABLEC) {
      TEMPLE = _TEMPLE;
      STABLEC = _STABLEC;
      MINT_ALLOWANCE = new MintAllowance(_TEMPLE);
    }

    function numPools() external view returns (uint256) {
      return pools.length;
    }

    /**
     * Seed treasury with STABLEC and Temple to bootstrap
     */
    function seedMint(uint256 amountStablec, uint256 amountTemple) external onlyOwner {
      require(!seeded, "Owner has already seeded treasury");
      seeded = true;

      // can this go in the constructor?
      intrinsicValueRatio.stablec = amountStablec;
      intrinsicValueRatio.temple = amountTemple;

      SafeERC20.safeTransferFrom(STABLEC, msg.sender, address(this), amountStablec);
      TEMPLE.mint(msg.sender, amountTemple);
    }

    /**
     * Harvest rewards.
     *
     * For auditing, we harvest and allocate in two steps
     */
    function harvest(uint256 distributionPercent) external onlyOwner {
      require(distributionPercent <= 100, "Scaling factor interpreted as a %, needs to be between 0 (no harvest) and 100 (max harvest)");

      uint256 reserveStablec = STABLEC.balanceOf(address(this)) + totalAllocationStablec;

      // // Burn any excess temple, that is Any temple over and beyond harvestedRewardsTemple.
      // // NOTE: If we don't do this, IV could drop...
      if (TEMPLE.balanceOf(address(this)) > harvestedRewardsTemple) {
        // NOTE: there isn't a Reentrancy issue as we control the TEMPLE ERC20 contract, and configure
        //       treasury with an address on contract creation
        TEMPLE.burn(TEMPLE.balanceOf(address(this)) - harvestedRewardsTemple);
      }

      uint256 totalSupplyTemple = TEMPLE.totalSupply() - TEMPLE.balanceOf(address(MINT_ALLOWANCE));
      uint256 impliedSupplyAtCurrentIVTemple = reserveStablec * intrinsicValueRatio.temple / intrinsicValueRatio.stablec;

      require(impliedSupplyAtCurrentIVTemple >= totalSupplyTemple, "Cannot run harvest when IV drops");

      uint256 newHarvestTemple = (impliedSupplyAtCurrentIVTemple - totalSupplyTemple) * distributionPercent / 100;
      harvestedRewardsTemple += newHarvestTemple;

      intrinsicValueRatio.stablec = reserveStablec;
      intrinsicValueRatio.temple = totalSupplyTemple + newHarvestTemple;

      TEMPLE.mint(address(this), newHarvestTemple);
      emit RewardsHarvested(newHarvestTemple);
    }

    /**
     * ResetIV
     *
     * Not expected to be used in day to day operations, as opposed to harvest which
     * will be called ~ once per epoch.
     *
     * Only to be called if we have to post a treasury loss, and restart IV growth from
     * a new baseline.
     */
    function resetIV() external onlyOwner {
      uint256 reserveStablec = STABLEC.balanceOf(address(this)) + totalAllocationStablec;
      uint256 totalSupplyTemple = TEMPLE.totalSupply() - TEMPLE.balanceOf(address(MINT_ALLOWANCE));
      intrinsicValueRatio.stablec = reserveStablec;
      intrinsicValueRatio.temple = totalSupplyTemple;
    }

    /**
     * Allocate rewards to each pool.
     */
    function distributeHarvest() external onlyOwner {
      // transfer rewards as per defined allocation
      uint256 totalAllocated = 0;
      for (uint256 i = 0; i < pools.length; i++) {
        uint256 allocatedRewards = harvestedRewardsTemple * poolHarvestShare[pools[i]] / totalHarvestShares;

        // integer rounding may cause the last allocation to exceed harvested
        // rewards. Handle gracefully
        if ((totalAllocated + allocatedRewards) > harvestedRewardsTemple) {
          allocatedRewards = harvestedRewardsTemple - totalAllocated;
        }
        totalAllocated += allocatedRewards;
        SafeERC20.safeTransfer(TEMPLE, pools[i], allocatedRewards);
        emit HarvestDistributed(pools[i], allocatedRewards);
      }
      harvestedRewardsTemple -= totalAllocated;
    }

    /**
     * Mint and Allocate treasury TEMPLE.
     */
    function mintAndAllocateTemple(address _contract, uint256 amountTemple) external onlyOwner {
      require(amountTemple > 0, "TEMPLE to mint and allocate must be > 0");

      // Mint and Allocate TEMPLE via MINT_ALLOWANCE helper
      TEMPLE.mint(address(this), amountTemple);
      SafeERC20.safeIncreaseAllowance(TEMPLE, address(MINT_ALLOWANCE), amountTemple);
      MINT_ALLOWANCE.increaseMintAllowance(_contract, amountTemple);
    }

    /**
     * Burn minted temple associated with a specific contract
     */
    function unallocateAndBurnUnusedMintedTemple(address _contract) external onlyOwner {
      MINT_ALLOWANCE.burnUnusedMintAllowance(_contract);
    }

    /**
     * Allocate treasury STABLEC.
     */
    function allocateTreasuryStablec(ITreasuryAllocation _contract, uint256 amountStablec) external onlyOwner {
      require(amountStablec > 0, "STABLEC to allocate must be > 0");

      treasuryAllocationsStablec[_contract] += amountStablec;
      totalAllocationStablec += amountStablec;
      SafeERC20.safeTransfer(STABLEC, address(_contract), amountStablec);
    }

    /**
     * Update treasury with latest mark to market for a given treasury allocation
     */
    function updateMarkToMarket(ITreasuryAllocation _contract) external onlyOwner {
      uint256 oldReval = treasuryAllocationsStablec[_contract];
      uint256 newReval = _contract.reval();
      totalAllocationStablec = totalAllocationStablec + newReval - oldReval;
      treasuryAllocationsStablec[_contract] = newReval;
    }

    /**
     * Withdraw from a contract. 
     *
     * Expects that pre-withdrawal reval() includes the unwithdrawn allowance, and post withdrawal reval()
     * drops by exactly this amount.
     */
    function withdraw(ITreasuryAllocation _contract) external onlyOwner {
      uint256 preWithdrawlReval = _contract.reval();
      uint256 pendingWithdrawal = STABLEC.allowance(address(_contract), address(this));

      // NOTE: Reentrancy considered and it's safe STABLEC is a well known unchanging contract
      SafeERC20.safeTransferFrom(STABLEC, address(_contract), address(this), pendingWithdrawal);
      uint256 postWithdrawlReval = _contract.reval();

      totalAllocationStablec = totalAllocationStablec - pendingWithdrawal;
      treasuryAllocationsStablec[_contract] -= pendingWithdrawal;

      require(postWithdrawlReval + pendingWithdrawal == preWithdrawlReval);
    }

    /**
     * Withdraw from a contract which has some treasury allocation 
     *
     * Ejects a contract out of treasury, pulling in any allowance of STABLEC
     * We only expect to use this if (for whatever reason). The booking in
     * The given TreasuryAllocation results in withdraw not working.
     * 
     * Precondition, contract given has allocated all of it's Stablec assets
     * to be transfered into treasury as an allowance.
     *
     * This will only ever reduce treasury IV.
     */
    function ejectTreasuryAllocation(ITreasuryAllocation _contract) external onlyOwner {
      uint256 pendingWithdrawal = STABLEC.allowance(address(_contract), address(this));
      totalAllocationStablec -= treasuryAllocationsStablec[_contract];
      treasuryAllocationsStablec[_contract] = 0;
      SafeERC20.safeTransferFrom(STABLEC, address(_contract), address(this), pendingWithdrawal);
    }

    /**
     * Add or update a pool, and transfer in treasury assets
     */
    function upsertPool(address _contract, uint96 _poolHarvestShare) external onlyOwner {
      require(_poolHarvestShare > 0, "Harvest share must be > 0");

      totalHarvestShares = totalHarvestShares + _poolHarvestShare - poolHarvestShare[_contract];

      // first time, add contract to array as well
      if (poolHarvestShare[_contract] == 0) { 
        pools.push(_contract);
      }

      poolHarvestShare[_contract] = _poolHarvestShare;
    }

    /**
     * Remove a given investment pool.
     */
    function removePool(uint256 idx, address _contract) external onlyOwner {
      require(idx < pools.length, "No pool at the specified index");
      require(pools[idx] == _contract, "Pool at index and passed in address don't match");

      pools[idx] = pools[pools.length-1];
      pools.pop();
      totalHarvestShares -= poolHarvestShare[_contract];
      delete poolHarvestShare[_contract];
    }
}

File 9 of 27 : TreasuryManagementProxy.sol
pragma solidity ^0.8.4; // SPDX-License-Identifier: GPL-3.0-or-later

import "./TempleTreasury.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";


/**
 * Proxy all treasury management methods
 *
 * Intention is to be deployed as the new treasury owner, a workaround required
 * to make harvest publically callable.
 */
contract TreasuryManagementProxy {
    TempleTreasury public treasury;

    bool public harvestEnabled = true;
    address owner;

    uint256 public harvestDistributionPercentage = 80;

    constructor(address _owner, address _treasury) {
        owner = _owner;
        treasury = TempleTreasury(_treasury);
    }

    modifier onlyOwner() {
       require(owner == msg.sender, "caller is not the owner");
       _;
    }

    function harvest() external {
        if (harvestEnabled) {
           treasury.harvest(harvestDistributionPercentage);
        }
    }

    function setHarvestDistributionPercentage(uint256 _harvestDistributionPercentage) external onlyOwner {
        harvestDistributionPercentage = _harvestDistributionPercentage;
    }

    function toggleHarvest() external onlyOwner {
        harvestEnabled = !harvestEnabled;
    }

    function resetIV() external onlyOwner {
        treasury.resetIV();
    }

    function distributeHarvest() external onlyOwner {
        treasury.distributeHarvest();
    }

    function mintAndAllocateTemple(address _contract, uint256 amountTemple) external onlyOwner {
        treasury.mintAndAllocateTemple(_contract, amountTemple);

    }

    function unallocateAndBurnUnusedMintedTemple(address _contract) external onlyOwner {
        treasury.unallocateAndBurnUnusedMintedTemple(_contract);
    }

    function allocateTreasuryStablec(ITreasuryAllocation _contract, uint256 amountStablec) external onlyOwner {
        treasury.allocateTreasuryStablec(_contract, amountStablec);
    }

    function updateMarkToMarket(ITreasuryAllocation _contract) external onlyOwner {
        treasury.updateMarkToMarket(_contract);
    }

    function withdraw(ITreasuryAllocation _contract) external onlyOwner {
        treasury.withdraw(_contract);
    }

    function ejectTreasuryAllocation(ITreasuryAllocation _contract) external onlyOwner {
        treasury.ejectTreasuryAllocation(_contract);
    }

    function upsertPool(address _contract, uint96 _poolHarvestShare) external onlyOwner {
        treasury.upsertPool(_contract, _poolHarvestShare);
    }

    function removePool(uint256 idx, address _contract) external onlyOwner {
        treasury.removePool(idx, _contract);
    }

    // If we want to transfer ownership way from proxy
    function transferOwnership(address newOwner) external onlyOwner {
        treasury.transferOwnership(newOwner);
    }
}

File 10 of 27 : TempleStaking.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

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

import "./ABDKMath64x64.sol";
import "./TempleERC20Token.sol";
import "./OGTemple.sol";
import "./ExitQueue.sol";

// import "hardhat/console.sol";

/**
 * Mechancics of how a user can stake temple.
 */
contract TempleStaking is Ownable {
    using ABDKMath64x64 for int128;
    
    TempleERC20Token immutable public TEMPLE; // The token being staked, for which TEMPLE rewards are generated
    OGTemple immutable public OG_TEMPLE; // Token used to redeem staked TEMPLE
    ExitQueue public EXIT_QUEUE;    // unstake exit queue

    // epoch percentage yield, as an ABDKMath64x64
    int128 public epy; 

    // epoch size, in seconds
    uint256 public epochSizeSeconds; 

    // The starting timestamp. from where staking starts
    uint256 public startTimestamp;

    // epy compounded over every epoch since the contract creation up 
    // until lastUpdatedEpoch. Represented as an ABDKMath64x64
    int128 public accumulationFactor;

    // the epoch up to which we have calculated accumulationFactor.
    uint256 public lastUpdatedEpoch; 

    event StakeCompleted(address _staker, uint256 _amount, uint256 _lockedUntil);
    event AccumulationFactorUpdated(uint256 _epochsProcessed, uint256 _currentEpoch, uint256 _accumulationFactor);
    event UnstakeCompleted(address _staker, uint256 _amount);    

    constructor(
        TempleERC20Token _TEMPLE,
        ExitQueue _EXIT_QUEUE,
        uint256 _epochSizeSeconds,
        uint256 _startTimestamp) {

        require(_startTimestamp < block.timestamp, "Start timestamp must be in the past");
        require(_startTimestamp > (block.timestamp - (24 * 2 * 60 * 60)), "Start timestamp can't be more than 2 days in the past");

        TEMPLE = _TEMPLE;
        EXIT_QUEUE = _EXIT_QUEUE;

        // Each version of the staking contract needs it's own instance of OGTemple users can use to
        // claim back rewards
        OG_TEMPLE = new OGTemple(); 
        epochSizeSeconds = _epochSizeSeconds;
        startTimestamp = _startTimestamp;
        epy = ABDKMath64x64.fromUInt(1);
        accumulationFactor = ABDKMath64x64.fromUInt(1);
    }

    /** Sets epoch percentage yield */
    function setExitQueue(ExitQueue _EXIT_QUEUE) external onlyOwner {
        EXIT_QUEUE = _EXIT_QUEUE;
    }

    /** Sets epoch percentage yield */
    function setEpy(uint256 _numerator, uint256 _denominator) external onlyOwner {
        _updateAccumulationFactor();
        epy = ABDKMath64x64.fromUInt(1).add(ABDKMath64x64.divu(_numerator, _denominator));
    }

    /** Get EPY as uint, scaled up the given factor (for reporting) */
    function getEpy(uint256 _scale) external view returns (uint256) {
        return epy.sub(ABDKMath64x64.fromUInt(1)).mul(ABDKMath64x64.fromUInt(_scale)).toUInt();
    }

    function currentEpoch() public view returns (uint256) {
        return (block.timestamp - startTimestamp) / epochSizeSeconds;
    }

    /** Return current accumulation factor, scaled up to account for fractional component */
    function getAccumulationFactor(uint256 _scale) external view returns(uint256) {
        return _accumulationFactorAt(currentEpoch()).mul(ABDKMath64x64.fromUInt(_scale)).toUInt();
    }

    /** Calculate the updated accumulation factor, based on the current epoch */
    function _accumulationFactorAt(uint256 epoch) private view returns(int128) {
        uint256 _nUnupdatedEpochs = epoch - lastUpdatedEpoch;
        return accumulationFactor.mul(epy.pow(_nUnupdatedEpochs));
    }

    /** Balance in TEMPLE for a given amount of OG_TEMPLE */
    function balance(uint256 amountOgTemple) public view returns(uint256) {
        return _overflowSafeMul1e18(
            ABDKMath64x64.divu(amountOgTemple, 1e18).mul(_accumulationFactorAt(currentEpoch()))
        );
    }

    /** updates rewards in pool */
    function _updateAccumulationFactor() internal {
        uint256 _currentEpoch = currentEpoch();

        // still in previous epoch, no action. 
        // NOTE: should be a pre-condition that _currentEpoch >= lastUpdatedEpoch
        //       It's possible to end up in this state if we shorten epoch size.
        //       As such, it's not baked as a precondition
        if (_currentEpoch <= lastUpdatedEpoch) {
            return;
        }

        accumulationFactor = _accumulationFactorAt(_currentEpoch);
        lastUpdatedEpoch = _currentEpoch;
        uint256 _nUnupdatedEpochs = _currentEpoch - lastUpdatedEpoch;
        emit AccumulationFactorUpdated(_nUnupdatedEpochs, _currentEpoch, accumulationFactor.mul(10000).toUInt());
    }

    /** Stake on behalf of a given address. Used by other contracts (like Presale) */
    function stakeFor(address _staker, uint256 _amountTemple) public returns(uint256 amountOgTemple) {
        require(_amountTemple > 0, "Cannot stake 0 tokens");

        _updateAccumulationFactor();

        // net past value/genesis value/OG Value for the temple you are putting in.
        amountOgTemple = _overflowSafeMul1e18(ABDKMath64x64.divu(_amountTemple, 1e18).div(accumulationFactor));

        SafeERC20.safeTransferFrom(TEMPLE, msg.sender, address(this), _amountTemple);
        OG_TEMPLE.mint(_staker, amountOgTemple);
        emit StakeCompleted(_staker, _amountTemple, 0);

        return amountOgTemple;
    }

    /** Stake temple */
    function stake(uint256 _amountTemple) external returns(uint256 amountOgTemple) {
        return stakeFor(msg.sender, _amountTemple);
    }

    /** Unstake temple */
    function unstake(uint256 _amountOgTemple) external {      
        require(OG_TEMPLE.allowance(msg.sender, address(this)) >= _amountOgTemple, 'Insufficient OGTemple allowance. Cannot unstake');

        _updateAccumulationFactor();
        uint256 unstakeBalanceTemple = balance(_amountOgTemple);

        OG_TEMPLE.burnFrom(msg.sender, _amountOgTemple);
        SafeERC20.safeIncreaseAllowance(TEMPLE, address(EXIT_QUEUE), unstakeBalanceTemple);
        EXIT_QUEUE.join(msg.sender, unstakeBalanceTemple);

        emit UnstakeCompleted(msg.sender, _amountOgTemple);    
    }

    function _overflowSafeMul1e18(int128 amountFixedPoint) internal pure returns (uint256) {
        uint256 integralDigits = amountFixedPoint.toUInt();
        uint256 fractionalDigits = amountFixedPoint.sub(ABDKMath64x64.fromUInt(integralDigits)).mul(ABDKMath64x64.fromUInt(1e18)).toUInt();
        return (integralDigits * 1e18) + fractionalDigits;
    }
}

File 11 of 27 : PresaleAllocation.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

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

import "./TempleERC20Token.sol";
import "./TempleTreasury.sol";
import "./TempleStaking.sol";

/**
 * Who has what allocation in the presale period
 */
contract PresaleAllocation is Ownable {
    struct Allocation {
      uint256 amount;
      uint256 epoch;
    }

    // maximum stablec each address can buy temple
    mapping(address => Allocation) public allocationOf;

    function setAllocation(address staker, uint256 amount, uint256 epoch) external onlyOwner {
      allocationOf[staker].epoch = epoch;
      allocationOf[staker].amount = amount;
    }
}

File 12 of 27 : LockedOGTemple.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./OGTemple.sol";

/**
 * Bookkeeping for OGTemple that's locked
 */
contract LockedOGTemple {
    struct LockedEntry {
        // How many tokens are locked
        uint256 BalanceOGTemple;

        // WHen can the user unlock these tokens
        uint256 LockedUntilTimestamp;
    }

    // All temple locked for any given user
    mapping(address => LockedEntry[]) public locked;

    OGTemple public OG_TEMPLE; // The token being staked, for which TEMPLE rewards are generated

    event OGTempleLocked(address _staker, uint256 _amount, uint256 _lockedUntil);
    event OGTempleWithdraw(address _staker, uint256 _amount);

    constructor(OGTemple _OG_TEMPLE) {
        OG_TEMPLE = _OG_TEMPLE;
    }

    function numLocks(address _staker) external view returns(uint256) {
        return locked[_staker].length;
    }

    /** lock up OG */
    function lockFor(address _staker, uint256 _amountOGTemple, uint256 _lockedUntilTimestamp) public {
        LockedEntry memory lockEntry = LockedEntry({BalanceOGTemple: _amountOGTemple, LockedUntilTimestamp: _lockedUntilTimestamp});
        locked[_staker].push(lockEntry);

        SafeERC20.safeTransferFrom(OG_TEMPLE, msg.sender, address(this), _amountOGTemple);
        emit OGTempleLocked(_staker, _amountOGTemple, _lockedUntilTimestamp);
    }

    function lock(uint256 _amountOGTemple, uint256 _lockedUntilTimestamp) external {
        lockFor(msg.sender, _amountOGTemple, _lockedUntilTimestamp);
    }

    /** Withdraw a specific locked entry */
    function withdrawFor(address _staker, uint256 _idx) public {
        LockedEntry[] storage lockedEntries = locked[_staker];

        require(_idx < lockedEntries.length, "No lock entry at the specified index");
        require(lockedEntries[_idx].LockedUntilTimestamp < block.timestamp, "Specified entry is still locked");

        LockedEntry memory entry = lockedEntries[_idx];

        lockedEntries[_idx] = lockedEntries[lockedEntries.length-1];
        lockedEntries.pop();

        SafeERC20.safeTransfer(OG_TEMPLE, _staker, entry.BalanceOGTemple);
        emit OGTempleWithdraw(_staker, entry.BalanceOGTemple);
    }

    function withdraw(uint256 _idx) external {
        withdrawFor(msg.sender, _idx);
    }
}

File 13 of 27 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 15 of 27 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

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

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

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

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

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

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

File 16 of 27 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 17 of 27 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 18 of 27 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 19 of 27 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

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

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

        return true;
    }

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

        _beforeTokenTransfer(sender, recipient, amount);

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

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

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

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

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

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

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

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

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

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

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

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

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

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

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

File 20 of 27 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC20.sol";
import "../../../utils/Context.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 currentAllowance = allowance(account, _msgSender());
        require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
        unchecked {
            _approve(account, _msgSender(), currentAllowance - amount);
        }
        _burn(account, amount);
    }
}

File 21 of 27 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 22 of 27 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

File 23 of 27 : ITreasuryAllocation.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

/**
 * Contract which has treasury allocated from Stablec
 *
 * Reports back it's mark to market (so DAO can rebalance IV accordingly, from time to time)
 */
interface ITreasuryAllocation {
    /** 
     * mark to market of treasury investment, denominated in Treasury Stablec
     */
    function reval() external view returns (uint256);
}

File 24 of 27 : MintAllowance.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

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

import "./TempleERC20Token.sol";

/**
 * Newly minted temple allocated to various temple strategies
 *
 * Any temple held by this contract is assumed to be unused,
 * and hence doesn't effect the intrinsinc value calculation.
 *
 * It's only considered in circulation once a pool pulls
 * it's allowance.
 */
contract MintAllowance is Ownable {
    // Temple contract address
    TempleERC20Token TEMPLE;

    constructor(TempleERC20Token _TEMPLE) {
      TEMPLE = _TEMPLE;
    }

    /**
     * Increase mint allowance for the given pool
     *
     * Atomically pulls amount from treasury before increasing allownance
     * as an extra check and balance
     */
    function increaseMintAllowance(address _pool, uint256 _amount) external onlyOwner {
      SafeERC20.safeTransferFrom(TEMPLE, msg.sender, address(this), _amount);
      SafeERC20.safeIncreaseAllowance(TEMPLE, _pool, _amount);
    }

    /**
     * Burn any unused mint allowance for a given pool
     */
    function burnUnusedMintAllowance(address _pool) external onlyOwner {
      uint256 unusedMintAllowance = TEMPLE.allowance(address(this), _pool);
      SafeERC20.safeDecreaseAllowance(TEMPLE, _pool, unusedMintAllowance);
      TEMPLE.burn(unusedMintAllowance);
    }
}

File 25 of 27 : ABDKMath64x64.sol
// SPDX-License-Identifier: BSD-4-Clause
/*
 * ABDK Math 64.64 Smart Contract Library.  Copyright © 2019 by ABDK Consulting.
 * Author: Mikhail Vladimirov <[email protected]>
 */
pragma solidity ^0.8.4;

/**
 * Smart contract library of mathematical functions operating with signed
 * 64.64-bit fixed point numbers.  Signed 64.64-bit fixed point number is
 * basically a simple fraction whose numerator is signed 128-bit integer and
 * denominator is 2^64.  As long as denominator is always the same, there is no
 * need to store it, thus in Solidity signed 64.64-bit fixed point numbers are
 * represented by int128 type holding only the numerator.
 */
library ABDKMath64x64 {
  /*
   * Minimum value signed 64.64-bit fixed point number may have. 
   */
  int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;

  /*
   * Maximum value signed 64.64-bit fixed point number may have. 
   */
  int128 private constant MAX_64x64 = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

  /**
   * Convert signed 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromInt (int256 x) internal pure returns (int128) {
    unchecked {
      require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF);
      return int128 (x << 64);
    }
  }

  /**
   * Convert signed 64.64 fixed point number into signed 64-bit integer number
   * rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64-bit integer number
   */
  function toInt (int128 x) internal pure returns (int64) {
    unchecked {
      return int64 (x >> 64);
    }
  }

  /**
   * Convert unsigned 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromUInt (uint256 x) internal pure returns (int128) {
    unchecked {
      require (x <= 0x7FFFFFFFFFFFFFFF);
      return int128 (int256 (x << 64));
    }
  }

  /**
   * Convert signed 64.64 fixed point number into unsigned 64-bit integer
   * number rounding down.  Revert on underflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return unsigned 64-bit integer number
   */
  function toUInt (int128 x) internal pure returns (uint64) {
    unchecked {
      require (x >= 0);
      return uint64 (uint128 (x >> 64));
    }
  }

  /**
   * Convert signed 128.128 fixed point number into signed 64.64-bit fixed point
   * number rounding down.  Revert on overflow.
   *
   * @param x signed 128.128-bin fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function from128x128 (int256 x) internal pure returns (int128) {
    unchecked {
      int256 result = x >> 64;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Convert signed 64.64 fixed point number into signed 128.128 fixed point
   * number.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 128.128 fixed point number
   */
  function to128x128 (int128 x) internal pure returns (int256) {
    unchecked {
      return int256 (x) << 64;
    }
  }

  /**
   * Calculate x + y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function add (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      int256 result = int256(x) + y;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate x - y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sub (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      int256 result = int256(x) - y;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate x * y rounding down.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function mul (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      int256 result = int256(x) * y >> 64;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate x * y rounding towards zero, where x is signed 64.64 fixed point
   * number and y is signed 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y signed 256-bit integer number
   * @return signed 256-bit integer number
   */
  function muli (int128 x, int256 y) internal pure returns (int256) {
    unchecked {
      if (x == MIN_64x64) {
        require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF &&
          y <= 0x1000000000000000000000000000000000000000000000000);
        return -y << 63;
      } else {
        bool negativeResult = false;
        if (x < 0) {
          x = -x;
          negativeResult = true;
        }
        if (y < 0) {
          y = -y; // We rely on overflow behavior here
          negativeResult = !negativeResult;
        }
        uint256 absoluteResult = mulu (x, uint256 (y));
        if (negativeResult) {
          require (absoluteResult <=
            0x8000000000000000000000000000000000000000000000000000000000000000);
          return -int256 (absoluteResult); // We rely on overflow behavior here
        } else {
          require (absoluteResult <=
            0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
          return int256 (absoluteResult);
        }
      }
    }
  }

  /**
   * Calculate x * y rounding down, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y unsigned 256-bit integer number
   * @return unsigned 256-bit integer number
   */
  function mulu (int128 x, uint256 y) internal pure returns (uint256) {
    unchecked {
      if (y == 0) return 0;

      require (x >= 0);

      uint256 lo = (uint256 (int256 (x)) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64;
      uint256 hi = uint256 (int256 (x)) * (y >> 128);

      require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      hi <<= 64;

      require (hi <=
        0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - lo);
      return hi + lo;
    }
  }

  /**
   * Calculate x / y rounding towards zero.  Revert on overflow or when y is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function div (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      require (y != 0);
      int256 result = (int256 (x) << 64) / y;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are signed 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x signed 256-bit integer number
   * @param y signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divi (int256 x, int256 y) internal pure returns (int128) {
    unchecked {
      require (y != 0);

      bool negativeResult = false;
      if (x < 0) {
        x = -x; // We rely on overflow behavior here
        negativeResult = true;
      }
      if (y < 0) {
        y = -y; // We rely on overflow behavior here
        negativeResult = !negativeResult;
      }
      uint128 absoluteResult = divuu (uint256 (x), uint256 (y));
      if (negativeResult) {
        require (absoluteResult <= 0x80000000000000000000000000000000);
        return -int128 (absoluteResult); // We rely on overflow behavior here
      } else {
        require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
        return int128 (absoluteResult); // We rely on overflow behavior here
      }
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divu (uint256 x, uint256 y) internal pure returns (int128) {
    unchecked {
      require (y != 0);
      uint128 result = divuu (x, y);
      require (result <= uint128 (MAX_64x64));
      return int128 (result);
    }
  }

  /**
   * Calculate -x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function neg (int128 x) internal pure returns (int128) {
    unchecked {
      require (x != MIN_64x64);
      return -x;
    }
  }

  /**
   * Calculate |x|.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function abs (int128 x) internal pure returns (int128) {
    unchecked {
      require (x != MIN_64x64);
      return x < 0 ? -x : x;
    }
  }

  /**
   * Calculate 1 / x rounding towards zero.  Revert on overflow or when x is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function inv (int128 x) internal pure returns (int128) {
    unchecked {
      require (x != 0);
      int256 result = int256 (0x100000000000000000000000000000000) / x;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate arithmetics average of x and y, i.e. (x + y) / 2 rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function avg (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      return int128 ((int256 (x) + int256 (y)) >> 1);
    }
  }

  /**
   * Calculate geometric average of x and y, i.e. sqrt (x * y) rounding down.
   * Revert on overflow or in case x * y is negative.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function gavg (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      int256 m = int256 (x) * int256 (y);
      require (m >= 0);
      require (m <
          0x4000000000000000000000000000000000000000000000000000000000000000);
      return int128 (sqrtu (uint256 (m)));
    }
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y uint256 value
   * @return signed 64.64-bit fixed point number
   */
  function pow (int128 x, uint256 y) internal pure returns (int128) {
    unchecked {
      bool negative = x < 0 && y & 1 == 1;

      uint256 absX = uint128 (x < 0 ? -x : x);
      uint256 absResult;
      absResult = 0x100000000000000000000000000000000;

      if (absX <= 0x10000000000000000) {
        absX <<= 63;
        while (y != 0) {
          if (y & 0x1 != 0) {
            absResult = absResult * absX >> 127;
          }
          absX = absX * absX >> 127;

          if (y & 0x2 != 0) {
            absResult = absResult * absX >> 127;
          }
          absX = absX * absX >> 127;

          if (y & 0x4 != 0) {
            absResult = absResult * absX >> 127;
          }
          absX = absX * absX >> 127;

          if (y & 0x8 != 0) {
            absResult = absResult * absX >> 127;
          }
          absX = absX * absX >> 127;

          y >>= 4;
        }

        absResult >>= 64;
      } else {
        uint256 absXShift = 63;
        if (absX < 0x1000000000000000000000000) { absX <<= 32; absXShift -= 32; }
        if (absX < 0x10000000000000000000000000000) { absX <<= 16; absXShift -= 16; }
        if (absX < 0x1000000000000000000000000000000) { absX <<= 8; absXShift -= 8; }
        if (absX < 0x10000000000000000000000000000000) { absX <<= 4; absXShift -= 4; }
        if (absX < 0x40000000000000000000000000000000) { absX <<= 2; absXShift -= 2; }
        if (absX < 0x80000000000000000000000000000000) { absX <<= 1; absXShift -= 1; }

        uint256 resultShift = 0;
        while (y != 0) {
          require (absXShift < 64);

          if (y & 0x1 != 0) {
            absResult = absResult * absX >> 127;
            resultShift += absXShift;
            if (absResult > 0x100000000000000000000000000000000) {
              absResult >>= 1;
              resultShift += 1;
            }
          }
          absX = absX * absX >> 127;
          absXShift <<= 1;
          if (absX >= 0x100000000000000000000000000000000) {
              absX >>= 1;
              absXShift += 1;
          }

          y >>= 1;
        }

        require (resultShift < 64);
        absResult >>= 64 - resultShift;
      }
      int256 result = negative ? -int256 (absResult) : int256 (absResult);
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate sqrt (x) rounding down.  Revert if x < 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sqrt (int128 x) internal pure returns (int128) {
    unchecked {
      require (x >= 0);
      return int128 (sqrtu (uint256 (int256 (x)) << 64));
    }
  }

  /**
   * Calculate binary logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function log_2 (int128 x) internal pure returns (int128) {
    unchecked {
      require (x > 0);

      int256 msb = 0;
      int256 xc = x;
      if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      int256 result = msb - 64 << 64;
      uint256 ux = uint256 (int256 (x)) << uint256 (127 - msb);
      for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) {
        ux *= ux;
        uint256 b = ux >> 255;
        ux >>= 127 + b;
        result += bit * int256 (b);
      }

      return int128 (result);
    }
  }

  /**
   * Calculate natural logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function ln (int128 x) internal pure returns (int128) {
    unchecked {
      require (x > 0);

      return int128 (int256 (
          uint256 (int256 (log_2 (x))) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128));
    }
  }

  /**
   * Calculate binary exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp_2 (int128 x) internal pure returns (int128) {
    unchecked {
      require (x < 0x400000000000000000); // Overflow

      if (x < -0x400000000000000000) return 0; // Underflow

      uint256 result = 0x80000000000000000000000000000000;

      if (x & 0x8000000000000000 > 0)
        result = result * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128;
      if (x & 0x4000000000000000 > 0)
        result = result * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128;
      if (x & 0x2000000000000000 > 0)
        result = result * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128;
      if (x & 0x1000000000000000 > 0)
        result = result * 0x10B5586CF9890F6298B92B71842A98363 >> 128;
      if (x & 0x800000000000000 > 0)
        result = result * 0x1059B0D31585743AE7C548EB68CA417FD >> 128;
      if (x & 0x400000000000000 > 0)
        result = result * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128;
      if (x & 0x200000000000000 > 0)
        result = result * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128;
      if (x & 0x100000000000000 > 0)
        result = result * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128;
      if (x & 0x80000000000000 > 0)
        result = result * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128;
      if (x & 0x40000000000000 > 0)
        result = result * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128;
      if (x & 0x20000000000000 > 0)
        result = result * 0x100162F3904051FA128BCA9C55C31E5DF >> 128;
      if (x & 0x10000000000000 > 0)
        result = result * 0x1000B175EFFDC76BA38E31671CA939725 >> 128;
      if (x & 0x8000000000000 > 0)
        result = result * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128;
      if (x & 0x4000000000000 > 0)
        result = result * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128;
      if (x & 0x2000000000000 > 0)
        result = result * 0x1000162E525EE054754457D5995292026 >> 128;
      if (x & 0x1000000000000 > 0)
        result = result * 0x10000B17255775C040618BF4A4ADE83FC >> 128;
      if (x & 0x800000000000 > 0)
        result = result * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128;
      if (x & 0x400000000000 > 0)
        result = result * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128;
      if (x & 0x200000000000 > 0)
        result = result * 0x10000162E43F4F831060E02D839A9D16D >> 128;
      if (x & 0x100000000000 > 0)
        result = result * 0x100000B1721BCFC99D9F890EA06911763 >> 128;
      if (x & 0x80000000000 > 0)
        result = result * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128;
      if (x & 0x40000000000 > 0)
        result = result * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128;
      if (x & 0x20000000000 > 0)
        result = result * 0x100000162E430E5A18F6119E3C02282A5 >> 128;
      if (x & 0x10000000000 > 0)
        result = result * 0x1000000B1721835514B86E6D96EFD1BFE >> 128;
      if (x & 0x8000000000 > 0)
        result = result * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128;
      if (x & 0x4000000000 > 0)
        result = result * 0x10000002C5C8601CC6B9E94213C72737A >> 128;
      if (x & 0x2000000000 > 0)
        result = result * 0x1000000162E42FFF037DF38AA2B219F06 >> 128;
      if (x & 0x1000000000 > 0)
        result = result * 0x10000000B17217FBA9C739AA5819F44F9 >> 128;
      if (x & 0x800000000 > 0)
        result = result * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128;
      if (x & 0x400000000 > 0)
        result = result * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128;
      if (x & 0x200000000 > 0)
        result = result * 0x10000000162E42FF0999CE3541B9FFFCF >> 128;
      if (x & 0x100000000 > 0)
        result = result * 0x100000000B17217F80F4EF5AADDA45554 >> 128;
      if (x & 0x80000000 > 0)
        result = result * 0x10000000058B90BFBF8479BD5A81B51AD >> 128;
      if (x & 0x40000000 > 0)
        result = result * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128;
      if (x & 0x20000000 > 0)
        result = result * 0x100000000162E42FEFB2FED257559BDAA >> 128;
      if (x & 0x10000000 > 0)
        result = result * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128;
      if (x & 0x8000000 > 0)
        result = result * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128;
      if (x & 0x4000000 > 0)
        result = result * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128;
      if (x & 0x2000000 > 0)
        result = result * 0x1000000000162E42FEFA494F1478FDE05 >> 128;
      if (x & 0x1000000 > 0)
        result = result * 0x10000000000B17217F7D20CF927C8E94C >> 128;
      if (x & 0x800000 > 0)
        result = result * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128;
      if (x & 0x400000 > 0)
        result = result * 0x100000000002C5C85FDF477B662B26945 >> 128;
      if (x & 0x200000 > 0)
        result = result * 0x10000000000162E42FEFA3AE53369388C >> 128;
      if (x & 0x100000 > 0)
        result = result * 0x100000000000B17217F7D1D351A389D40 >> 128;
      if (x & 0x80000 > 0)
        result = result * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128;
      if (x & 0x40000 > 0)
        result = result * 0x1000000000002C5C85FDF4741BEA6E77E >> 128;
      if (x & 0x20000 > 0)
        result = result * 0x100000000000162E42FEFA39FE95583C2 >> 128;
      if (x & 0x10000 > 0)
        result = result * 0x1000000000000B17217F7D1CFB72B45E1 >> 128;
      if (x & 0x8000 > 0)
        result = result * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128;
      if (x & 0x4000 > 0)
        result = result * 0x10000000000002C5C85FDF473E242EA38 >> 128;
      if (x & 0x2000 > 0)
        result = result * 0x1000000000000162E42FEFA39F02B772C >> 128;
      if (x & 0x1000 > 0)
        result = result * 0x10000000000000B17217F7D1CF7D83C1A >> 128;
      if (x & 0x800 > 0)
        result = result * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128;
      if (x & 0x400 > 0)
        result = result * 0x100000000000002C5C85FDF473DEA871F >> 128;
      if (x & 0x200 > 0)
        result = result * 0x10000000000000162E42FEFA39EF44D91 >> 128;
      if (x & 0x100 > 0)
        result = result * 0x100000000000000B17217F7D1CF79E949 >> 128;
      if (x & 0x80 > 0)
        result = result * 0x10000000000000058B90BFBE8E7BCE544 >> 128;
      if (x & 0x40 > 0)
        result = result * 0x1000000000000002C5C85FDF473DE6ECA >> 128;
      if (x & 0x20 > 0)
        result = result * 0x100000000000000162E42FEFA39EF366F >> 128;
      if (x & 0x10 > 0)
        result = result * 0x1000000000000000B17217F7D1CF79AFA >> 128;
      if (x & 0x8 > 0)
        result = result * 0x100000000000000058B90BFBE8E7BCD6D >> 128;
      if (x & 0x4 > 0)
        result = result * 0x10000000000000002C5C85FDF473DE6B2 >> 128;
      if (x & 0x2 > 0)
        result = result * 0x1000000000000000162E42FEFA39EF358 >> 128;
      if (x & 0x1 > 0)
        result = result * 0x10000000000000000B17217F7D1CF79AB >> 128;

      result >>= uint256 (int256 (63 - (x >> 64)));
      require (result <= uint256 (int256 (MAX_64x64)));

      return int128 (int256 (result));
    }
  }

  /**
   * Calculate natural exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp (int128 x) internal pure returns (int128) {
    unchecked {
      require (x < 0x400000000000000000); // Overflow

      if (x < -0x400000000000000000) return 0; // Underflow

      return exp_2 (
          int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128));
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return unsigned 64.64-bit fixed point number
   */
  function divuu (uint256 x, uint256 y) private pure returns (uint128) {
    unchecked {
      require (y != 0);

      uint256 result;

      if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
        result = (x << 64) / y;
      else {
        uint256 msb = 192;
        uint256 xc = x >> 192;
        if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
        if (xc >= 0x10000) { xc >>= 16; msb += 16; }
        if (xc >= 0x100) { xc >>= 8; msb += 8; }
        if (xc >= 0x10) { xc >>= 4; msb += 4; }
        if (xc >= 0x4) { xc >>= 2; msb += 2; }
        if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

        result = (x << 255 - msb) / ((y - 1 >> msb - 191) + 1);
        require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

        uint256 hi = result * (y >> 128);
        uint256 lo = result * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

        uint256 xh = x >> 192;
        uint256 xl = x << 64;

        if (xl < lo) xh -= 1;
        xl -= lo; // We rely on overflow behavior here
        lo = hi << 128;
        if (xl < lo) xh -= 1;
        xl -= lo; // We rely on overflow behavior here

        assert (xh == hi >> 128);

        result += xl / y;
      }

      require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return uint128 (result);
    }
  }

  /**
   * Calculate sqrt (x) rounding down, where x is unsigned 256-bit integer
   * number.
   *
   * @param x unsigned 256-bit integer number
   * @return unsigned 128-bit integer number
   */
  function sqrtu (uint256 x) private pure returns (uint128) {
    unchecked {
      if (x == 0) return 0;
      else {
        uint256 xx = x;
        uint256 r = 1;
        if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; }
        if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; }
        if (xx >= 0x100000000) { xx >>= 32; r <<= 16; }
        if (xx >= 0x10000) { xx >>= 16; r <<= 8; }
        if (xx >= 0x100) { xx >>= 8; r <<= 4; }
        if (xx >= 0x10) { xx >>= 4; r <<= 2; }
        if (xx >= 0x8) { r <<= 1; }
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1; // Seven iterations should be enough
        uint256 r1 = x / r;
        return uint128 (r < r1 ? r : r1);
      }
    }
  }
}

File 26 of 27 : OGTemple.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

/**
 * Created and owned by the staking contract. 
 *
 * It mints and burns OGTemple as users stake/unstake
 */
contract OGTemple is ERC20, ERC20Burnable, Ownable {
    constructor() ERC20("OGTemple", "OG_TEMPLE") {}

    function mint(address to, uint256 amount) external onlyOwner {
      _mint(to, amount);
    }
}

File 27 of 27 : ExitQueue.sol
pragma solidity ^0.8.4;
// SPDX-License-Identifier: GPL-3.0-or-later

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


// import "hardhat/console.sol";

/**
 * How all exit of TEMPLE rewards are managed.
 */
contract ExitQueue is Ownable {
    struct User {
        // Total currently in queue
        uint256 Amount;

        // First epoch for which the user is in the unstake queue
        uint256 FirstExitEpoch;

        // Last epoch for which the user has a pending unstake
        uint256 LastExitEpoch;

        // All epochs where the user has an exit allocation
        mapping(uint256 => uint256) Exits;
    }

    // total queued to be exited in a given epoch
    mapping(uint256 => uint256) public totalPerEpoch;

    // The first unwithdrawn epoch for the user
    mapping(address => User) public userData;

    IERC20 public TEMPLE;   // TEMPLE

    // Limit of how much temple can exit per epoch
    uint256 public maxPerEpoch;

    // Limit of how much temple can exit per address per epoch
    uint256 public maxPerAddress;

    // epoch size, in blocks
    uint256 public epochSize; 

    // the block we use to work out what epoch we are in
    uint256 public firstBlock;

    // The next free block on which a user can commence their unstake
    uint256 public nextUnallocatedEpoch;

    event JoinQueue(address exiter, uint256 amount);    
    event Withdrawal(address exiter, uint256 amount);    

    constructor(
        address _TEMPLE,
        uint256 _maxPerEpoch,
        uint256 _maxPerAddress,
        uint256 _epochSize) {

        TEMPLE = IERC20(_TEMPLE);

        maxPerEpoch = _maxPerEpoch;
        maxPerAddress = _maxPerAddress;
        epochSize = _epochSize;
        firstBlock = block.number;
        nextUnallocatedEpoch = 0;
    }

    function setMaxPerEpoch(uint256 _maxPerEpoch) external onlyOwner {
        maxPerEpoch = _maxPerEpoch;
    }

    function setMaxPerAddress(uint256 _maxPerAddress) external onlyOwner {
        maxPerAddress = _maxPerAddress;
    }

    function setEpochSize(uint256 _epochSize) external onlyOwner {
        epochSize = _epochSize;
    }

    function setStartingBlock(uint256 _firstBlock) external onlyOwner {
        require(_firstBlock < firstBlock, "Can only move start block back, not forward");
        firstBlock = _firstBlock;
    }

    function currentEpoch() public view returns (uint256) {
        return (block.number - firstBlock) / epochSize;
    }

    function currentEpochAllocation(address _exiter, uint256 _epoch) external view returns (uint256) {
        return userData[_exiter].Exits[_epoch];
    }

    function join(address _exiter, uint256 _amount) external {        
        require(_amount > 0, "Amount must be > 0");

        if (nextUnallocatedEpoch < currentEpoch()) {
            nextUnallocatedEpoch = currentEpoch();
        }

        User storage user = userData[_exiter];

        uint256 unallocatedAmount = _amount;
        uint256 _nextUnallocatedEpoch = nextUnallocatedEpoch;
        uint256 nextAvailableEpochForUser = _nextUnallocatedEpoch;
        if (user.LastExitEpoch > nextAvailableEpochForUser) {
            nextAvailableEpochForUser = user.LastExitEpoch;
        }

        while (unallocatedAmount > 0) {
            // work out allocation for the next available epoch
            uint256 allocationForEpoch = unallocatedAmount;
            if (user.Exits[nextAvailableEpochForUser] + allocationForEpoch > maxPerAddress) {
                allocationForEpoch = maxPerAddress - user.Exits[nextAvailableEpochForUser];
            }
            if (totalPerEpoch[nextAvailableEpochForUser] + allocationForEpoch > maxPerEpoch) {
                allocationForEpoch = maxPerEpoch - totalPerEpoch[nextAvailableEpochForUser];
            }

            // Bookkeeping
            if (allocationForEpoch > 0) {
                if (user.Amount == 0) {
                    user.FirstExitEpoch = nextAvailableEpochForUser;
                }
                user.Amount += allocationForEpoch;
                user.Exits[nextAvailableEpochForUser] += allocationForEpoch;
                totalPerEpoch[nextAvailableEpochForUser] += allocationForEpoch;
                user.LastExitEpoch = nextAvailableEpochForUser;

                if (totalPerEpoch[nextAvailableEpochForUser] >= maxPerEpoch) {
                    _nextUnallocatedEpoch = nextAvailableEpochForUser;
                }

                unallocatedAmount -= allocationForEpoch;
            }

            nextAvailableEpochForUser += 1;
        }

        // update outside of main loop, so we spend gas once
        nextUnallocatedEpoch = _nextUnallocatedEpoch;

        SafeERC20.safeTransferFrom(TEMPLE, msg.sender, address(this), _amount);
        emit JoinQueue(_exiter, _amount);
    }

    /**
     * Withdraw processed allowance from a specific epoch
     */
    function withdraw(uint256 epoch) external {
        require(epoch < currentEpoch(), "Can only withdraw from past epochs");

        User storage user = userData[msg.sender];

        uint256 amount = user.Exits[epoch];
        delete user.Exits[epoch];
        totalPerEpoch[epoch] -= amount; // TODO: WHen this goes to 0, is it the same as the data being removed?
        user.Amount -= amount;

        // Once all allocations on queue have been claimed, reset user state
        if (user.Amount == 0) {
            // NOTE: triggers ExitQueue.withdraw(uint256) (contracts/ExitQueue.sol #150-167) deletes ExitQueue.User (contracts/ExitQueue.sol#15-27) which contains a mapping
            //        This is okay as if Amount is 0, we'd expect user.Exits to be empty as well
            //        TODO: Confirm this via tests
            delete userData[msg.sender];
        }

        SafeERC20.safeTransfer(TEMPLE, msg.sender, amount);
        emit Withdrawal(msg.sender, amount);    
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_stablecToken","type":"address"},{"internalType":"contract TempleERC20Token","name":"_templeToken","type":"address"},{"internalType":"contract TempleStaking","name":"_staking","type":"address"},{"internalType":"contract LockedOGTemple","name":"_lockedOGTemple","type":"address"},{"internalType":"contract TempleTreasury","name":"_treasury","type":"address"},{"internalType":"contract TreasuryManagementProxy","name":"_treasuryManagement","type":"address"},{"internalType":"uint256","name":"_harvestThresholdStablec","type":"uint256"},{"internalType":"uint256","name":"_inviteThresholdStablec","type":"uint256"},{"internalType":"uint256","name":"_maxInvitesPerVerifiedUser","type":"uint256"},{"components":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"internalType":"struct OpeningCeremony.Factor","name":"_verifiedBonusFactor","type":"tuple"},{"components":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"internalType":"struct OpeningCeremony.Factor","name":"_guestBonusFactor","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"acceptedStablec","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintedTemple","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bonusTemple","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintedOGTemple","type":"uint256"}],"name":"MintComplete","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"acceptedTemple","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bonusTemple","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintedOGTemple","type":"uint256"}],"name":"StakeComplete","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"VerifiedUserAdded","type":"event"},{"inputs":[],"name":"CAN_ADD_VERIFIED_USER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"}],"name":"addGuestUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"}],"name":"addVerifiedUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalDoublingIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"guestBonusFactor","outputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvestThresholdStablec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inviteThresholdStablec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdatedTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limitStablec","outputs":[{"internalType":"uint256","name":"guestMax","type":"uint256"},{"internalType":"uint256","name":"verifiedMax","type":"uint256"},{"internalType":"uint256","name":"verifiedDayOne","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limitTemple","outputs":[{"internalType":"uint256","name":"guestMax","type":"uint256"},{"internalType":"uint256","name":"verifiedMax","type":"uint256"},{"internalType":"uint256","name":"verifiedDayOne","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockedOGTemple","outputs":[{"internalType":"contract LockedOGTemple","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxInvitesPerVerifiedUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"doublingIndexAtVerification","type":"uint256"}],"name":"maxSacrificableStablec","outputs":[{"internalType":"uint256","name":"maxLimit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountPaidStablec","type":"uint256"}],"name":"mintAndStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_amountPaidStablec","type":"uint256"}],"name":"mintAndStakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintMultiple","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_numerator","type":"uint256"},{"internalType":"uint256","name":"_denominator","type":"uint256"}],"name":"setGuestBonusFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_harvestThresholdStablec","type":"uint256"}],"name":"setHarvestThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_inviteThresholdStablec","type":"uint256"}],"name":"setInviteThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"guestMax","type":"uint256"},{"internalType":"uint256","name":"verifiedMax","type":"uint256"},{"internalType":"uint256","name":"verifiedDayOne","type":"uint256"}],"name":"setLimitStablec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"guestMax","type":"uint256"},{"internalType":"uint256","name":"verifiedMax","type":"uint256"}],"name":"setLimitTemple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxInvitesPerVerifiedUser","type":"uint256"}],"name":"setMaxInvitesPerVerifiedUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintMultiple","type":"uint256"}],"name":"setMintMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_unlockDelaySeconds","type":"uint256"}],"name":"setUnlockDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_numerator","type":"uint256"},{"internalType":"uint256","name":"_denominator","type":"uint256"}],"name":"setVerifiedBonusFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stablecToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountTemple","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_amountTemple","type":"uint256"}],"name":"stakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"contract TempleStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"templeToken","outputs":[{"internalType":"contract TempleERC20Token","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"contract TempleTreasury","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryManagement","outputs":[{"internalType":"contract TreasuryManagementProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unlockDelaySeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"users","outputs":[{"internalType":"bool","name":"isVerified","type":"bool"},{"internalType":"bool","name":"isGuest","type":"bool"},{"internalType":"uint8","name":"numInvited","type":"uint8"},{"internalType":"uint256","name":"doublingIndexAtVerification","type":"uint256"},{"internalType":"uint256","name":"totalSacrificedStablec","type":"uint256"},{"internalType":"uint256","name":"totalSacrificedTemple","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifiedBonusFactor","outputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040526006600762015180620000189190620007ea565b620000249190620007ea565b60085560066009556001600d55604051806060016040528069021e19e0c9bab240000081526020016965a4da25d3016c000000815260200169065a4da25d3016c00000815250600f6000820151816000015560208201518160010155604082015181600201555050604051806060016040528069021e19e0c9bab240000081526020016965a4da25d3016c000000815260200169065a4da25d3016c0000081525060126000820151816000015560208201518160010155604082015181600201555050348015620000f457600080fd5b506040516200532e3803806200532e83398181016040528101906200011a9190620006ba565b6200013a6200012e6200035f60201b60201c565b6200036760201b60201c565b60008060146101000a81548160ff0219169083151502179055508a600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555089600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555088600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600a8190555083600b8190555082600c819055508160156000820151816000015560208201518160010155905050806017600082015181600001556020820151816001015590505042600e819055506200034e6000801b620003426200042b60201b60201c565b6200045460201b60201c565b505050505050505050505062000a5c565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6200046682826200046a60201b60201c565b5050565b6200047c82826200055b60201b60201c565b6200055757600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620004fc6200035f60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600081519050620005d781620009a6565b92915050565b600081519050620005ee81620009c0565b92915050565b6000815190506200060581620009da565b92915050565b6000815190506200061c81620009f4565b92915050565b600081519050620006338162000a0e565b92915050565b6000815190506200064a8162000a28565b92915050565b6000604082840312156200066357600080fd5b6200066f6040620007c1565b905060006200068184828501620006a3565b60008301525060206200069784828501620006a3565b60208301525092915050565b600081519050620006b48162000a42565b92915050565b60008060008060008060008060008060006101a08c8e031215620006dd57600080fd5b6000620006ed8e828f01620005c6565b9b50506020620007008e828f01620005f4565b9a50506040620007138e828f016200060b565b9950506060620007268e828f01620005dd565b9850506080620007398e828f0162000622565b97505060a06200074c8e828f0162000639565b96505060c06200075f8e828f01620006a3565b95505060e0620007728e828f01620006a3565b945050610100620007868e828f01620006a3565b9350506101206200079a8e828f0162000650565b925050610160620007ae8e828f0162000650565b9150509295989b509295989b9093969950565b6000620007cd620007e0565b9050620007db828262000901565b919050565b6000604051905090565b6000620007f782620008f7565b91506200080483620008f7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161562000840576200083f62000937565b5b828202905092915050565b60006200085882620008d7565b9050919050565b60006200086c826200084b565b9050919050565b600062000880826200084b565b9050919050565b600062000894826200084b565b9050919050565b6000620008a8826200084b565b9050919050565b6000620008bc826200084b565b9050919050565b6000620008d0826200084b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6200090c8262000995565b810181811067ffffffffffffffff821117156200092e576200092d62000966565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b620009b1816200085f565b8114620009bd57600080fd5b50565b620009cb8162000873565b8114620009d757600080fd5b50565b620009e58162000887565b8114620009f157600080fd5b50565b620009ff816200089b565b811462000a0b57600080fd5b50565b62000a1981620008af565b811462000a2557600080fd5b50565b62000a3381620008c3565b811462000a3f57600080fd5b50565b62000a4d81620008f7565b811462000a5957600080fd5b50565b6148c28062000a6c6000396000f3fe608060405234801561001057600080fd5b50600436106102d55760003560e01c80637f7928fc11610182578063a694fc3a116100e9578063ca2dfd0a116100a2578063f0e70cfd1161007c578063f0e70cfd14610841578063f2fde38b1461085f578063fbaf894c1461087b578063fd13375714610899576102d5565b8063ca2dfd0a146107ed578063d547741f14610809578063d960b37a14610825576102d5565b8063a694fc3a14610727578063a6b759a214610743578063a87430ba1461075f578063b1a9069c14610794578063ba568618146107b2578063c34e12c3146107ce576102d5565b80638da5cb5b1161013b5780638da5cb5b146106635780638e7e49c7146106815780639000b3d61461069d57806391d14854146106b95780639d5ff115146106e9578063a217fddf14610709576102d5565b80637f7928fc146105b55780637fb08ebd146105d35780638456cb59146105f157806388e3c5d6146105fb5780638abf1bfb146106175780638b79c36214610633576102d5565b80632f2ff15d11610241578063539e0601116101fa57806361d027b3116101d457806361d027b3146105555780636ab02b15146105735780636cadc3b51461058f578063715018a6146105ab576102d5565b8063539e0601146104ff5780635c975abb1461051b5780636115df5714610539576102d5565b80632f2ff15d1461046557806336568abe14610481578063376203461461049d5780633f4ba83a146104b9578063431a04be146104c35780634cf088d9146104e1576102d5565b80631e25252f116102935780631e25252f146103a157806322e6b6ac146103bf578063248a9ca3146103dd57806326d17b3c1461040d5780632a7684651461042b5780632ee4090814610449576102d5565b80623c2893146102da57806301ffc9a7146102fa5780630549425d1461032a5780630d71155614610349578063140ad597146103655780631da981f314610383575b600080fd5b6102e26108b5565b6040516102f193929190613fc6565b60405180910390f35b610314600480360381019061030f91906134ff565b6108cd565b6040516103219190613c07565b60405180910390f35b610332610947565b604051610340929190613f9d565b60405180910390f35b610363600480360381019061035e9190613551565b610959565b005b61036d6109df565b60405161037a9190613c9e565b60405180910390f35b61038b610a05565b6040516103989190613f82565b60405180910390f35b6103a9610a0b565b6040516103b69190613c83565b60405180910390f35b6103c7610a2f565b6040516103d49190613f82565b60405180910390f35b6103f760048036038101906103f2919061349a565b610a35565b6040516104049190613c83565b60405180910390f35b610415610a55565b6040516104229190613f82565b60405180910390f35b610433610a5b565b6040516104409190613f82565b60405180910390f35b610463600480360381019061045e9190613435565b610a61565b005b61047f600480360381019061047a91906134c3565b610fd3565b005b61049b600480360381019061049691906134c3565b610ffc565b005b6104b760048036038101906104b2919061361b565b61107f565b005b6104c161111e565b005b6104cb6111a4565b6040516104d89190613f82565b60405180910390f35b6104e96111aa565b6040516104f69190613cef565b60405180910390f35b61051960048036038101906105149190613551565b6111d0565b005b610523611256565b6040516105309190613c07565b60405180910390f35b610553600480360381019061054e9190613551565b61126c565b005b61055d6112f2565b60405161056a9190613d0a565b60405180910390f35b61058d60048036038101906105889190613551565b611318565b005b6105a960048036038101906105a49190613551565b61139e565b005b6105b3611424565b005b6105bd6114ac565b6040516105ca9190613d25565b60405180910390f35b6105db6114d2565b6040516105e89190613cb9565b60405180910390f35b6105f96114f8565b005b6106156004803603810190610610919061340c565b61157e565b005b610631600480360381019061062c91906135a3565b611755565b005b61064d60048036038101906106489190613551565b6117e9565b60405161065a9190613f82565b60405180910390f35b61066b611826565b6040516106789190613a94565b60405180910390f35b61069b60048036038101906106969190613435565b61184f565b005b6106b760048036038101906106b2919061340c565b611f98565b005b6106d360048036038101906106ce91906134c3565b612041565b6040516106e09190613c07565b60405180910390f35b6106f16120ac565b60405161070093929190613fc6565b60405180910390f35b6107116120c4565b60405161071e9190613c83565b60405180910390f35b610741600480360381019061073c9190613551565b6120cb565b005b61075d600480360381019061075891906135a3565b612120565b005b6107796004803603810190610774919061340c565b6121b4565b60405161078b96959493929190613c22565b60405180910390f35b61079c612217565b6040516107a99190613cd4565b60405180910390f35b6107cc60048036038101906107c791906135a3565b61223d565b005b6107d66122d1565b6040516107e4929190613f9d565b60405180910390f35b6108076004803603810190610802919061340c565b6122e3565b005b610823600480360381019061081e91906134c3565b61238c565b005b61083f600480360381019061083a9190613551565b6123b5565b005b61084961240a565b6040516108569190613f82565b60405180910390f35b6108796004803603810190610874919061340c565b612410565b005b610883612508565b6040516108909190613f82565b60405180910390f35b6108b360048036038101906108ae919061340c565b61250e565b005b60128060000154908060010154908060020154905083565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610940575061093f8261278f565b5b9050919050565b60178060000154908060010154905082565b6109616127f9565b73ffffffffffffffffffffffffffffffffffffffff1661097f611826565b73ffffffffffffffffffffffffffffffffffffffff16146109d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cc90613ea2565b60405180910390fd5b80600c8190555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b7fa029d34f4788cf44bc1a02ff78e93b02dd18e538043436a28f4c96606b8b50ca81565b600a5481565b600060016000838152602001908152602001600020600101549050919050565b60085481565b60095481565b610a69611256565b15610aa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa090613e62565b60405180910390fd5b6000601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900460ff1615610b6557601260010154838360030154610b1b919061403a565b1115610b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5390613f02565b60405180910390fd5b60159050610c18565b8160000160019054906101000a900460ff1615610bdc57601260000154838360030154610b92919061403a565b1115610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca90613f02565b60405180910390fd5b60179050610c17565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0e90613e22565b60405180910390fd5b5b60008160010154826000015485610c2f91906140f8565b610c3991906140c7565b905060008185610c49919061403a565b905084846003016000828254610c5f919061403a565b92505081905550610c94600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333088612801565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930846040518363ffffffff1660e01b8152600401610cf1929190613b0f565b600060405180830381600087803b158015610d0b57600080fd5b505af1158015610d1f573d6000803e3d6000fd5b50505050610d72600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361288a565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a694fc3a836040518263ffffffff1660e01b8152600401610dcf9190613f82565b602060405180830381600087803b158015610de957600080fd5b505af1158015610dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e21919061357a565b9050610eef600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f1284aa6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e8e57600080fd5b505afa158015610ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec69190613528565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361288a565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166383e25f8a888360085442610f3d919061403a565b6040518463ffffffff1660e01b8152600401610f5b93929190613b38565b600060405180830381600087803b158015610f7557600080fd5b505af1158015610f89573d6000803e3d6000fd5b505050507fd4a763821562d86aa6afe069e28523f46ec6a9dc0ff3f71fb6dfde6b6969b95c87878584604051610fc29493929190613b6f565b60405180910390a150505050505050565b610fdc82610a35565b610fed81610fe86127f9565b6129ab565b610ff78383612a48565b505050565b6110046127f9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611071576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106890613f62565b60405180910390fd5b61107b8282612b28565b5050565b6110876127f9565b73ffffffffffffffffffffffffffffffffffffffff166110a5611826565b73ffffffffffffffffffffffffffffffffffffffff16146110fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f290613ea2565b60405180910390fd5b82600f6000018190555081600f6001018190555080600f60020181905550505050565b6111266127f9565b73ffffffffffffffffffffffffffffffffffffffff16611144611826565b73ffffffffffffffffffffffffffffffffffffffff161461119a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119190613ea2565b60405180910390fd5b6111a2612c0a565b565b600d5481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6111d86127f9565b73ffffffffffffffffffffffffffffffffffffffff166111f6611826565b73ffffffffffffffffffffffffffffffffffffffff161461124c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124390613ea2565b60405180910390fd5b80600b8190555050565b60008060149054906101000a900460ff16905090565b6112746127f9565b73ffffffffffffffffffffffffffffffffffffffff16611292611826565b73ffffffffffffffffffffffffffffffffffffffff16146112e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112df90613ea2565b60405180910390fd5b8060088190555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6113206127f9565b73ffffffffffffffffffffffffffffffffffffffff1661133e611826565b73ffffffffffffffffffffffffffffffffffffffff1614611394576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138b90613ea2565b60405180910390fd5b80600a8190555050565b6113a66127f9565b73ffffffffffffffffffffffffffffffffffffffff166113c4611826565b73ffffffffffffffffffffffffffffffffffffffff161461141a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141190613ea2565b60405180910390fd5b8060098190555050565b61142c6127f9565b73ffffffffffffffffffffffffffffffffffffffff1661144a611826565b73ffffffffffffffffffffffffffffffffffffffff16146114a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149790613ea2565b60405180910390fd5b6114aa6000612cab565b565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6115006127f9565b73ffffffffffffffffffffffffffffffffffffffff1661151e611826565b73ffffffffffffffffffffffffffffffffffffffff1614611574576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156b90613ea2565b60405180910390fd5b61157c612d6f565b565b6115a87fa029d34f4788cf44bc1a02ff78e93b02dd18e538043436a28f4c96606b8b50ca33612041565b6115e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115de90613da2565b60405180910390fd5b601960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166e90613e02565b60405180910390fd5b6001601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff021916908315150217905550600d54601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507f02c0b9f20e7b24373a1da46d3894a3248fbb0d84eb8e1ac6384f7373f6e1e5638160405161174a9190613a94565b60405180910390a150565b61175d6127f9565b73ffffffffffffffffffffffffffffffffffffffff1661177b611826565b73ffffffffffffffffffffffffffffffffffffffff16146117d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c890613ea2565b60405180910390fd5b81601560000181905550806015600101819055505050565b600081600d54600f600201546117ff91906140f8565b61180991906140c7565b9050600f6001015481111561182157600f6001015490505b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611857611256565b15611897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188e90613e62565b60405180910390fd5b6000601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905062015180600e54426118ec9190614152565b1115611929576002600d600082825461190591906140f8565b9250508190555062015180600e6000828254611921919061403a565b925050819055505b60008160000160009054906101000a900460ff16156119a95761194f82600101546117e9565b83836002015461195f919061403a565b11156119a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199790613ee2565b60405180910390fd5b60159050611a5c565b8160000160019054906101000a900460ff1615611a2057600f600001548383600201546119d6919061403a565b1115611a17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0e90613ee2565b60405180910390fd5b60179050611a5b565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5290613e22565b60405180910390fd5b5b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a340bae26040518163ffffffff1660e01b8152600401604080518083038186803b158015611ac657600080fd5b505afa158015611ada573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611afe91906135df565b915091506000600954838388611b1491906140f8565b611b1e91906140c7565b611b2891906140c7565b905060008460010154856000015483611b4191906140f8565b611b4b91906140c7565b905060008183611b5b919061403a565b905087876002016000828254611b71919061403a565b92505081905550611bc8600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b612801565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401611c25929190613b0f565b600060405180830381600087803b158015611c3f57600080fd5b505af1158015611c53573d6000803e3d6000fd5b50505050611ca6600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361288a565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a694fc3a836040518263ffffffff1660e01b8152600401611d039190613f82565b602060405180830381600087803b158015611d1d57600080fd5b505af1158015611d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d55919061357a565b9050611e23600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f1284aa6040518163ffffffff1660e01b815260040160206040518083038186803b158015611dc257600080fd5b505afa158015611dd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfa9190613528565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361288a565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166383e25f8a8b8360085442611e71919061403a565b6040518463ffffffff1660e01b8152600401611e8f93929190613b38565b600060405180830381600087803b158015611ea957600080fd5b505af1158015611ebd573d6000803e3d6000fd5b50505050600a548910611f4d57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634641257d6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f3457600080fd5b505af1158015611f48573d6000803e3d6000fd5b505050505b7f9226b4bb47b02397020e6c6a368862e43950e7c8d8fc84390481d8f6255a2faf8a8a868685604051611f84959493929190613bb4565b60405180910390a150505050505050505050565b611fa06127f9565b73ffffffffffffffffffffffffffffffffffffffff16611fbe611826565b73ffffffffffffffffffffffffffffffffffffffff1614612014576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200b90613ea2565b60405180910390fd5b61203e7fa029d34f4788cf44bc1a02ff78e93b02dd18e538043436a28f4c96606b8b50ca82610fd3565b50565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600f8060000154908060010154908060020154905083565b6000801b81565b6120d3611256565b15612113576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210a90613e62565b60405180910390fd5b61211d3382610a61565b50565b6121286127f9565b73ffffffffffffffffffffffffffffffffffffffff16612146611826565b73ffffffffffffffffffffffffffffffffffffffff161461219c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219390613ea2565b60405180910390fd5b81601260000181905550806012600101819055505050565b60196020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060010154908060020154908060030154905086565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6122456127f9565b73ffffffffffffffffffffffffffffffffffffffff16612263611826565b73ffffffffffffffffffffffffffffffffffffffff16146122b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b090613ea2565b60405180910390fd5b81601760000181905550806017600101819055505050565b60158060000154908060010154905082565b6122eb6127f9565b73ffffffffffffffffffffffffffffffffffffffff16612309611826565b73ffffffffffffffffffffffffffffffffffffffff161461235f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235690613ea2565b60405180910390fd5b6123897fa029d34f4788cf44bc1a02ff78e93b02dd18e538043436a28f4c96606b8b50ca8261238c565b50565b61239582610a35565b6123a6816123a16127f9565b6129ab565b6123b08383612b28565b505050565b6123bd611256565b156123fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f490613e62565b60405180910390fd5b612407338261184f565b50565b600b5481565b6124186127f9565b73ffffffffffffffffffffffffffffffffffffffff16612436611826565b73ffffffffffffffffffffffffffffffffffffffff161461248c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248390613ea2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613dc2565b60405180910390fd5b61250581612cab565b50565b600e5481565b601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661259d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259490613ec2565b60405180910390fd5b600b54601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541015612624576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261b90613de2565b60405180910390fd5b600c54601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff1660ff16106126ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b190613e82565b60405180910390fd5b6001601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff0219169083151502179055506001601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160028282829054906101000a900460ff166127749190614090565b92506101000a81548160ff021916908360ff16021790555050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b612884846323b872dd60e01b85858560405160240161282293929190613ad8565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e12565b50505050565b6000818473ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30866040518363ffffffff1660e01b81526004016128c8929190613aaf565b60206040518083038186803b1580156128e057600080fd5b505afa1580156128f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612918919061357a565b612922919061403a565b90506129a58463095ea7b360e01b8584604051602401612943929190613b0f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e12565b50505050565b6129b58282612041565b612a44576129da8173ffffffffffffffffffffffffffffffffffffffff166014612ed9565b6129e88360001c6020612ed9565b6040516020016129f9929190613a5a565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3b9190613d40565b60405180910390fd5b5050565b612a528282612041565b612b2457600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612ac96127f9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b612b328282612041565b15612c065760006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612bab6127f9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b612c12611256565b612c51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c4890613d82565b60405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612c946127f9565b604051612ca19190613a94565b60405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612d77611256565b15612db7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dae90613e62565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612dfb6127f9565b604051612e089190613a94565b60405180910390a1565b6000612e74826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166131d39092919063ffffffff16565b9050600081511115612ed45780806020019051810190612e949190613471565b612ed3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eca90613f42565b60405180910390fd5b5b505050565b606060006002836002612eec91906140f8565b612ef6919061403a565b67ffffffffffffffff811115612f35577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612f675781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612fc5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061304f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261308f91906140f8565b613099919061403a565b90505b6001811115613185577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110613101577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b82828151811061313e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061317e9061432e565b905061309c565b50600084146131c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c090613d62565b60405180910390fd5b8091505092915050565b60606131e284846000856131eb565b90509392505050565b606082471015613230576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161322790613e42565b60405180910390fd5b613239856132ff565b613278576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161326f90613f22565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516132a19190613a43565b60006040518083038185875af1925050503d80600081146132de576040519150601f19603f3d011682016040523d82523d6000602084013e6132e3565b606091505b50915091506132f3828286613312565b92505050949350505050565b600080823b905060008111915050919050565b6060831561332257829050613372565b6000835111156133355782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133699190613d40565b60405180910390fd5b9392505050565b60008135905061338881614802565b92915050565b60008151905061339d81614819565b92915050565b6000813590506133b281614830565b92915050565b6000813590506133c781614847565b92915050565b6000815190506133dc8161485e565b92915050565b6000813590506133f181614875565b92915050565b60008151905061340681614875565b92915050565b60006020828403121561341e57600080fd5b600061342c84828501613379565b91505092915050565b6000806040838503121561344857600080fd5b600061345685828601613379565b9250506020613467858286016133e2565b9150509250929050565b60006020828403121561348357600080fd5b60006134918482850161338e565b91505092915050565b6000602082840312156134ac57600080fd5b60006134ba848285016133a3565b91505092915050565b600080604083850312156134d657600080fd5b60006134e4858286016133a3565b92505060206134f585828601613379565b9150509250929050565b60006020828403121561351157600080fd5b600061351f848285016133b8565b91505092915050565b60006020828403121561353a57600080fd5b6000613548848285016133cd565b91505092915050565b60006020828403121561356357600080fd5b6000613571848285016133e2565b91505092915050565b60006020828403121561358c57600080fd5b600061359a848285016133f7565b91505092915050565b600080604083850312156135b657600080fd5b60006135c4858286016133e2565b92505060206135d5858286016133e2565b9150509250929050565b600080604083850312156135f257600080fd5b6000613600858286016133f7565b9250506020613611858286016133f7565b9150509250929050565b60008060006060848603121561363057600080fd5b600061363e868287016133e2565b935050602061364f868287016133e2565b9250506040613660868287016133e2565b9150509250925092565b61367381614186565b82525050565b61368281614198565b82525050565b613691816141a4565b82525050565b60006136a282613ffd565b6136ac8185614013565b93506136bc8185602086016142fb565b80840191505092915050565b6136d181614223565b82525050565b6136e081614247565b82525050565b6136ef8161426b565b82525050565b6136fe8161428f565b82525050565b61370d816142b3565b82525050565b61371c816142d7565b82525050565b600061372d82614008565b613737818561401e565b93506137478185602086016142fb565b613750816143b6565b840191505092915050565b600061376682614008565b613770818561402f565b93506137808185602086016142fb565b80840191505092915050565b600061379960208361401e565b91506137a4826143c7565b602082019050919050565b60006137bc60148361401e565b91506137c7826143f0565b602082019050919050565b60006137df601f8361401e565b91506137ea82614419565b602082019050919050565b600061380260268361401e565b915061380d82614442565b604082019050919050565b600061382560388361401e565b915061383082614491565b604082019050919050565b600061384860188361401e565b9150613853826144e0565b602082019050919050565b600061386b604b8361401e565b915061387682614509565b606082019050919050565b600061388e60268361401e565b91506138998261457e565b604082019050919050565b60006138b160108361401e565b91506138bc826145cd565b602082019050919050565b60006138d460208361401e565b91506138df826145f6565b602082019050919050565b60006138f760208361401e565b91506139028261461f565b602082019050919050565b600061391a60258361401e565b915061392582614648565b604082019050919050565b600061393d60178361401e565b915061394882614697565b602082019050919050565b600061396060128361401e565b915061396b826146c0565b602082019050919050565b6000613983601d8361401e565b915061398e826146e9565b602082019050919050565b60006139a660178361402f565b91506139b182614712565b601782019050919050565b60006139c9602a8361401e565b91506139d48261473b565b604082019050919050565b60006139ec60118361402f565b91506139f78261478a565b601182019050919050565b6000613a0f602f8361401e565b9150613a1a826147b3565b604082019050919050565b613a2e8161420c565b82525050565b613a3d81614216565b82525050565b6000613a4f8284613697565b915081905092915050565b6000613a6582613999565b9150613a71828561375b565b9150613a7c826139df565b9150613a88828461375b565b91508190509392505050565b6000602082019050613aa9600083018461366a565b92915050565b6000604082019050613ac4600083018561366a565b613ad1602083018461366a565b9392505050565b6000606082019050613aed600083018661366a565b613afa602083018561366a565b613b076040830184613a25565b949350505050565b6000604082019050613b24600083018561366a565b613b316020830184613a25565b9392505050565b6000606082019050613b4d600083018661366a565b613b5a6020830185613a25565b613b676040830184613a25565b949350505050565b6000608082019050613b84600083018761366a565b613b916020830186613a25565b613b9e6040830185613a25565b613bab6060830184613a25565b95945050505050565b600060a082019050613bc9600083018861366a565b613bd66020830187613a25565b613be36040830186613a25565b613bf06060830185613a25565b613bfd6080830184613a25565b9695505050505050565b6000602082019050613c1c6000830184613679565b92915050565b600060c082019050613c376000830189613679565b613c446020830188613679565b613c516040830187613a34565b613c5e6060830186613a25565b613c6b6080830185613a25565b613c7860a0830184613a25565b979650505050505050565b6000602082019050613c986000830184613688565b92915050565b6000602082019050613cb360008301846136c8565b92915050565b6000602082019050613cce60008301846136d7565b92915050565b6000602082019050613ce960008301846136e6565b92915050565b6000602082019050613d0460008301846136f5565b92915050565b6000602082019050613d1f6000830184613704565b92915050565b6000602082019050613d3a6000830184613713565b92915050565b60006020820190508181036000830152613d5a8184613722565b905092915050565b60006020820190508181036000830152613d7b8161378c565b9050919050565b60006020820190508181036000830152613d9b816137af565b9050919050565b60006020820190508181036000830152613dbb816137d2565b9050919050565b60006020820190508181036000830152613ddb816137f5565b9050919050565b60006020820190508181036000830152613dfb81613818565b9050919050565b60006020820190508181036000830152613e1b8161383b565b9050919050565b60006020820190508181036000830152613e3b8161385e565b9050919050565b60006020820190508181036000830152613e5b81613881565b9050919050565b60006020820190508181036000830152613e7b816138a4565b9050919050565b60006020820190508181036000830152613e9b816138c7565b9050919050565b60006020820190508181036000830152613ebb816138ea565b9050919050565b60006020820190508181036000830152613edb8161390d565b9050919050565b60006020820190508181036000830152613efb81613930565b9050919050565b60006020820190508181036000830152613f1b81613953565b9050919050565b60006020820190508181036000830152613f3b81613976565b9050919050565b60006020820190508181036000830152613f5b816139bc565b9050919050565b60006020820190508181036000830152613f7b81613a02565b9050919050565b6000602082019050613f976000830184613a25565b92915050565b6000604082019050613fb26000830185613a25565b613fbf6020830184613a25565b9392505050565b6000606082019050613fdb6000830186613a25565b613fe86020830185613a25565b613ff56040830184613a25565b949350505050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006140458261420c565b91506140508361420c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561408557614084614358565b5b828201905092915050565b600061409b82614216565b91506140a683614216565b92508260ff038211156140bc576140bb614358565b5b828201905092915050565b60006140d28261420c565b91506140dd8361420c565b9250826140ed576140ec614387565b5b828204905092915050565b60006141038261420c565b915061410e8361420c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561414757614146614358565b5b828202905092915050565b600061415d8261420c565b91506141688361420c565b92508282101561417b5761417a614358565b5b828203905092915050565b6000614191826141ec565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006141e582614186565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061422e82614235565b9050919050565b6000614240826141ec565b9050919050565b600061425282614259565b9050919050565b6000614264826141ec565b9050919050565b60006142768261427d565b9050919050565b6000614288826141ec565b9050919050565b600061429a826142a1565b9050919050565b60006142ac826141ec565b9050919050565b60006142be826142c5565b9050919050565b60006142d0826141ec565b9050919050565b60006142e2826142e9565b9050919050565b60006142f4826141ec565b9050919050565b60005b838110156143195780820151818401526020810190506142fe565b83811115614328576000848401525b50505050565b60006143398261420c565b9150600082141561434d5761434c614358565b5b600182039050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f43616c6c65722063616e6e6f7420616464207665726966696564207573657200600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4e65656420746f20736163726966696365206d6f72652066726178206265666f60008201527f726520796f752063616e20696e76697465206f74686572730000000000000000602082015250565b7f4164647265737320616c72656164792076657269666965640000000000000000600082015250565b7f4f6e6c792076657269666965642074656d706c61727320616e6420746865697260008201527f206775657374732063616e2070617274616b6520696e20746865206f70656e6960208201527f6e6720636572656d6f6e79000000000000000000000000000000000000000000604082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f457863656564206d6178696d756d206e756d626572206f6620696e7669746573600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f6f6e6c792076657269666965642075736572732063616e20696e76697465206760008201527f7565737473000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565646564206d6178206d696e74206c696d6974000000000000000000600082015250565b7f6578636565646564206d6178206c696d69740000000000000000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b61480b81614186565b811461481657600080fd5b50565b61482281614198565b811461482d57600080fd5b50565b614839816141a4565b811461484457600080fd5b50565b614850816141ae565b811461485b57600080fd5b50565b614867816141da565b811461487257600080fd5b50565b61487e8161420c565b811461488957600080fd5b5056fea2646970667358221220e2a3cd142cd639989a867ea5b61ee6e3fa20cfbadca27eac888b6dc411823e3164736f6c63430008040033000000000000000000000000853d955acef822db058eb8505911ed77f175b99e000000000000000000000000470ebf5f030ed85fc1ed4c2d36b9dd02e77cf1b70000000000000000000000004d14b24edb751221b3ff08bbb8bd91d4b1c8bc77000000000000000000000000879b843868da248b1f2f53b4f8cc6e17e7e8b94900000000000000000000000022c2fe05f55f81bf32310acd9a7c51c4d7b4e443000000000000000000000000b18f07b22845df936310b63bdd04ce0e28e78c6f00000000000000000000000000000000000000000000010f0cf064dd5920000000000000000000000000000000000000000000000000065a4da25d3016c000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000002b8cb00000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000001c70700000000000000000000000000000000000000000000000000000000000f4240

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102d55760003560e01c80637f7928fc11610182578063a694fc3a116100e9578063ca2dfd0a116100a2578063f0e70cfd1161007c578063f0e70cfd14610841578063f2fde38b1461085f578063fbaf894c1461087b578063fd13375714610899576102d5565b8063ca2dfd0a146107ed578063d547741f14610809578063d960b37a14610825576102d5565b8063a694fc3a14610727578063a6b759a214610743578063a87430ba1461075f578063b1a9069c14610794578063ba568618146107b2578063c34e12c3146107ce576102d5565b80638da5cb5b1161013b5780638da5cb5b146106635780638e7e49c7146106815780639000b3d61461069d57806391d14854146106b95780639d5ff115146106e9578063a217fddf14610709576102d5565b80637f7928fc146105b55780637fb08ebd146105d35780638456cb59146105f157806388e3c5d6146105fb5780638abf1bfb146106175780638b79c36214610633576102d5565b80632f2ff15d11610241578063539e0601116101fa57806361d027b3116101d457806361d027b3146105555780636ab02b15146105735780636cadc3b51461058f578063715018a6146105ab576102d5565b8063539e0601146104ff5780635c975abb1461051b5780636115df5714610539576102d5565b80632f2ff15d1461046557806336568abe14610481578063376203461461049d5780633f4ba83a146104b9578063431a04be146104c35780634cf088d9146104e1576102d5565b80631e25252f116102935780631e25252f146103a157806322e6b6ac146103bf578063248a9ca3146103dd57806326d17b3c1461040d5780632a7684651461042b5780632ee4090814610449576102d5565b80623c2893146102da57806301ffc9a7146102fa5780630549425d1461032a5780630d71155614610349578063140ad597146103655780631da981f314610383575b600080fd5b6102e26108b5565b6040516102f193929190613fc6565b60405180910390f35b610314600480360381019061030f91906134ff565b6108cd565b6040516103219190613c07565b60405180910390f35b610332610947565b604051610340929190613f9d565b60405180910390f35b610363600480360381019061035e9190613551565b610959565b005b61036d6109df565b60405161037a9190613c9e565b60405180910390f35b61038b610a05565b6040516103989190613f82565b60405180910390f35b6103a9610a0b565b6040516103b69190613c83565b60405180910390f35b6103c7610a2f565b6040516103d49190613f82565b60405180910390f35b6103f760048036038101906103f2919061349a565b610a35565b6040516104049190613c83565b60405180910390f35b610415610a55565b6040516104229190613f82565b60405180910390f35b610433610a5b565b6040516104409190613f82565b60405180910390f35b610463600480360381019061045e9190613435565b610a61565b005b61047f600480360381019061047a91906134c3565b610fd3565b005b61049b600480360381019061049691906134c3565b610ffc565b005b6104b760048036038101906104b2919061361b565b61107f565b005b6104c161111e565b005b6104cb6111a4565b6040516104d89190613f82565b60405180910390f35b6104e96111aa565b6040516104f69190613cef565b60405180910390f35b61051960048036038101906105149190613551565b6111d0565b005b610523611256565b6040516105309190613c07565b60405180910390f35b610553600480360381019061054e9190613551565b61126c565b005b61055d6112f2565b60405161056a9190613d0a565b60405180910390f35b61058d60048036038101906105889190613551565b611318565b005b6105a960048036038101906105a49190613551565b61139e565b005b6105b3611424565b005b6105bd6114ac565b6040516105ca9190613d25565b60405180910390f35b6105db6114d2565b6040516105e89190613cb9565b60405180910390f35b6105f96114f8565b005b6106156004803603810190610610919061340c565b61157e565b005b610631600480360381019061062c91906135a3565b611755565b005b61064d60048036038101906106489190613551565b6117e9565b60405161065a9190613f82565b60405180910390f35b61066b611826565b6040516106789190613a94565b60405180910390f35b61069b60048036038101906106969190613435565b61184f565b005b6106b760048036038101906106b2919061340c565b611f98565b005b6106d360048036038101906106ce91906134c3565b612041565b6040516106e09190613c07565b60405180910390f35b6106f16120ac565b60405161070093929190613fc6565b60405180910390f35b6107116120c4565b60405161071e9190613c83565b60405180910390f35b610741600480360381019061073c9190613551565b6120cb565b005b61075d600480360381019061075891906135a3565b612120565b005b6107796004803603810190610774919061340c565b6121b4565b60405161078b96959493929190613c22565b60405180910390f35b61079c612217565b6040516107a99190613cd4565b60405180910390f35b6107cc60048036038101906107c791906135a3565b61223d565b005b6107d66122d1565b6040516107e4929190613f9d565b60405180910390f35b6108076004803603810190610802919061340c565b6122e3565b005b610823600480360381019061081e91906134c3565b61238c565b005b61083f600480360381019061083a9190613551565b6123b5565b005b61084961240a565b6040516108569190613f82565b60405180910390f35b6108796004803603810190610874919061340c565b612410565b005b610883612508565b6040516108909190613f82565b60405180910390f35b6108b360048036038101906108ae919061340c565b61250e565b005b60128060000154908060010154908060020154905083565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610940575061093f8261278f565b5b9050919050565b60178060000154908060010154905082565b6109616127f9565b73ffffffffffffffffffffffffffffffffffffffff1661097f611826565b73ffffffffffffffffffffffffffffffffffffffff16146109d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cc90613ea2565b60405180910390fd5b80600c8190555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b7fa029d34f4788cf44bc1a02ff78e93b02dd18e538043436a28f4c96606b8b50ca81565b600a5481565b600060016000838152602001908152602001600020600101549050919050565b60085481565b60095481565b610a69611256565b15610aa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa090613e62565b60405180910390fd5b6000601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900460ff1615610b6557601260010154838360030154610b1b919061403a565b1115610b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5390613f02565b60405180910390fd5b60159050610c18565b8160000160019054906101000a900460ff1615610bdc57601260000154838360030154610b92919061403a565b1115610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca90613f02565b60405180910390fd5b60179050610c17565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0e90613e22565b60405180910390fd5b5b60008160010154826000015485610c2f91906140f8565b610c3991906140c7565b905060008185610c49919061403a565b905084846003016000828254610c5f919061403a565b92505081905550610c94600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333088612801565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930846040518363ffffffff1660e01b8152600401610cf1929190613b0f565b600060405180830381600087803b158015610d0b57600080fd5b505af1158015610d1f573d6000803e3d6000fd5b50505050610d72600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361288a565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a694fc3a836040518263ffffffff1660e01b8152600401610dcf9190613f82565b602060405180830381600087803b158015610de957600080fd5b505af1158015610dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e21919061357a565b9050610eef600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f1284aa6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e8e57600080fd5b505afa158015610ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec69190613528565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361288a565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166383e25f8a888360085442610f3d919061403a565b6040518463ffffffff1660e01b8152600401610f5b93929190613b38565b600060405180830381600087803b158015610f7557600080fd5b505af1158015610f89573d6000803e3d6000fd5b505050507fd4a763821562d86aa6afe069e28523f46ec6a9dc0ff3f71fb6dfde6b6969b95c87878584604051610fc29493929190613b6f565b60405180910390a150505050505050565b610fdc82610a35565b610fed81610fe86127f9565b6129ab565b610ff78383612a48565b505050565b6110046127f9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611071576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106890613f62565b60405180910390fd5b61107b8282612b28565b5050565b6110876127f9565b73ffffffffffffffffffffffffffffffffffffffff166110a5611826565b73ffffffffffffffffffffffffffffffffffffffff16146110fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f290613ea2565b60405180910390fd5b82600f6000018190555081600f6001018190555080600f60020181905550505050565b6111266127f9565b73ffffffffffffffffffffffffffffffffffffffff16611144611826565b73ffffffffffffffffffffffffffffffffffffffff161461119a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119190613ea2565b60405180910390fd5b6111a2612c0a565b565b600d5481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6111d86127f9565b73ffffffffffffffffffffffffffffffffffffffff166111f6611826565b73ffffffffffffffffffffffffffffffffffffffff161461124c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124390613ea2565b60405180910390fd5b80600b8190555050565b60008060149054906101000a900460ff16905090565b6112746127f9565b73ffffffffffffffffffffffffffffffffffffffff16611292611826565b73ffffffffffffffffffffffffffffffffffffffff16146112e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112df90613ea2565b60405180910390fd5b8060088190555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6113206127f9565b73ffffffffffffffffffffffffffffffffffffffff1661133e611826565b73ffffffffffffffffffffffffffffffffffffffff1614611394576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138b90613ea2565b60405180910390fd5b80600a8190555050565b6113a66127f9565b73ffffffffffffffffffffffffffffffffffffffff166113c4611826565b73ffffffffffffffffffffffffffffffffffffffff161461141a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141190613ea2565b60405180910390fd5b8060098190555050565b61142c6127f9565b73ffffffffffffffffffffffffffffffffffffffff1661144a611826565b73ffffffffffffffffffffffffffffffffffffffff16146114a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149790613ea2565b60405180910390fd5b6114aa6000612cab565b565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6115006127f9565b73ffffffffffffffffffffffffffffffffffffffff1661151e611826565b73ffffffffffffffffffffffffffffffffffffffff1614611574576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156b90613ea2565b60405180910390fd5b61157c612d6f565b565b6115a87fa029d34f4788cf44bc1a02ff78e93b02dd18e538043436a28f4c96606b8b50ca33612041565b6115e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115de90613da2565b60405180910390fd5b601960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166e90613e02565b60405180910390fd5b6001601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff021916908315150217905550600d54601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507f02c0b9f20e7b24373a1da46d3894a3248fbb0d84eb8e1ac6384f7373f6e1e5638160405161174a9190613a94565b60405180910390a150565b61175d6127f9565b73ffffffffffffffffffffffffffffffffffffffff1661177b611826565b73ffffffffffffffffffffffffffffffffffffffff16146117d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c890613ea2565b60405180910390fd5b81601560000181905550806015600101819055505050565b600081600d54600f600201546117ff91906140f8565b61180991906140c7565b9050600f6001015481111561182157600f6001015490505b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611857611256565b15611897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188e90613e62565b60405180910390fd5b6000601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905062015180600e54426118ec9190614152565b1115611929576002600d600082825461190591906140f8565b9250508190555062015180600e6000828254611921919061403a565b925050819055505b60008160000160009054906101000a900460ff16156119a95761194f82600101546117e9565b83836002015461195f919061403a565b11156119a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199790613ee2565b60405180910390fd5b60159050611a5c565b8160000160019054906101000a900460ff1615611a2057600f600001548383600201546119d6919061403a565b1115611a17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0e90613ee2565b60405180910390fd5b60179050611a5b565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5290613e22565b60405180910390fd5b5b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a340bae26040518163ffffffff1660e01b8152600401604080518083038186803b158015611ac657600080fd5b505afa158015611ada573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611afe91906135df565b915091506000600954838388611b1491906140f8565b611b1e91906140c7565b611b2891906140c7565b905060008460010154856000015483611b4191906140f8565b611b4b91906140c7565b905060008183611b5b919061403a565b905087876002016000828254611b71919061403a565b92505081905550611bc8600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b612801565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401611c25929190613b0f565b600060405180830381600087803b158015611c3f57600080fd5b505af1158015611c53573d6000803e3d6000fd5b50505050611ca6600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361288a565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a694fc3a836040518263ffffffff1660e01b8152600401611d039190613f82565b602060405180830381600087803b158015611d1d57600080fd5b505af1158015611d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d55919061357a565b9050611e23600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f1284aa6040518163ffffffff1660e01b815260040160206040518083038186803b158015611dc257600080fd5b505afa158015611dd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfa9190613528565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361288a565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166383e25f8a8b8360085442611e71919061403a565b6040518463ffffffff1660e01b8152600401611e8f93929190613b38565b600060405180830381600087803b158015611ea957600080fd5b505af1158015611ebd573d6000803e3d6000fd5b50505050600a548910611f4d57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634641257d6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611f3457600080fd5b505af1158015611f48573d6000803e3d6000fd5b505050505b7f9226b4bb47b02397020e6c6a368862e43950e7c8d8fc84390481d8f6255a2faf8a8a868685604051611f84959493929190613bb4565b60405180910390a150505050505050505050565b611fa06127f9565b73ffffffffffffffffffffffffffffffffffffffff16611fbe611826565b73ffffffffffffffffffffffffffffffffffffffff1614612014576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200b90613ea2565b60405180910390fd5b61203e7fa029d34f4788cf44bc1a02ff78e93b02dd18e538043436a28f4c96606b8b50ca82610fd3565b50565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600f8060000154908060010154908060020154905083565b6000801b81565b6120d3611256565b15612113576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210a90613e62565b60405180910390fd5b61211d3382610a61565b50565b6121286127f9565b73ffffffffffffffffffffffffffffffffffffffff16612146611826565b73ffffffffffffffffffffffffffffffffffffffff161461219c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219390613ea2565b60405180910390fd5b81601260000181905550806012600101819055505050565b60196020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060010154908060020154908060030154905086565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6122456127f9565b73ffffffffffffffffffffffffffffffffffffffff16612263611826565b73ffffffffffffffffffffffffffffffffffffffff16146122b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b090613ea2565b60405180910390fd5b81601760000181905550806017600101819055505050565b60158060000154908060010154905082565b6122eb6127f9565b73ffffffffffffffffffffffffffffffffffffffff16612309611826565b73ffffffffffffffffffffffffffffffffffffffff161461235f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235690613ea2565b60405180910390fd5b6123897fa029d34f4788cf44bc1a02ff78e93b02dd18e538043436a28f4c96606b8b50ca8261238c565b50565b61239582610a35565b6123a6816123a16127f9565b6129ab565b6123b08383612b28565b505050565b6123bd611256565b156123fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f490613e62565b60405180910390fd5b612407338261184f565b50565b600b5481565b6124186127f9565b73ffffffffffffffffffffffffffffffffffffffff16612436611826565b73ffffffffffffffffffffffffffffffffffffffff161461248c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248390613ea2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613dc2565b60405180910390fd5b61250581612cab565b50565b600e5481565b601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661259d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259490613ec2565b60405180910390fd5b600b54601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541015612624576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261b90613de2565b60405180910390fd5b600c54601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff1660ff16106126ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b190613e82565b60405180910390fd5b6001601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff0219169083151502179055506001601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160028282829054906101000a900460ff166127749190614090565b92506101000a81548160ff021916908360ff16021790555050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b612884846323b872dd60e01b85858560405160240161282293929190613ad8565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e12565b50505050565b6000818473ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30866040518363ffffffff1660e01b81526004016128c8929190613aaf565b60206040518083038186803b1580156128e057600080fd5b505afa1580156128f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612918919061357a565b612922919061403a565b90506129a58463095ea7b360e01b8584604051602401612943929190613b0f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e12565b50505050565b6129b58282612041565b612a44576129da8173ffffffffffffffffffffffffffffffffffffffff166014612ed9565b6129e88360001c6020612ed9565b6040516020016129f9929190613a5a565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3b9190613d40565b60405180910390fd5b5050565b612a528282612041565b612b2457600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612ac96127f9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b612b328282612041565b15612c065760006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612bab6127f9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b612c12611256565b612c51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c4890613d82565b60405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612c946127f9565b604051612ca19190613a94565b60405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612d77611256565b15612db7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dae90613e62565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612dfb6127f9565b604051612e089190613a94565b60405180910390a1565b6000612e74826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166131d39092919063ffffffff16565b9050600081511115612ed45780806020019051810190612e949190613471565b612ed3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eca90613f42565b60405180910390fd5b5b505050565b606060006002836002612eec91906140f8565b612ef6919061403a565b67ffffffffffffffff811115612f35577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612f675781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612fc5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061304f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261308f91906140f8565b613099919061403a565b90505b6001811115613185577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110613101577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b82828151811061313e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061317e9061432e565b905061309c565b50600084146131c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c090613d62565b60405180910390fd5b8091505092915050565b60606131e284846000856131eb565b90509392505050565b606082471015613230576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161322790613e42565b60405180910390fd5b613239856132ff565b613278576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161326f90613f22565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516132a19190613a43565b60006040518083038185875af1925050503d80600081146132de576040519150601f19603f3d011682016040523d82523d6000602084013e6132e3565b606091505b50915091506132f3828286613312565b92505050949350505050565b600080823b905060008111915050919050565b6060831561332257829050613372565b6000835111156133355782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133699190613d40565b60405180910390fd5b9392505050565b60008135905061338881614802565b92915050565b60008151905061339d81614819565b92915050565b6000813590506133b281614830565b92915050565b6000813590506133c781614847565b92915050565b6000815190506133dc8161485e565b92915050565b6000813590506133f181614875565b92915050565b60008151905061340681614875565b92915050565b60006020828403121561341e57600080fd5b600061342c84828501613379565b91505092915050565b6000806040838503121561344857600080fd5b600061345685828601613379565b9250506020613467858286016133e2565b9150509250929050565b60006020828403121561348357600080fd5b60006134918482850161338e565b91505092915050565b6000602082840312156134ac57600080fd5b60006134ba848285016133a3565b91505092915050565b600080604083850312156134d657600080fd5b60006134e4858286016133a3565b92505060206134f585828601613379565b9150509250929050565b60006020828403121561351157600080fd5b600061351f848285016133b8565b91505092915050565b60006020828403121561353a57600080fd5b6000613548848285016133cd565b91505092915050565b60006020828403121561356357600080fd5b6000613571848285016133e2565b91505092915050565b60006020828403121561358c57600080fd5b600061359a848285016133f7565b91505092915050565b600080604083850312156135b657600080fd5b60006135c4858286016133e2565b92505060206135d5858286016133e2565b9150509250929050565b600080604083850312156135f257600080fd5b6000613600858286016133f7565b9250506020613611858286016133f7565b9150509250929050565b60008060006060848603121561363057600080fd5b600061363e868287016133e2565b935050602061364f868287016133e2565b9250506040613660868287016133e2565b9150509250925092565b61367381614186565b82525050565b61368281614198565b82525050565b613691816141a4565b82525050565b60006136a282613ffd565b6136ac8185614013565b93506136bc8185602086016142fb565b80840191505092915050565b6136d181614223565b82525050565b6136e081614247565b82525050565b6136ef8161426b565b82525050565b6136fe8161428f565b82525050565b61370d816142b3565b82525050565b61371c816142d7565b82525050565b600061372d82614008565b613737818561401e565b93506137478185602086016142fb565b613750816143b6565b840191505092915050565b600061376682614008565b613770818561402f565b93506137808185602086016142fb565b80840191505092915050565b600061379960208361401e565b91506137a4826143c7565b602082019050919050565b60006137bc60148361401e565b91506137c7826143f0565b602082019050919050565b60006137df601f8361401e565b91506137ea82614419565b602082019050919050565b600061380260268361401e565b915061380d82614442565b604082019050919050565b600061382560388361401e565b915061383082614491565b604082019050919050565b600061384860188361401e565b9150613853826144e0565b602082019050919050565b600061386b604b8361401e565b915061387682614509565b606082019050919050565b600061388e60268361401e565b91506138998261457e565b604082019050919050565b60006138b160108361401e565b91506138bc826145cd565b602082019050919050565b60006138d460208361401e565b91506138df826145f6565b602082019050919050565b60006138f760208361401e565b91506139028261461f565b602082019050919050565b600061391a60258361401e565b915061392582614648565b604082019050919050565b600061393d60178361401e565b915061394882614697565b602082019050919050565b600061396060128361401e565b915061396b826146c0565b602082019050919050565b6000613983601d8361401e565b915061398e826146e9565b602082019050919050565b60006139a660178361402f565b91506139b182614712565b601782019050919050565b60006139c9602a8361401e565b91506139d48261473b565b604082019050919050565b60006139ec60118361402f565b91506139f78261478a565b601182019050919050565b6000613a0f602f8361401e565b9150613a1a826147b3565b604082019050919050565b613a2e8161420c565b82525050565b613a3d81614216565b82525050565b6000613a4f8284613697565b915081905092915050565b6000613a6582613999565b9150613a71828561375b565b9150613a7c826139df565b9150613a88828461375b565b91508190509392505050565b6000602082019050613aa9600083018461366a565b92915050565b6000604082019050613ac4600083018561366a565b613ad1602083018461366a565b9392505050565b6000606082019050613aed600083018661366a565b613afa602083018561366a565b613b076040830184613a25565b949350505050565b6000604082019050613b24600083018561366a565b613b316020830184613a25565b9392505050565b6000606082019050613b4d600083018661366a565b613b5a6020830185613a25565b613b676040830184613a25565b949350505050565b6000608082019050613b84600083018761366a565b613b916020830186613a25565b613b9e6040830185613a25565b613bab6060830184613a25565b95945050505050565b600060a082019050613bc9600083018861366a565b613bd66020830187613a25565b613be36040830186613a25565b613bf06060830185613a25565b613bfd6080830184613a25565b9695505050505050565b6000602082019050613c1c6000830184613679565b92915050565b600060c082019050613c376000830189613679565b613c446020830188613679565b613c516040830187613a34565b613c5e6060830186613a25565b613c6b6080830185613a25565b613c7860a0830184613a25565b979650505050505050565b6000602082019050613c986000830184613688565b92915050565b6000602082019050613cb360008301846136c8565b92915050565b6000602082019050613cce60008301846136d7565b92915050565b6000602082019050613ce960008301846136e6565b92915050565b6000602082019050613d0460008301846136f5565b92915050565b6000602082019050613d1f6000830184613704565b92915050565b6000602082019050613d3a6000830184613713565b92915050565b60006020820190508181036000830152613d5a8184613722565b905092915050565b60006020820190508181036000830152613d7b8161378c565b9050919050565b60006020820190508181036000830152613d9b816137af565b9050919050565b60006020820190508181036000830152613dbb816137d2565b9050919050565b60006020820190508181036000830152613ddb816137f5565b9050919050565b60006020820190508181036000830152613dfb81613818565b9050919050565b60006020820190508181036000830152613e1b8161383b565b9050919050565b60006020820190508181036000830152613e3b8161385e565b9050919050565b60006020820190508181036000830152613e5b81613881565b9050919050565b60006020820190508181036000830152613e7b816138a4565b9050919050565b60006020820190508181036000830152613e9b816138c7565b9050919050565b60006020820190508181036000830152613ebb816138ea565b9050919050565b60006020820190508181036000830152613edb8161390d565b9050919050565b60006020820190508181036000830152613efb81613930565b9050919050565b60006020820190508181036000830152613f1b81613953565b9050919050565b60006020820190508181036000830152613f3b81613976565b9050919050565b60006020820190508181036000830152613f5b816139bc565b9050919050565b60006020820190508181036000830152613f7b81613a02565b9050919050565b6000602082019050613f976000830184613a25565b92915050565b6000604082019050613fb26000830185613a25565b613fbf6020830184613a25565b9392505050565b6000606082019050613fdb6000830186613a25565b613fe86020830185613a25565b613ff56040830184613a25565b949350505050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006140458261420c565b91506140508361420c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561408557614084614358565b5b828201905092915050565b600061409b82614216565b91506140a683614216565b92508260ff038211156140bc576140bb614358565b5b828201905092915050565b60006140d28261420c565b91506140dd8361420c565b9250826140ed576140ec614387565b5b828204905092915050565b60006141038261420c565b915061410e8361420c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561414757614146614358565b5b828202905092915050565b600061415d8261420c565b91506141688361420c565b92508282101561417b5761417a614358565b5b828203905092915050565b6000614191826141ec565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006141e582614186565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061422e82614235565b9050919050565b6000614240826141ec565b9050919050565b600061425282614259565b9050919050565b6000614264826141ec565b9050919050565b60006142768261427d565b9050919050565b6000614288826141ec565b9050919050565b600061429a826142a1565b9050919050565b60006142ac826141ec565b9050919050565b60006142be826142c5565b9050919050565b60006142d0826141ec565b9050919050565b60006142e2826142e9565b9050919050565b60006142f4826141ec565b9050919050565b60005b838110156143195780820151818401526020810190506142fe565b83811115614328576000848401525b50505050565b60006143398261420c565b9150600082141561434d5761434c614358565b5b600182039050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f43616c6c65722063616e6e6f7420616464207665726966696564207573657200600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4e65656420746f20736163726966696365206d6f72652066726178206265666f60008201527f726520796f752063616e20696e76697465206f74686572730000000000000000602082015250565b7f4164647265737320616c72656164792076657269666965640000000000000000600082015250565b7f4f6e6c792076657269666965642074656d706c61727320616e6420746865697260008201527f206775657374732063616e2070617274616b6520696e20746865206f70656e6960208201527f6e6720636572656d6f6e79000000000000000000000000000000000000000000604082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f457863656564206d6178696d756d206e756d626572206f6620696e7669746573600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f6f6e6c792076657269666965642075736572732063616e20696e76697465206760008201527f7565737473000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565646564206d6178206d696e74206c696d6974000000000000000000600082015250565b7f6578636565646564206d6178206c696d69740000000000000000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b61480b81614186565b811461481657600080fd5b50565b61482281614198565b811461482d57600080fd5b50565b614839816141a4565b811461484457600080fd5b50565b614850816141ae565b811461485b57600080fd5b50565b614867816141da565b811461487257600080fd5b50565b61487e8161420c565b811461488957600080fd5b5056fea2646970667358221220e2a3cd142cd639989a867ea5b61ee6e3fa20cfbadca27eac888b6dc411823e3164736f6c63430008040033

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

000000000000000000000000853d955acef822db058eb8505911ed77f175b99e000000000000000000000000470ebf5f030ed85fc1ed4c2d36b9dd02e77cf1b70000000000000000000000004d14b24edb751221b3ff08bbb8bd91d4b1c8bc77000000000000000000000000879b843868da248b1f2f53b4f8cc6e17e7e8b94900000000000000000000000022c2fe05f55f81bf32310acd9a7c51c4d7b4e443000000000000000000000000b18f07b22845df936310b63bdd04ce0e28e78c6f00000000000000000000000000000000000000000000010f0cf064dd5920000000000000000000000000000000000000000000000000065a4da25d3016c000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000002b8cb00000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000001c70700000000000000000000000000000000000000000000000000000000000f4240

-----Decoded View---------------
Arg [0] : _stablecToken (address): 0x853d955aCEf822Db058eb8505911ED77F175b99e
Arg [1] : _templeToken (address): 0x470EBf5f030Ed85Fc1ed4C2d36B9DD02e77CF1b7
Arg [2] : _staking (address): 0x4D14b24EDb751221B3Ff08BBB8bd91D4b1c8bc77
Arg [3] : _lockedOGTemple (address): 0x879B843868dA248B1F2F53b4f8CC6e17e7E8b949
Arg [4] : _treasury (address): 0x22c2fE05f55F81Bf32310acD9a7C51c4d7b4e443
Arg [5] : _treasuryManagement (address): 0xb18F07b22845dF936310B63bdD04ce0E28e78C6F
Arg [6] : _harvestThresholdStablec (uint256): 5000000000000000000000
Arg [7] : _inviteThresholdStablec (uint256): 30000000000000000000000
Arg [8] : _maxInvitesPerVerifiedUser (uint256): 2
Arg [9] : _verifiedBonusFactor (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [10] : _guestBonusFactor (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 000000000000000000000000853d955acef822db058eb8505911ed77f175b99e
Arg [1] : 000000000000000000000000470ebf5f030ed85fc1ed4c2d36b9dd02e77cf1b7
Arg [2] : 0000000000000000000000004d14b24edb751221b3ff08bbb8bd91d4b1c8bc77
Arg [3] : 000000000000000000000000879b843868da248b1f2f53b4f8cc6e17e7e8b949
Arg [4] : 00000000000000000000000022c2fe05f55f81bf32310acd9a7c51c4d7b4e443
Arg [5] : 000000000000000000000000b18f07b22845df936310b63bdd04ce0e28e78c6f
Arg [6] : 00000000000000000000000000000000000000000000010f0cf064dd59200000
Arg [7] : 00000000000000000000000000000000000000000000065a4da25d3016c00000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [9] : 000000000000000000000000000000000000000000000000000000000002b8cb
Arg [10] : 00000000000000000000000000000000000000000000000000000000000f4240
Arg [11] : 000000000000000000000000000000000000000000000000000000000001c707
Arg [12] : 00000000000000000000000000000000000000000000000000000000000f4240


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.