ETH Price: $2,418.41 (+0.57%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Batch Claim Rewa...211207192024-11-05 10:01:5912 hrs ago1730800919IN
Prisma Finance: Vault
0 ETH0.001219114.22989098
Batch Claim Rewa...211205792024-11-05 9:33:4712 hrs ago1730799227IN
Prisma Finance: Vault
0 ETH0.00148925.6183878
Batch Claim Rewa...211204572024-11-05 9:09:2312 hrs ago1730797763IN
Prisma Finance: Vault
0 ETH0.002013118.76481041
Batch Claim Rewa...211192592024-11-05 5:08:2316 hrs ago1730783303IN
Prisma Finance: Vault
0 ETH0.000933612.27235923
Batch Claim Rewa...211179482024-11-05 0:44:1121 hrs ago1730767451IN
Prisma Finance: Vault
0 ETH0.001039964.07124317
Batch Claim Rewa...211111942024-11-04 2:07:4743 hrs ago1730686067IN
Prisma Finance: Vault
0 ETH0.000864842.55687802
Batch Claim Rewa...211110792024-11-04 1:44:3544 hrs ago1730684675IN
Prisma Finance: Vault
0 ETH0.001284233.6997394
Batch Claim Rewa...211102972024-11-03 23:07:2346 hrs ago1730675243IN
Prisma Finance: Vault
0 ETH0.001920174.61876895
Batch Claim Rewa...211093972024-11-03 20:07:112 days ago1730664431IN
Prisma Finance: Vault
0 ETH0.001894474.62037362
Batch Claim Rewa...211056352024-11-03 7:31:352 days ago1730619095IN
Prisma Finance: Vault
0 ETH0.000758762.5230646
Batch Claim Rewa...211050132024-11-03 5:26:352 days ago1730611595IN
Prisma Finance: Vault
0 ETH0.001774914.15419791
Batch Claim Rewa...211035682024-11-03 0:35:232 days ago1730594123IN
Prisma Finance: Vault
0 ETH0.001339174.17094845
Batch Claim Rewa...211010032024-11-02 15:59:113 days ago1730563151IN
Prisma Finance: Vault
0 ETH0.0036199215.13910124
Batch Claim Rewa...211001052024-11-02 12:57:593 days ago1730552279IN
Prisma Finance: Vault
0 ETH0.002393256.16867202
Batch Claim Rewa...210990352024-11-02 9:22:113 days ago1730539331IN
Prisma Finance: Vault
0 ETH0.001286114
Batch Claim Rewa...210986222024-11-02 7:59:113 days ago1730534351IN
Prisma Finance: Vault
0 ETH0.002245484.30361322
Batch Claim Rewa...210984002024-11-02 7:14:233 days ago1730531663IN
Prisma Finance: Vault
0 ETH0.001720322.96854258
Batch Claim Rewa...210975612024-11-02 4:25:593 days ago1730521559IN
Prisma Finance: Vault
0 ETH0.000964592.97175192
Batch Claim Rewa...210974972024-11-02 4:12:593 days ago1730520779IN
Prisma Finance: Vault
0 ETH0.000847933.28388391
Batch Claim Rewa...210971802024-11-02 3:09:233 days ago1730516963IN
Prisma Finance: Vault
0 ETH0.001401333.45945936
Batch Claim Rewa...210900212024-11-01 3:11:234 days ago1730430683IN
Prisma Finance: Vault
0 ETH0.001594896.17673084
Batch Claim Rewa...210875192024-10-31 18:48:595 days ago1730400539IN
Prisma Finance: Vault
0 ETH0.0131508225.8
Batch Claim Rewa...210840982024-10-31 7:23:475 days ago1730359427IN
Prisma Finance: Vault
0 ETH0.003459957.62952475
Batch Claim Rewa...210817362024-10-30 23:28:115 days ago1730330891IN
Prisma Finance: Vault
0 ETH0.0020756910.03683261
Batch Claim Rewa...210790292024-10-30 14:24:596 days ago1730298299IN
Prisma Finance: Vault
0 ETH0.0121457326.33478526
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PrismaVault

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, MIT license
File 1 of 14 : Vault.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

import "SafeERC20.sol";
import "Address.sol";
import "PrismaOwnable.sol";
import "SystemStart.sol";
import "IPrismaToken.sol";
import "IEmissionSchedule.sol";
import "IIncentiveVoting.sol";
import "ITokenLocker.sol";
import "IBoostDelegate.sol";
import "IBoostCalculator.sol";

interface IEmissionReceiver {
    function notifyRegisteredId(uint256[] memory assignedIds) external returns (bool);
}

interface IRewards {
    function vaultClaimReward(address claimant, address receiver) external returns (uint256);

    function claimableReward(address account) external view returns (uint256);
}

/**
    @title Prisma Vault
    @notice The total supply of PRISMA is initially minted to this contract.
            The token balance held here can be considered "uncirculating". The
            vault gradually releases tokens to registered emissions receivers
            as determined by `EmissionSchedule` and `BoostCalculator`.
 */
contract PrismaVault is PrismaOwnable, SystemStart {
    using Address for address;
    using SafeERC20 for IERC20;

    IPrismaToken public immutable prismaToken;
    ITokenLocker public immutable locker;
    IIncentiveVoting public immutable voter;
    address public immutable deploymentManager;
    uint256 immutable lockToTokenRatio;

    IEmissionSchedule public emissionSchedule;
    IBoostCalculator public boostCalculator;

    // `prismaToken` balance within the treasury that is not yet allocated.
    // Starts as `prismaToken.totalSupply()` and decreases over time.
    uint128 public unallocatedTotal;
    // most recent week that `unallocatedTotal` was reduced by a call to
    // `emissionSchedule.getTotalWeeklyEmissions`
    uint64 public totalUpdateWeek;
    // number of weeks that PRISMA is locked for when transferred using
    // `transferAllocatedTokens`. updated weekly by the emission schedule.
    uint64 public lockWeeks;

    // id -> receiver data
    uint16[65535] public receiverUpdatedWeek;
    // id -> address of receiver
    // not bi-directional, one receiver can have multiple ids
    mapping(uint256 => Receiver) public idToReceiver;

    // week -> total amount of tokens to be released in that week
    uint128[65535] public weeklyEmissions;

    // receiver -> remaining tokens which have been allocated but not yet distributed
    mapping(address => uint256) public allocated;

    // account -> week -> PRISMA amount claimed in that week (used for calculating boost)
    mapping(address => uint128[65535]) accountWeeklyEarned;

    // pending rewards for an address (dust after locking, fees from delegation)
    mapping(address => uint256) private storedPendingReward;

    mapping(address => Delegation) public boostDelegation;

    struct Receiver {
        address account;
        bool isActive;
    }

    struct Delegation {
        bool isEnabled;
        uint16 feePct;
        IBoostDelegate callback;
    }

    struct InitialAllowance {
        address receiver;
        uint256 amount;
    }

    event NewReceiverRegistered(address receiver, uint256 id);
    event ReceiverIsActiveStatusModified(uint256 indexed id, bool isActive);
    event UnallocatedSupplyReduced(uint256 reducedAmount, uint256 unallocatedTotal);
    event UnallocatedSupplyIncreased(uint256 increasedAmount, uint256 unallocatedTotal);
    event IncreasedAllocation(address indexed receiver, uint256 increasedAmount);
    event EmissionScheduleSet(address emissionScheduler);
    event BoostCalculatorSet(address boostCalculator);
    event BoostDelegationSet(address indexed boostDelegate, bool isEnabled, uint256 feePct, address callback);

    constructor(
        address _prismaCore,
        IPrismaToken _token,
        ITokenLocker _locker,
        IIncentiveVoting _voter,
        address _stabilityPool,
        address _manager
    ) PrismaOwnable(_prismaCore) SystemStart(_prismaCore) {
        prismaToken = _token;
        locker = _locker;
        voter = _voter;
        lockToTokenRatio = _locker.lockToTokenRatio();
        deploymentManager = _manager;

        // ensure the stability pool is registered with receiver ID 0
        _voter.registerNewReceiver();
        idToReceiver[0] = Receiver({ account: _stabilityPool, isActive: true });
        emit NewReceiverRegistered(_stabilityPool, 0);
    }

    function setInitialParameters(
        IEmissionSchedule _emissionSchedule,
        IBoostCalculator _boostCalculator,
        uint256 totalSupply,
        uint64 initialLockWeeks,
        uint128[] memory _fixedInitialAmounts,
        InitialAllowance[] memory initialAllowances
    ) external {
        require(msg.sender == deploymentManager, "!deploymentManager");
        emissionSchedule = _emissionSchedule;
        boostCalculator = _boostCalculator;

        // mint totalSupply to vault - this reverts after the first call
        prismaToken.mintToVault(totalSupply);

        // set initial fixed weekly emissions
        uint256 totalAllocated;
        uint256 length = _fixedInitialAmounts.length;
        uint256 offset = getWeek() + 1;
        for (uint256 i = 0; i < length; i++) {
            uint128 amount = _fixedInitialAmounts[i];
            weeklyEmissions[i + offset] = amount;
            totalAllocated += amount;
        }

        // set initial transfer allowances for airdrops, vests, bribes
        length = initialAllowances.length;
        for (uint256 i = 0; i < length; i++) {
            uint256 amount = initialAllowances[i].amount;
            address receiver = initialAllowances[i].receiver;
            totalAllocated += amount;
            // initial allocations are given as approvals
            prismaToken.increaseAllowance(receiver, amount);
        }

        unallocatedTotal = uint128(totalSupply - totalAllocated);
        totalUpdateWeek = uint64(_fixedInitialAmounts.length + offset - 1);
        lockWeeks = initialLockWeeks;

        emit EmissionScheduleSet(address(_emissionSchedule));
        emit BoostCalculatorSet(address(_boostCalculator));
        emit UnallocatedSupplyReduced(totalAllocated, unallocatedTotal);
    }

    /**
        @notice Register a new emission receiver
        @dev Once this function is called, the receiver ID is immediately
             eligible for votes within `IncentiveVoting`
        @param receiver Address of the receiver
        @param count Number of IDs to assign to the receiver
     */
    function registerReceiver(address receiver, uint256 count) external onlyOwner returns (bool) {
        uint256[] memory assignedIds = new uint256[](count);
        uint16 week = uint16(getWeek());
        for (uint256 i = 0; i < count; i++) {
            uint256 id = voter.registerNewReceiver();
            assignedIds[i] = id;
            receiverUpdatedWeek[id] = week;
            idToReceiver[id] = Receiver({ account: receiver, isActive: true });
            emit NewReceiverRegistered(receiver, id);
        }
        // notify the receiver contract of the newly registered ID
        // also serves as a sanity check to ensure the contract is capable of receiving emissions
        IEmissionReceiver(receiver).notifyRegisteredId(assignedIds);

        return true;
    }

    /**
        @notice Modify the active status of an existing receiver
        @dev Emissions directed to an inactive receiver are instead returned to
             the unallocated supply. This way potential emissions are not lost
             due to old emissions votes pointing at a receiver that was phased out.
        @param id ID of the receiver to modify the isActive status for
        @param isActive is this receiver eligible to receive emissions?
     */
    function setReceiverIsActive(uint256 id, bool isActive) external onlyOwner returns (bool) {
        Receiver memory receiver = idToReceiver[id];
        require(receiver.account != address(0), "ID not set");
        receiver.isActive = isActive;
        idToReceiver[id] = receiver;
        emit ReceiverIsActiveStatusModified(id, isActive);

        return true;
    }

    /**
        @notice Set the `emissionSchedule` contract
        @dev Callable only by the owner (the DAO admin voter, to change the emission schedule).
             The new schedule is applied from the start of the next epoch.
     */
    function setEmissionSchedule(IEmissionSchedule _emissionSchedule) external onlyOwner returns (bool) {
        _allocateTotalWeekly(emissionSchedule, getWeek());
        emissionSchedule = _emissionSchedule;
        emit EmissionScheduleSet(address(_emissionSchedule));

        return true;
    }

    function setBoostCalculator(IBoostCalculator _boostCalculator) external onlyOwner returns (bool) {
        boostCalculator = _boostCalculator;
        emit BoostCalculatorSet(address(_boostCalculator));

        return true;
    }

    /**
        @notice Transfer tokens out of the vault
     */
    function transferTokens(IERC20 token, address receiver, uint256 amount) external onlyOwner returns (bool) {
        if (address(token) == address(prismaToken)) {
            require(receiver != address(this), "Self transfer denied");
            uint256 unallocated = unallocatedTotal - amount;
            unallocatedTotal = uint128(unallocated);
            emit UnallocatedSupplyReduced(amount, unallocated);
        }
        token.safeTransfer(receiver, amount);

        return true;
    }

    /**
        @notice Receive PRISMA tokens and add them to the unallocated supply
     */
    function increaseUnallocatedSupply(uint256 amount) external returns (bool) {
        prismaToken.transferFrom(msg.sender, address(this), amount);
        uint256 unallocated = unallocatedTotal + amount;
        unallocatedTotal = uint128(unallocated);
        emit UnallocatedSupplyIncreased(amount, unallocated);

        return true;
    }

    function _allocateTotalWeekly(IEmissionSchedule _emissionSchedule, uint256 currentWeek) internal {
        uint256 week = totalUpdateWeek;
        if (week >= currentWeek) return;

        if (address(_emissionSchedule) == address(0)) {
            totalUpdateWeek = uint64(currentWeek);
            return;
        }

        uint256 lock;
        uint256 weeklyAmount;
        uint256 unallocated = unallocatedTotal;
        while (week < currentWeek) {
            ++week;
            (weeklyAmount, lock) = _emissionSchedule.getTotalWeeklyEmissions(week, unallocated);
            weeklyEmissions[week] = uint128(weeklyAmount);

            unallocated = unallocated - weeklyAmount;
            emit UnallocatedSupplyReduced(weeklyAmount, unallocated);
        }

        unallocatedTotal = uint128(unallocated);
        totalUpdateWeek = uint64(currentWeek);
        lockWeeks = uint64(lock);
    }

    /**
        @notice Allocate additional `prismaToken` allowance to an emission reciever
                based on the emission schedule
        @param id Receiver ID. The caller must be the receiver mapped to this ID.
        @return uint256 Additional `prismaToken` allowance for the receiver. The receiver
                        accesses the tokens using `Vault.transferAllocatedTokens`
     */
    function allocateNewEmissions(uint256 id) external returns (uint256) {
        Receiver memory receiver = idToReceiver[id];
        require(receiver.account == msg.sender, "Receiver not registered");
        uint256 week = receiverUpdatedWeek[id];
        uint256 currentWeek = getWeek();
        if (week == currentWeek) return 0;

        IEmissionSchedule _emissionSchedule = emissionSchedule;
        _allocateTotalWeekly(_emissionSchedule, currentWeek);

        if (address(_emissionSchedule) == address(0)) {
            receiverUpdatedWeek[id] = uint16(currentWeek);
            return 0;
        }

        uint256 amount;
        while (week < currentWeek) {
            ++week;
            amount = amount + _emissionSchedule.getReceiverWeeklyEmissions(id, week, weeklyEmissions[week]);
        }

        receiverUpdatedWeek[id] = uint16(currentWeek);
        if (receiver.isActive) {
            allocated[msg.sender] = allocated[msg.sender] + amount;
            emit IncreasedAllocation(msg.sender, amount);
            return amount;
        } else {
            // if receiver is not active, return allocation to the unallocated supply
            uint256 unallocated = unallocatedTotal + amount;
            unallocatedTotal = uint128(unallocated);
            emit UnallocatedSupplyIncreased(amount, unallocated);
            return 0;
        }
    }

    /**
        @notice Transfer `prismaToken` tokens previously allocated to the caller
        @dev Callable only by registered receiver contracts which were previously
             allocated tokens using `allocateNewEmissions`.
        @param claimant Address that is claiming the tokens
        @param receiver Address to transfer tokens to
        @param amount Desired amount of tokens to transfer. This value always assumes max boost.
        @return bool success
     */
    function transferAllocatedTokens(address claimant, address receiver, uint256 amount) external returns (bool) {
        if (amount > 0) {
            allocated[msg.sender] -= amount;
            _transferAllocated(0, claimant, receiver, address(0), amount);
        }
        return true;
    }

    /**
        @notice Claim earned tokens from multiple reward contracts, optionally with delegated boost
        @param receiver Address to transfer tokens to. Any earned 3rd-party rewards
                        are also sent to this address.
        @param boostDelegate Address to delegate boost from during this claim. Set as
                             `address(0)` to use the boost of the claimer.
        @param rewardContracts Array of addresses of registered receiver contracts where
                               the caller has pending rewards to claim.
        @param maxFeePct Maximum fee percent to pay to delegate, as a whole number out of 10000
        @return bool success
     */
    function batchClaimRewards(
        address receiver,
        address boostDelegate,
        IRewards[] calldata rewardContracts,
        uint256 maxFeePct
    ) external returns (bool) {
        require(maxFeePct <= 10000, "Invalid maxFeePct");

        uint256 total;
        uint256 length = rewardContracts.length;
        for (uint256 i = 0; i < length; i++) {
            uint256 amount = rewardContracts[i].vaultClaimReward(msg.sender, receiver);
            allocated[address(rewardContracts[i])] -= amount;
            total += amount;
        }
        _transferAllocated(maxFeePct, msg.sender, receiver, boostDelegate, total);
        return true;
    }

    /**
        @notice Claim tokens earned from boost delegation fees
        @param receiver Address to transfer the tokens to
        @return bool Success
     */
    function claimBoostDelegationFees(address receiver) external returns (bool) {
        uint256 amount = storedPendingReward[msg.sender];
        require(amount >= lockToTokenRatio, "Nothing to claim");
        _transferOrLock(msg.sender, receiver, amount);
        return true;
    }

    function _transferAllocated(
        uint256 maxFeePct,
        address account,
        address receiver,
        address boostDelegate,
        uint256 amount
    ) internal {
        if (amount > 0) {
            uint256 week = getWeek();
            uint256 totalWeekly = weeklyEmissions[week];
            address claimant = boostDelegate == address(0) ? account : boostDelegate;
            uint256 previousAmount = accountWeeklyEarned[claimant][week];

            // if boost delegation is active, get the fee and optional callback address
            uint256 fee;
            IBoostDelegate delegateCallback;
            if (boostDelegate != address(0)) {
                Delegation memory data = boostDelegation[boostDelegate];
                delegateCallback = data.callback;
                require(data.isEnabled, "Invalid delegate");
                if (data.feePct == type(uint16).max) {
                    fee = delegateCallback.getFeePct(account, receiver, amount, previousAmount, totalWeekly);
                    require(fee <= 10000, "Invalid delegate fee");
                } else fee = data.feePct;
                require(fee <= maxFeePct, "fee exceeds maxFeePct");
            }

            // calculate adjusted amount with actual boost applied
            uint256 adjustedAmount = boostCalculator.getBoostedAmountWrite(
                claimant,
                amount,
                previousAmount,
                totalWeekly
            );
            {
                // remaining tokens from unboosted claims are added to the unallocated total
                // context avoids stack-too-deep
                uint256 boostUnclaimed = amount - adjustedAmount;
                if (boostUnclaimed > 0) {
                    uint256 unallocated = unallocatedTotal + boostUnclaimed;
                    unallocatedTotal = uint128(unallocated);
                    emit UnallocatedSupplyIncreased(boostUnclaimed, unallocated);
                }
            }
            accountWeeklyEarned[claimant][week] = uint128(previousAmount + amount);

            // apply boost delegation fee
            if (fee != 0) {
                fee = (adjustedAmount * fee) / 10000;
                adjustedAmount -= fee;
            }

            // add `storedPendingReward` to `adjustedAmount`
            // this happens after any boost modifiers or delegation fees, since
            // these effects were already applied to the stored value
            adjustedAmount += storedPendingReward[account];

            _transferOrLock(account, receiver, adjustedAmount);

            // apply delegate fee and optionally perform callback
            if (fee != 0) storedPendingReward[boostDelegate] += fee;
            if (address(delegateCallback) != address(0)) {
                require(
                    delegateCallback.delegatedBoostCallback(
                        account,
                        receiver,
                        amount,
                        adjustedAmount,
                        fee,
                        previousAmount,
                        totalWeekly
                    ),
                    "Delegate callback rejected"
                );
            }
        }
    }

    function _transferOrLock(address claimant, address receiver, uint256 amount) internal {
        uint256 _lockWeeks = lockWeeks;
        if (_lockWeeks == 0) {
            storedPendingReward[claimant] = 0;
            prismaToken.transfer(receiver, amount);
        } else {
            // lock for receiver and store remaining balance in `storedPendingReward`
            uint256 lockAmount = amount / lockToTokenRatio;
            storedPendingReward[claimant] = amount - lockAmount * lockToTokenRatio;
            if (lockAmount > 0) locker.lock(receiver, lockAmount, _lockWeeks);
        }
    }

    /**
        @notice Claimable PRISMA amount for `account` in `rewardContract` after applying boost
        @dev Returns (0, 0) if the boost delegate is invalid, or the delgate's callback fee
             function is incorrectly configured.
        @param account Address claiming rewards
        @param boostDelegate Address to delegate boost from when claiming. Set as
                             `address(0)` to use the boost of the claimer.
        @param rewardContract Address of the contract where rewards are being claimed
        @return adjustedAmount Amount received after boost, prior to paying delegate fee
        @return feeToDelegate Fee amount paid to `boostDelegate`

     */
    function claimableRewardAfterBoost(
        address account,
        address receiver,
        address boostDelegate,
        IRewards rewardContract
    ) external view returns (uint256 adjustedAmount, uint256 feeToDelegate) {
        uint256 amount = rewardContract.claimableReward(account);
        uint256 week = getWeek();
        uint256 totalWeekly = weeklyEmissions[week];
        address claimant = boostDelegate == address(0) ? account : boostDelegate;
        uint256 previousAmount = accountWeeklyEarned[claimant][week];

        uint256 fee;
        if (boostDelegate != address(0)) {
            Delegation memory data = boostDelegation[boostDelegate];
            if (!data.isEnabled) return (0, 0);
            fee = data.feePct;
            if (fee == type(uint16).max) {
                try data.callback.getFeePct(claimant, receiver, amount, previousAmount, totalWeekly) returns (
                    uint256 _fee
                ) {
                    fee = _fee;
                } catch {
                    return (0, 0);
                }
            }
            if (fee > 10000) return (0, 0);
        }

        adjustedAmount = boostCalculator.getBoostedAmount(claimant, amount, previousAmount, totalWeekly);
        fee = (adjustedAmount * fee) / 10000;

        return (adjustedAmount, fee);
    }

    /**
        @notice Enable or disable boost delegation, and set boost delegation parameters
        @param isEnabled is boost delegation enabled?
        @param feePct Fee % charged when claims are made that delegate to the caller's boost.
                      Given as a whole number out of 10000. If set to type(uint16).max, the fee
                      is set by calling `IBoostDelegate(callback).getFeePct` prior to each claim.
        @param callback Optional contract address to receive a callback each time a claim is
                        made which delegates to the caller's boost.
     */
    function setBoostDelegationParams(bool isEnabled, uint256 feePct, address callback) external returns (bool) {
        if (isEnabled) {
            require(feePct <= 10000 || feePct == type(uint16).max, "Invalid feePct");
            if (callback != address(0) || feePct == type(uint16).max) {
                require(callback.isContract(), "Callback must be a contract");
            }
            boostDelegation[msg.sender] = Delegation({
                isEnabled: true,
                feePct: uint16(feePct),
                callback: IBoostDelegate(callback)
            });
        } else {
            delete boostDelegation[msg.sender];
        }
        emit BoostDelegationSet(msg.sender, isEnabled, feePct, callback);

        return true;
    }

    /**
        @notice Get the remaining claimable amounts this week that will receive boost
        @param claimant address to query boost amounts for
        @return maxBoosted remaining claimable amount that will receive max boost
        @return boosted remaining claimable amount that will receive some amount of boost (including max boost)
     */
    function getClaimableWithBoost(address claimant) external view returns (uint256 maxBoosted, uint256 boosted) {
        uint256 week = getWeek();
        uint256 totalWeekly = weeklyEmissions[week];
        uint256 previousAmount = accountWeeklyEarned[claimant][week];
        return boostCalculator.getClaimableWithBoost(claimant, previousAmount, totalWeekly);
    }

    /**
        @notice Get the claimable amount that `claimant` has earned boost delegation fees
     */
    function claimableBoostDelegationFees(address claimant) external view returns (uint256 amount) {
        amount = storedPendingReward[claimant];
        // only return values `>= lockToTokenRatio` so we do not report "dust" stored for normal users
        return amount >= lockToTokenRatio ? amount : 0;
    }
}

File 2 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "IERC20.sol";
import "draft-IERC20Permit.sol";
import "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));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 4 of 14 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 5 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 6 of 14 : PrismaOwnable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

import "IPrismaCore.sol";

/**
    @title Prisma Ownable
    @notice Contracts inheriting `PrismaOwnable` have the same owner as `PrismaCore`.
            The ownership cannot be independently modified or renounced.
 */
contract PrismaOwnable {
    IPrismaCore public immutable PRISMA_CORE;

    constructor(address _prismaCore) {
        PRISMA_CORE = IPrismaCore(_prismaCore);
    }

    modifier onlyOwner() {
        require(msg.sender == PRISMA_CORE.owner(), "Only owner");
        _;
    }

    function owner() public view returns (address) {
        return PRISMA_CORE.owner();
    }

    function guardian() public view returns (address) {
        return PRISMA_CORE.guardian();
    }
}

File 7 of 14 : IPrismaCore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IPrismaCore {
    event FeeReceiverSet(address feeReceiver);
    event GuardianSet(address guardian);
    event NewOwnerAccepted(address oldOwner, address owner);
    event NewOwnerCommitted(address owner, address pendingOwner, uint256 deadline);
    event NewOwnerRevoked(address owner, address revokedOwner);
    event Paused();
    event PriceFeedSet(address priceFeed);
    event Unpaused();

    function acceptTransferOwnership() external;

    function commitTransferOwnership(address newOwner) external;

    function revokeTransferOwnership() external;

    function setFeeReceiver(address _feeReceiver) external;

    function setGuardian(address _guardian) external;

    function setPaused(bool _paused) external;

    function setPriceFeed(address _priceFeed) external;

    function OWNERSHIP_TRANSFER_DELAY() external view returns (uint256);

    function feeReceiver() external view returns (address);

    function guardian() external view returns (address);

    function owner() external view returns (address);

    function ownershipTransferDeadline() external view returns (uint256);

    function paused() external view returns (bool);

    function pendingOwner() external view returns (address);

    function priceFeed() external view returns (address);

    function startTime() external view returns (uint256);
}

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

pragma solidity 0.8.19;

import "IPrismaCore.sol";

/**
    @title Prisma System Start Time
    @dev Provides a unified `startTime` and `getWeek`, used for emissions.
 */
contract SystemStart {
    uint256 immutable startTime;

    constructor(address prismaCore) {
        startTime = IPrismaCore(prismaCore).startTime();
    }

    function getWeek() public view returns (uint256 week) {
        return (block.timestamp - startTime) / 1 weeks;
    }
}

File 9 of 14 : IPrismaToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IPrismaToken {
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint256 _amount);
    event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);
    event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint256 _amount);
    event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint256 _minDstGas);
    event SetPrecrime(address precrime);
    event SetTrustedRemote(uint16 _remoteChainId, bytes _path);
    event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);
    event SetUseCustomAdapterParams(bool _useCustomAdapterParams);
    event Transfer(address indexed from, address indexed to, uint256 value);

    function approve(address spender, uint256 amount) external returns (bool);

    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);

    function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;

    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);

    function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;

    function mintToVault(uint256 _totalSupply) external returns (bool);

    function nonblockingLzReceive(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        uint64 _nonce,
        bytes calldata _payload
    ) external;

    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    function renounceOwnership() external;

    function setConfig(uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config) external;

    function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint256 _minGas) external;

    function setPayloadSizeLimit(uint16 _dstChainId, uint256 _size) external;

    function setPrecrime(address _precrime) external;

    function setReceiveVersion(uint16 _version) external;

    function setSendVersion(uint16 _version) external;

    function setTrustedRemote(uint16 _srcChainId, bytes calldata _path) external;

    function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external;

    function setUseCustomAdapterParams(bool _useCustomAdapterParams) external;

    function transfer(address to, uint256 amount) external returns (bool);

    function transferFrom(address from, address to, uint256 amount) external returns (bool);

    function transferOwnership(address newOwner) external;

    function transferToLocker(address sender, uint256 amount) external returns (bool);

    function retryMessage(
        uint16 _srcChainId,
        bytes calldata _srcAddress,
        uint64 _nonce,
        bytes calldata _payload
    ) external payable;

    function sendFrom(
        address _from,
        uint16 _dstChainId,
        bytes calldata _toAddress,
        uint256 _amount,
        address _refundAddress,
        address _zroPaymentAddress,
        bytes calldata _adapterParams
    ) external payable;

    function DEFAULT_PAYLOAD_SIZE_LIMIT() external view returns (uint256);

    function NO_EXTRA_GAS() external view returns (uint256);

    function PT_SEND() external view returns (uint16);

    function allowance(address owner, address spender) external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function circulatingSupply() external view returns (uint256);

    function decimals() external view returns (uint8);

    function domainSeparator() external view returns (bytes32);

    function estimateSendFee(
        uint16 _dstChainId,
        bytes calldata _toAddress,
        uint256 _amount,
        bool _useZro,
        bytes calldata _adapterParams
    ) external view returns (uint256 nativeFee, uint256 zroFee);

    function failedMessages(uint16, bytes calldata, uint64) external view returns (bytes32);

    function getConfig(
        uint16 _version,
        uint16 _chainId,
        address,
        uint256 _configType
    ) external view returns (bytes memory);

    function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory);

    function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);

    function locker() external view returns (address);

    function lzEndpoint() external view returns (address);

    function maxTotalSupply() external view returns (uint256);

    function minDstGasLookup(uint16, uint16) external view returns (uint256);

    function name() external view returns (string memory);

    function nonces(address owner) external view returns (uint256);

    function owner() external view returns (address);

    function payloadSizeLimitLookup(uint16) external view returns (uint256);

    function permitTypeHash() external view returns (bytes32);

    function precrime() external view returns (address);

    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    function symbol() external view returns (string memory);

    function token() external view returns (address);

    function totalSupply() external view returns (uint256);

    function trustedRemoteLookup(uint16) external view returns (bytes memory);

    function useCustomAdapterParams() external view returns (bool);

    function vault() external view returns (address);

    function version() external view returns (string memory);
}

File 10 of 14 : IEmissionSchedule.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IEmissionSchedule {
    event LockParametersSet(uint256 lockWeeks, uint256 lockDecayWeeks);
    event WeeklyPctScheduleSet(uint64[2][] schedule);

    function getReceiverWeeklyEmissions(
        uint256 id,
        uint256 week,
        uint256 totalWeeklyEmissions
    ) external returns (uint256);

    function getTotalWeeklyEmissions(
        uint256 week,
        uint256 unallocatedTotal
    ) external returns (uint256 amount, uint256 lock);

    function setLockParameters(uint64 _lockWeeks, uint64 _lockDecayWeeks) external returns (bool);

    function setWeeklyPctSchedule(uint64[2][] calldata _schedule) external returns (bool);

    function MAX_LOCK_WEEKS() external view returns (uint256);

    function PRISMA_CORE() external view returns (address);

    function getWeek() external view returns (uint256 week);

    function getWeeklyPctSchedule() external view returns (uint64[2][] memory);

    function guardian() external view returns (address);

    function lockDecayWeeks() external view returns (uint64);

    function lockWeeks() external view returns (uint64);

    function owner() external view returns (address);

    function vault() external view returns (address);

    function voter() external view returns (address);

    function weeklyPct() external view returns (uint64);
}

File 11 of 14 : IIncentiveVoting.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IIncentiveVoting {
    struct Vote {
        uint256 id;
        uint256 points;
    }

    struct LockData {
        uint256 amount;
        uint256 weeksToUnlock;
    }

    event AccountWeightRegistered(
        address indexed account,
        uint256 indexed week,
        uint256 frozenBalance,
        LockData[] registeredLockData
    );
    event ClearedVotes(address indexed account, uint256 indexed week);
    event NewVotes(address indexed account, uint256 indexed week, Vote[] newVotes, uint256 totalPointsUsed);

    function clearRegisteredWeight(address account) external returns (bool);

    function clearVote(address account) external;

    function getReceiverVotePct(uint256 id, uint256 week) external returns (uint256);

    function getReceiverWeightWrite(uint256 idx) external returns (uint256);

    function getTotalWeightWrite() external returns (uint256);

    function registerAccountWeight(address account, uint256 minWeeks) external;

    function registerAccountWeightAndVote(address account, uint256 minWeeks, Vote[] calldata votes) external;

    function registerNewReceiver() external returns (uint256);

    function setDelegateApproval(address _delegate, bool _isApproved) external;

    function unfreeze(address account, bool keepVote) external returns (bool);

    function vote(address account, Vote[] calldata votes, bool clearPrevious) external;

    function MAX_LOCK_WEEKS() external view returns (uint256);

    function MAX_POINTS() external view returns (uint256);

    function getAccountCurrentVotes(address account) external view returns (Vote[] memory votes);

    function getAccountRegisteredLocks(
        address account
    ) external view returns (uint256 frozenWeight, LockData[] memory lockData);

    function getReceiverWeight(uint256 idx) external view returns (uint256);

    function getReceiverWeightAt(uint256 idx, uint256 week) external view returns (uint256);

    function getTotalWeight() external view returns (uint256);

    function getTotalWeightAt(uint256 week) external view returns (uint256);

    function getWeek() external view returns (uint256 week);

    function isApprovedDelegate(address owner, address caller) external view returns (bool isApproved);

    function receiverCount() external view returns (uint256);

    function receiverDecayRate(uint256) external view returns (uint32);

    function receiverUpdatedWeek(uint256) external view returns (uint16);

    function receiverWeeklyUnlocks(uint256, uint256) external view returns (uint32);

    function tokenLocker() external view returns (address);

    function totalDecayRate() external view returns (uint32);

    function totalUpdatedWeek() external view returns (uint16);

    function totalWeeklyUnlocks(uint256) external view returns (uint32);

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

File 12 of 14 : ITokenLocker.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface ITokenLocker {
    struct LockData {
        uint256 amount;
        uint256 weeksToUnlock;
    }
    struct ExtendLockData {
        uint256 amount;
        uint256 currentWeeks;
        uint256 newWeeks;
    }

    event LockCreated(address indexed account, uint256 amount, uint256 _weeks);
    event LockExtended(address indexed account, uint256 amount, uint256 _weeks, uint256 newWeeks);
    event LocksCreated(address indexed account, LockData[] newLocks);
    event LocksExtended(address indexed account, ExtendLockData[] locks);
    event LocksFrozen(address indexed account, uint256 amount);
    event LocksUnfrozen(address indexed account, uint256 amount);
    event LocksWithdrawn(address indexed account, uint256 withdrawn, uint256 penalty);

    function extendLock(uint256 _amount, uint256 _weeks, uint256 _newWeeks) external returns (bool);

    function extendMany(ExtendLockData[] calldata newExtendLocks) external returns (bool);

    function freeze() external;

    function getAccountWeightWrite(address account) external returns (uint256);

    function getTotalWeightWrite() external returns (uint256);

    function lock(address _account, uint256 _amount, uint256 _weeks) external returns (bool);

    function lockMany(address _account, LockData[] calldata newLocks) external returns (bool);

    function setPenaltyWithdrawalsEnabled(bool _enabled) external returns (bool);

    function unfreeze(bool keepIncentivesVote) external;

    function withdrawExpiredLocks(uint256 _weeks) external returns (bool);

    function withdrawWithPenalty(uint256 amountToWithdraw) external returns (uint256);

    function MAX_LOCK_WEEKS() external view returns (uint256);

    function PRISMA_CORE() external view returns (address);

    function getAccountActiveLocks(
        address account,
        uint256 minWeeks
    ) external view returns (LockData[] memory lockData, uint256 frozenAmount);

    function getAccountBalances(address account) external view returns (uint256 locked, uint256 unlocked);

    function getAccountWeight(address account) external view returns (uint256);

    function getAccountWeightAt(address account, uint256 week) external view returns (uint256);

    function getTotalWeight() external view returns (uint256);

    function getTotalWeightAt(uint256 week) external view returns (uint256);

    function getWeek() external view returns (uint256 week);

    function getWithdrawWithPenaltyAmounts(
        address account,
        uint256 amountToWithdraw
    ) external view returns (uint256 amountWithdrawn, uint256 penaltyAmountPaid);

    function guardian() external view returns (address);

    function incentiveVoter() external view returns (address);

    function lockToTokenRatio() external view returns (uint256);

    function lockToken() external view returns (address);

    function owner() external view returns (address);

    function penaltyWithdrawalsEnabled() external view returns (bool);

    function prismaCore() external view returns (address);

    function totalDecayRate() external view returns (uint32);

    function totalUpdatedWeek() external view returns (uint16);
}

File 13 of 14 : IBoostDelegate.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

/**
    @title Prisma Boost Delegate Interface
    @notice When enabling boost delegation via `Vault.setBoostDelegationParams`,
            you may optionally set a `callback` contract. If set, it should adhere
            to the following interface.
 */
interface IBoostDelegate {
    /**
        @notice Get the current fee percent charged to use this boost delegate
        @dev Optional. Only called if the feePct is set to `type(uint16).max` when
             enabling delegation.
        @param claimant Address that will perform the claim
        @param amount Amount to be claimed (before applying boost or fee)
        @param previousAmount Previous amount claimed this week by this contract
        @param totalWeeklyEmissions Total weekly emissions released this week
        @return feePct Fee % charged for claims that use this contracts' delegated boost.
                      Given as a whole number out of 10000. If a claim would be rejected,
                      the preferred return value is `type(uint256).max`.
     */
    function getFeePct(
        address claimant,
        address receiver,
        uint amount,
        uint previousAmount,
        uint totalWeeklyEmissions
    ) external view returns (uint256 feePct);

    /**
        @notice Callback function for boost delegators
        @dev MUST BE INCLUDED. Called after each successful claim which used
             this contract's delegated boost.
        @param claimant Address that performed the claim
        @param amount Amount that claimed (before applying boost or fee)
        @param adjustedAmount Actual amount received by `claimant`
        @param fee Fee amount paid by `claimant`
        @param previousAmount Previous amount claimed this week by this contract
        @param totalWeeklyEmissions Total weekly emissions released this week
     */
    function delegatedBoostCallback(
        address claimant,
        address receiver,
        uint amount,
        uint adjustedAmount,
        uint fee,
        uint previousAmount,
        uint totalWeeklyEmissions
    ) external returns (bool success);
}

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

pragma solidity ^0.8.0;

interface IBoostCalculator {
    function getBoostedAmountWrite(
        address account,
        uint256 amount,
        uint256 previousAmount,
        uint256 totalWeeklyEmissions
    ) external returns (uint256 adjustedAmount);

    function MAX_BOOST_GRACE_WEEKS() external view returns (uint256);

    function getBoostedAmount(
        address account,
        uint256 amount,
        uint256 previousAmount,
        uint256 totalWeeklyEmissions
    ) external view returns (uint256 adjustedAmount);

    function getClaimableWithBoost(
        address claimant,
        uint256 previousAmount,
        uint256 totalWeeklyEmissions
    ) external view returns (uint256 maxBoosted, uint256 boosted);

    function getWeek() external view returns (uint256 week);

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_prismaCore","type":"address"},{"internalType":"contract IPrismaToken","name":"_token","type":"address"},{"internalType":"contract ITokenLocker","name":"_locker","type":"address"},{"internalType":"contract IIncentiveVoting","name":"_voter","type":"address"},{"internalType":"address","name":"_stabilityPool","type":"address"},{"internalType":"address","name":"_manager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"boostCalculator","type":"address"}],"name":"BoostCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"boostDelegate","type":"address"},{"indexed":false,"internalType":"bool","name":"isEnabled","type":"bool"},{"indexed":false,"internalType":"uint256","name":"feePct","type":"uint256"},{"indexed":false,"internalType":"address","name":"callback","type":"address"}],"name":"BoostDelegationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"emissionScheduler","type":"address"}],"name":"EmissionScheduleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"increasedAmount","type":"uint256"}],"name":"IncreasedAllocation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"NewReceiverRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"ReceiverIsActiveStatusModified","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"increasedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unallocatedTotal","type":"uint256"}],"name":"UnallocatedSupplyIncreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reducedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unallocatedTotal","type":"uint256"}],"name":"UnallocatedSupplyReduced","type":"event"},{"inputs":[],"name":"PRISMA_CORE","outputs":[{"internalType":"contract IPrismaCore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"allocateNewEmissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allocated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"boostDelegate","type":"address"},{"internalType":"contract IRewards[]","name":"rewardContracts","type":"address[]"},{"internalType":"uint256","name":"maxFeePct","type":"uint256"}],"name":"batchClaimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"boostCalculator","outputs":[{"internalType":"contract IBoostCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"boostDelegation","outputs":[{"internalType":"bool","name":"isEnabled","type":"bool"},{"internalType":"uint16","name":"feePct","type":"uint16"},{"internalType":"contract IBoostDelegate","name":"callback","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"claimBoostDelegationFees","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"claimant","type":"address"}],"name":"claimableBoostDelegationFees","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"boostDelegate","type":"address"},{"internalType":"contract IRewards","name":"rewardContract","type":"address"}],"name":"claimableRewardAfterBoost","outputs":[{"internalType":"uint256","name":"adjustedAmount","type":"uint256"},{"internalType":"uint256","name":"feeToDelegate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deploymentManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emissionSchedule","outputs":[{"internalType":"contract IEmissionSchedule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"claimant","type":"address"}],"name":"getClaimableWithBoost","outputs":[{"internalType":"uint256","name":"maxBoosted","type":"uint256"},{"internalType":"uint256","name":"boosted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWeek","outputs":[{"internalType":"uint256","name":"week","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"guardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"idToReceiver","outputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"increaseUnallocatedSupply","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockWeeks","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"locker","outputs":[{"internalType":"contract ITokenLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prismaToken","outputs":[{"internalType":"contract IPrismaToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"receiverUpdatedWeek","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"registerReceiver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IBoostCalculator","name":"_boostCalculator","type":"address"}],"name":"setBoostCalculator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isEnabled","type":"bool"},{"internalType":"uint256","name":"feePct","type":"uint256"},{"internalType":"address","name":"callback","type":"address"}],"name":"setBoostDelegationParams","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IEmissionSchedule","name":"_emissionSchedule","type":"address"}],"name":"setEmissionSchedule","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IEmissionSchedule","name":"_emissionSchedule","type":"address"},{"internalType":"contract IBoostCalculator","name":"_boostCalculator","type":"address"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint64","name":"initialLockWeeks","type":"uint64"},{"internalType":"uint128[]","name":"_fixedInitialAmounts","type":"uint128[]"},{"components":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct PrismaVault.InitialAllowance[]","name":"initialAllowances","type":"tuple[]"}],"name":"setInitialParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"isActive","type":"bool"}],"name":"setReceiverIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalUpdateWeek","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"claimant","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferAllocatedTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unallocatedTotal","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"contract IIncentiveVoting","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"weeklyEmissions","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"}]

6101606040523480156200001257600080fd5b506040516200387538038062003875833981016040819052620000359162000287565b6001600160a01b0386166080819052604080516378e9792560e01b815290518892916378e979259160048083019260209291908290030181865afa15801562000082573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000a891906200031b565b60a052506001600160a01b0380861660c05284811660e0819052908416610100526040805163c5438b1b60e01b8152905163c5438b1b916004808201926020929091908290030181865afa15801562000105573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200012b91906200031b565b610140526001600160a01b0380821661012052604080516308acd44d60e31b8152905191851691634566a2689160048082019260209290919082900301816000875af115801562000180573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001a691906200031b565b506040805180820182526001600160a01b03808516825260016020808401918252600080805261100390915292517fd20a0949d46f2a3fe8e2b097639cb0509b48cd46f5f5b8e4534ea046b7dbd326805492511515600160a01b026001600160a81b0319909316919093161717905590517f375399aa7a22a9cce4a6b9bf254f18feb160b830a7b95ca9884465b1eb46aedb916200025a918591906001600160a01b03929092168252602082015260400190565b60405180910390a150505050505062000335565b6001600160a01b03811681146200028457600080fd5b50565b60008060008060008060c08789031215620002a157600080fd5b8651620002ae816200026e565b6020880151909650620002c1816200026e565b6040880151909550620002d4816200026e565b6060880151909450620002e7816200026e565b6080880151909350620002fa816200026e565b60a08801519092506200030d816200026e565b809150509295509295509295565b6000602082840312156200032e57600080fd5b5051919050565b60805160a05160c05160e0516101005161012051610140516134676200040e60003960008181610e2a015281816119ac0152818161244601526124720152600081816103c8015261101b015260008181610368015261083201526000818161056201526124ee0152600081816104b501528181610624015281816110c10152818161127901528181611a9401526123ca0152600061161d0152600081816105280152818161071801528181610d9201528181610ee901528181611685015281816119e201528181611bd4015261209901526134676000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063874d6d811161011a578063a64b6e5f116100ad578063d4add76a1161007c578063d4add76a1461054a578063d7b96d4e1461055d578063e46c3d4e14610584578063ed51e69c146105d9578063fb42714f146105ec57600080fd5b8063a64b6e5f146104d7578063b52bbe48146104ea578063c13d940414610510578063cc9641a81461052357600080fd5b80639a863476116100e95780639a863476146104625780639e27a51b1461048a5780639ef663001461049d578063a2e6d623146104b057600080fd5b8063874d6d811461042c5780638777f4d2146104345780638d804ee0146104475780638da5cb5b1461045a57600080fd5b806346c96aac116101925780636ca32a9e116101615780636ca32a9e146103c35780637201fb0e146103ea578063804cf8561461040457806384bdd3151461041957600080fd5b806346c96aac1461036357806363b828931461038a5780636bd2fe3e1461039d5780636be986ba146103b057600080fd5b8063351bae3b116101ce578063351bae3b146102cf578063378cbf75146103015780634225e5bb14610322578063452a93201461034357600080fd5b80630b2f728a14610200578063226883b71461023057806327b13b3c1461029957806333dee360146102bc575b600080fd5b600254610213906001600160801b031681565b6040516001600160801b0390911681526020015b60405180910390f35b61027061023e366004612dd9565b6190076020526000908152604090205460ff811690610100810461ffff1690630100000090046001600160a01b031683565b60408051931515845261ffff90921660208401526001600160a01b031690820152606001610227565b6102ac6102a7366004612dfd565b6105ff565b6040519015158152602001610227565b6102ac6102ca366004612e16565b610714565b6002546102e990600160801b90046001600160401b031681565b6040516001600160401b039091168152602001610227565b61031461030f366004612dfd565b610a32565b604051908152602001610227565b610314610330366004612dd9565b6190046020526000908152604090205481565b61034b610d8e565b6040516001600160a01b039091168152602001610227565b61034b7f000000000000000000000000000000000000000000000000000000000000000081565b6102ac610398366004612dd9565b610e17565b6102ac6103ab366004612e42565b610e9f565b6102ac6103be366004612dd9565b610ee5565b61034b7f000000000000000000000000000000000000000000000000000000000000000081565b6002546102e990600160c01b90046001600160401b031681565b610417610412366004612fac565b611010565b005b6102ac6104273660046130d1565b611445565b610314611612565b610213610442366004612dfd565b61164c565b60015461034b906001600160a01b031681565b61034b611681565b610475610470366004612dd9565b6116e1565b60408051928352602083019190915201610227565b6102ac610498366004613113565b6117fe565b6103146104ab366004612dd9565b611990565b61034b7f000000000000000000000000000000000000000000000000000000000000000081565b6102ac6104e5366004612e42565b6119de565b6104fd6104f8366004612dfd565b611ba1565b60405161ffff9091168152602001610227565b6102ac61051e3660046131af565b611bd0565b61034b7f000000000000000000000000000000000000000000000000000000000000000081565b6104756105583660046131df565b611d77565b61034b7f000000000000000000000000000000000000000000000000000000000000000081565b6105ba610592366004612dfd565b611003602052600090815260409020546001600160a01b03811690600160a01b900460ff1682565b604080516001600160a01b039093168352901515602083015201610227565b60005461034b906001600160a01b031681565b6102ac6105fa366004612dd9565b612095565b6040516323b872dd60e01b8152336004820152306024820152604481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610675573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610699919061323b565b506002546000906106b49084906001600160801b031661326e565b600280546001600160801b0319166001600160801b03831617905560408051858152602081018390529192507f54b8dd835b48a0b306a9a706a47fc0e08468ce12148a3b645c496018f9852ff9910160405180910390a150600192915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610774573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107989190613281565b6001600160a01b0316336001600160a01b0316146107d15760405162461bcd60e51b81526004016107c89061329e565b60405180910390fd5b6000826001600160401b038111156107eb576107eb612e83565b604051908082528060200260200182016040528015610814578160200160208202803683370190505b5090506000610821611612565b905060005b848110156109b45760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634566a2686040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b491906132c2565b9050808483815181106108c9576108c96132db565b6020026020010181815250508260038261ffff81106108ea576108ea6132db565b6010810491909101805461ffff9384166002600f909416939093026101000a92830293909202199091169190911790556040805180820182526001600160a01b0389811680835260016020808501918252600087815261100382528690209451855492511515600160a01b026001600160a81b031990931694169390931717909255825191825281018390527f375399aa7a22a9cce4a6b9bf254f18feb160b830a7b95ca9884465b1eb46aedb910160405180910390a150806109ac816132f1565b915050610826565b50604051635bbe8aad60e01b81526001600160a01b03861690635bbe8aad906109e190859060040161330a565b6020604051808303816000875af1158015610a00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a24919061323b565b506001925050505b92915050565b6000818152611003602090815260408083208151808301909252546001600160a01b038116808352600160a01b90910460ff16151592820192909252903314610abd5760405162461bcd60e51b815260206004820152601760248201527f5265636569766572206e6f74207265676973746572656400000000000000000060448201526064016107c8565b600060038461ffff8110610ad357610ad36132db565b601091828204019190066002029054906101000a900461ffff1661ffff1690506000610afd611612565b9050808203610b1157506000949350505050565b6000546001600160a01b0316610b278183612197565b6001600160a01b038116610b7c578160038761ffff8110610b4a57610b4a6132db565b601091828204019190066002026101000a81548161ffff021916908361ffff1602179055506000945050505050919050565b60005b82841015610c5657610b90846132f1565b9350816001600160a01b031663a3af6b9b88866110048861ffff8110610bb857610bb86132db565b60028104919091015460405160e086901b6001600160e01b0319168152600481019490945260248401929092526001166010026101000a90046001600160801b031660448201526064016020604051808303816000875af1158015610c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4591906132c2565b610c4f908261326e565b9050610b7f565b8260038861ffff8110610c6b57610c6b6132db565b601091828204019190066002026101000a81548161ffff021916908361ffff160217905550846020015115610d0f573360009081526190046020526040902054610cb690829061326e565b3360008181526190046020526040908190209290925590517fda1c4f2d69a45f565043251bb71522280543796bb865d00e12065191714d470790610cfd9084815260200190565b60405180910390a29695505050505050565b600254600090610d299083906001600160801b031661326e565b600280546001600160801b0319166001600160801b03831617905560408051848152602081018390529192507f54b8dd835b48a0b306a9a706a47fc0e08468ce12148a3b645c496018f9852ff9910160405180910390a1506000979650505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663452a93206040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e129190613281565b905090565b33600090815261900660205260408120547f0000000000000000000000000000000000000000000000000000000000000000811015610e8b5760405162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b60448201526064016107c8565b610e96338483612373565b50600192915050565b60008115610edb57336000908152619004602052604081208054849290610ec790849061334e565b90915550610edb9050600085858286612565565b5060019392505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f699190613281565b6001600160a01b0316336001600160a01b031614610f995760405162461bcd60e51b81526004016107c89061329e565b600054610fb6906001600160a01b0316610fb1611612565b612197565b600080546001600160a01b0319166001600160a01b0384169081179091556040519081527f2c342266e3979163d824140326453c8bf5592ad2f774a58222ea35b5c0bfc774906020015b60405180910390a1506001919050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461107d5760405162461bcd60e51b815260206004820152601260248201527110b232b83637bcb6b2b73a26b0b730b3b2b960711b60448201526064016107c8565b600080546001600160a01b038881166001600160a01b0319928316179092556001805488841692169190911790556040516324c9383760e01b8152600481018690527f0000000000000000000000000000000000000000000000000000000000000000909116906324c93837906024016020604051808303816000875af115801561110c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611130919061323b565b5081516000908161113f611612565b61114a90600161326e565b905060005b828110156111f057600086828151811061116b5761116b6132db565b60200260200101519050806110048484611185919061326e565b61ffff8110611196576111966132db565b600291828204019190066010026101000a8154816001600160801b0302191690836001600160801b03160217905550806001600160801b0316856111da919061326e565b94505080806111e8906132f1565b91505061114f565b508351915060005b828110156112fe576000858281518110611214576112146132db565b60200260200101516020015190506000868381518110611236576112366132db565b60200260200101516000015190508186611250919061326e565b604051633950935160e01b81526001600160a01b038381166004830152602482018590529197507f0000000000000000000000000000000000000000000000000000000000000000909116906339509351906044016020604051808303816000875af11580156112c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e8919061323b565b50505080806112f6906132f1565b9150506111f8565b50611309838861334e565b600280546001600160801b0319166001600160801b0392909216919091179055845160019061133990839061326e565b611343919061334e565b600280546001600160801b0316600160801b6001600160401b03938416026001600160c01b031617600160c01b928916929092029190911790556040516001600160a01b038a1681527f2c342266e3979163d824140326453c8bf5592ad2f774a58222ea35b5c0bfc7749060200160405180910390a16040516001600160a01b03891681527fe1a7ee8754d81e0a44e79c238dfe94867d6af6153c6967474dc7f60e9211d9fa9060200160405180910390a1600254604080518581526001600160801b0390921660208301527fe53029f1371dc130e1277d91cdacc0f9ece4b29159e62598ef1fc911551c6033910160405180910390a1505050505050505050565b60008315611598576127108311158061145f575061ffff83145b61149c5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a59081999595418dd60921b60448201526064016107c8565b6001600160a01b0382161515806114b4575061ffff83145b15611510576001600160a01b0382163b6115105760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6261636b206d757374206265206120636f6e7472616374000000000060448201526064016107c8565b604080516060810182526001815261ffff85811660208084019182526001600160a01b0387811685870190815233600090815261900790935295909120935184549251955162ffffff1990931690151562ffff001916176101009590931694909402919091176301000000600160b81b031916630100000091909316029190911790556115b7565b3360009081526190076020526040902080546001600160b81b03191690555b604080518515158152602081018590526001600160a01b0384169181019190915233907f4de72252e36ce14be9125843bdbb926e0ad0fb57c1a7255e7d4d05383fc184a3906060015b60405180910390a25060019392505050565b600062093a806116427f00000000000000000000000000000000000000000000000000000000000000004261334e565b610e129190613361565b6110048161ffff811061165e57600080fd5b60029182820401919006601002915054906101000a90046001600160801b031681565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dee573d6000803e3d6000fd5b60008060006116ee611612565b905060006110048261ffff8110611707576117076132db565b6002810491909101546001600160a01b03871660009081526190056020526040812060019093166010026101000a9091046001600160801b03169250908361ffff8110611756576117566132db565b6002810491909101546001805460405163423b1fe360e01b81526001600160a01b038b81166004830152929094166010026101000a9092046001600160801b031660248401819052604484018690529350169063423b1fe3906064016040805180830381865afa1580156117ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f29190613383565b94509450505050915091565b60006127108211156118465760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081b585e1199595418dd607a1b60448201526064016107c8565b600083815b81811015611974576000878783818110611867576118676132db565b905060200201602081019061187c9190612dd9565b604051631e0b040760e31b81523360048201526001600160a01b038c81166024830152919091169063f0582038906044016020604051808303816000875af11580156118cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f091906132c2565b90508061900460008a8a8681811061190a5761190a6132db565b905060200201602081019061191f9190612dd9565b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461194e919061334e565b9091555061195e9050818561326e565b935050808061196c906132f1565b91505061184b565b5061198284338a8a86612565565b506001979650505050505050565b6001600160a01b038116600090815261900660205260409020547f00000000000000000000000000000000000000000000000000000000000000008110156119d9576000610a2c565b919050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a629190613281565b6001600160a01b0316336001600160a01b031614611a925760405162461bcd60e51b81526004016107c89061329e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b031603611b8d57306001600160a01b03841603611b1a5760405162461bcd60e51b815260206004820152601460248201527314d95b19881d1c985b9cd9995c8819195b9a595960621b60448201526064016107c8565b600254600090611b349084906001600160801b031661334e565b600280546001600160801b0319166001600160801b03831617905560408051858152602081018390529192507fe53029f1371dc130e1277d91cdacc0f9ece4b29159e62598ef1fc911551c6033910160405180910390a1505b610edb6001600160a01b0385168484612b08565b60038161ffff8110611bb257600080fd5b60109182820401919006600202915054906101000a900461ffff1681565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c549190613281565b6001600160a01b0316336001600160a01b031614611c845760405162461bcd60e51b81526004016107c89061329e565b600083815261100360209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910460ff16151591830191909152611cfa5760405162461bcd60e51b815260206004820152600a6024820152691251081b9bdd081cd95d60b21b60448201526064016107c8565b821515602080830191825260008681526110039091526040908190208351815493511515600160a01b026001600160a81b03199094166001600160a01b0390911617929092179091555184907f82a4ff8311333266bb50969521800e4bed9369da4894334ef456427e3ad921099061160090861515815260200190565b60405163e950342560e01b81526001600160a01b038581166004830152600091829182919085169063e950342590602401602060405180830381865afa158015611dc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de991906132c2565b90506000611df5611612565b905060006110048261ffff8110611e0e57611e0e6132db565b60028104919091015460019091166010026101000a90046001600160801b0316905060006001600160a01b03881615611e475787611e49565b895b6001600160a01b038116600090815261900560205260408120919250908461ffff8110611e7857611e786132db565b60028104919091015460019091166010026101000a90046001600160801b0316905060006001600160a01b038a1615611fe7576001600160a01b03808b16600090815261900760209081526040918290208251606081018452905460ff8116151580835261ffff610100830416938301939093526301000000900490931691830191909152611f1457600080985098505050505050505061208c565b602081015161ffff16915061fffe198201611fc8576040808201519051636a2243a960e01b81526001600160a01b0386811660048301528e81166024830152604482018a9052606482018690526084820188905290911690636a2243a99060a401602060405180830381865afa925050508015611fae575060408051601f3d908101601f19168201909252611fab918101906132c2565b60015b611fc557600080985098505050505050505061208c565b91505b612710821115611fe557600080985098505050505050505061208c565b505b6001546040516349955f6360e01b81526001600160a01b038581166004830152602482018990526044820185905260648201879052909116906349955f6390608401602060405180830381865afa158015612046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206a91906132c2565b9750612710612079828a6133a7565b6120839190613361565b96505050505050505b94509492505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121199190613281565b6001600160a01b0316336001600160a01b0316146121495760405162461bcd60e51b81526004016107c89061329e565b600180546001600160a01b0319166001600160a01b0384169081179091556040519081527fe1a7ee8754d81e0a44e79c238dfe94867d6af6153c6967474dc7f60e9211d9fa90602001611000565b600254600160801b90046001600160401b03168181106121b657505050565b6001600160a01b0383166121f35750600280546001600160401b03909216600160801b0267ffffffffffffffff60801b1990921691909117905550565b60025460009081906001600160801b03165b8484101561232057612216846132f1565b60405163e8643de960e01b815260048101829052602481018390529094506001600160a01b0387169063e8643de99060440160408051808303816000875af1158015612266573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228a9190613383565b93509150816110048561ffff81106122a4576122a46132db565b600291828204019190066010026101000a8154816001600160801b0302191690836001600160801b0316021790555081816122df919061334e565b60408051848152602081018390529192507fe53029f1371dc130e1277d91cdacc0f9ece4b29159e62598ef1fc911551c6033910160405180910390a1612205565b600280546001600160801b03929092166001600160c01b031990921691909117600160801b6001600160401b0396871602176001600160c01b0316600160c01b9390951692909202939093179055505050565b600254600160c01b90046001600160401b0316600081900361243f576001600160a01b0384811660009081526190066020526040808220919091555163a9059cbb60e01b81528482166004820152602481018490527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af1158015612415573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612439919061323b565b5061255f565b600061246b7f000000000000000000000000000000000000000000000000000000000000000084613361565b90506124977f0000000000000000000000000000000000000000000000000000000000000000826133a7565b6124a1908461334e565b6001600160a01b03861660009081526190066020526040902055801561255d5760405163e2ab691d60e01b81526001600160a01b03858116600483015260248201839052604482018490527f0000000000000000000000000000000000000000000000000000000000000000169063e2ab691d906064016020604051808303816000875af1158015612537573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061255b919061323b565b505b505b50505050565b801561255d576000612575611612565b905060006110048261ffff811061258e5761258e6132db565b60028104919091015460019091166010026101000a90046001600160801b0316905060006001600160a01b038516156125c757846125c9565b865b6001600160a01b038116600090815261900560205260408120919250908461ffff81106125f8576125f86132db565b60028104919091015460019091166010026101000a90046001600160801b031690506000806001600160a01b0388161561280057506001600160a01b03808816600090815261900760209081526040918290208251606081018452905460ff8116151580835261ffff61010083041693830193909352630100000090049093169183018290529091906126c05760405162461bcd60e51b815260206004820152601060248201526f496e76616c69642064656c656761746560801b60448201526064016107c8565b61ffff8016816020015161ffff16036127aa57604051636a2243a960e01b81526001600160a01b038c811660048301528b81166024830152604482018a90526064820186905260848201889052831690636a2243a99060a401602060405180830381865afa158015612736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061275a91906132c2565b92506127108311156127a55760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642064656c65676174652066656560601b60448201526064016107c8565b6127b6565b806020015161ffff1692505b8b8311156127fe5760405162461bcd60e51b815260206004820152601560248201527419995948195e18d959591cc81b585e1199595418dd605a1b60448201526064016107c8565b505b600154604051630609d12160e41b81526001600160a01b038681166004830152602482018a90526044820186905260648201889052600092169063609d1210906084016020604051808303816000875af1158015612862573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061288691906132c2565b90506000612894828a61334e565b9050801561290f576002546000906128b69083906001600160801b031661326e565b600280546001600160801b0319166001600160801b03831617905560408051848152602081018390529192507f54b8dd835b48a0b306a9a706a47fc0e08468ce12148a3b645c496018f9852ff9910160405180910390a1505b5061291a888561326e565b6001600160a01b0386166000908152619005602052604090208861ffff8110612945576129456132db565b600291828204019190066010026101000a8154816001600160801b0302191690836001600160801b03160217905550826000146129a25761271061298984836133a7565b6129939190613361565b925061299f838261334e565b90505b6001600160a01b038b16600090815261900660205260409020546129c6908261326e565b90506129d38b8b83612373565b8215612a08576001600160a01b0389166000908152619006602052604081208054859290612a0290849061326e565b90915550505b6001600160a01b03821615612afa576040516346d1a77560e01b81526001600160a01b038c811660048301528b81166024830152604482018a9052606482018390526084820185905260a4820186905260c482018890528316906346d1a7759060e4016020604051808303816000875af1158015612a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aae919061323b565b612afa5760405162461bcd60e51b815260206004820152601a60248201527f44656c65676174652063616c6c6261636b2072656a656374656400000000000060448201526064016107c8565b505050505050505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612b5a908490612b5f565b505050565b6000612bb4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c319092919063ffffffff16565b805190915015612b5a5780806020019051810190612bd2919061323b565b612b5a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107c8565b6060612c408484600085612c48565b949350505050565b606082471015612ca95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107c8565b600080866001600160a01b03168587604051612cc591906133e2565b60006040518083038185875af1925050503d8060008114612d02576040519150601f19603f3d011682016040523d82523d6000602084013e612d07565b606091505b5091509150612d1887838387612d23565b979650505050505050565b60608315612d92578251600003612d8b576001600160a01b0385163b612d8b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107c8565b5081612c40565b612c408383815115612da75781518083602001fd5b8060405162461bcd60e51b81526004016107c891906133fe565b6001600160a01b0381168114612dd657600080fd5b50565b600060208284031215612deb57600080fd5b8135612df681612dc1565b9392505050565b600060208284031215612e0f57600080fd5b5035919050565b60008060408385031215612e2957600080fd5b8235612e3481612dc1565b946020939093013593505050565b600080600060608486031215612e5757600080fd5b8335612e6281612dc1565b92506020840135612e7281612dc1565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715612ebb57612ebb612e83565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612ee957612ee9612e83565b604052919050565b60006001600160401b03821115612f0a57612f0a612e83565b5060051b60200190565b600082601f830112612f2557600080fd5b81356020612f3a612f3583612ef1565b612ec1565b82815260069290921b84018101918181019086841115612f5957600080fd5b8286015b84811015612fa15760408189031215612f765760008081fd5b612f7e612e99565b8135612f8981612dc1565b81528185013585820152835291830191604001612f5d565b509695505050505050565b60008060008060008060c08789031215612fc557600080fd5b8635612fd081612dc1565b9550602087810135612fe181612dc1565b95506040880135945060608801356001600160401b03808216821461300557600080fd5b9094506080890135908082111561301b57600080fd5b818a0191508a601f83011261302f57600080fd5b813561303d612f3582612ef1565b81815260059190911b8301840190848101908d83111561305c57600080fd5b938501935b828510156130905784356001600160801b03811681146130815760008081fd5b82529385019390850190613061565b9650505060a08a01359250808311156130a857600080fd5b50506130b689828a01612f14565b9150509295509295509295565b8015158114612dd657600080fd5b6000806000606084860312156130e657600080fd5b83356130f1816130c3565b925060208401359150604084013561310881612dc1565b809150509250925092565b60008060008060006080868803121561312b57600080fd5b853561313681612dc1565b9450602086013561314681612dc1565b935060408601356001600160401b038082111561316257600080fd5b818801915088601f83011261317657600080fd5b81358181111561318557600080fd5b8960208260051b850101111561319a57600080fd5b96999598505060200195606001359392505050565b600080604083850312156131c257600080fd5b8235915060208301356131d4816130c3565b809150509250929050565b600080600080608085870312156131f557600080fd5b843561320081612dc1565b9350602085013561321081612dc1565b9250604085013561322081612dc1565b9150606085013561323081612dc1565b939692955090935050565b60006020828403121561324d57600080fd5b8151612df6816130c3565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a2c57610a2c613258565b60006020828403121561329357600080fd5b8151612df681612dc1565b6020808252600a908201526927b7363c9037bbb732b960b11b604082015260600190565b6000602082840312156132d457600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b60006001820161330357613303613258565b5060010190565b6020808252825182820181905260009190848201906040850190845b8181101561334257835183529284019291840191600101613326565b50909695505050505050565b81810381811115610a2c57610a2c613258565b60008261337e57634e487b7160e01b600052601260045260246000fd5b500490565b6000806040838503121561339657600080fd5b505080516020909101519092909150565b8082028115828204841417610a2c57610a2c613258565b60005b838110156133d95781810151838201526020016133c1565b50506000910152565b600082516133f48184602087016133be565b9190910192915050565b602081526000825180602084015261341d8160408501602087016133be565b601f01601f1916919091016040019291505056fea26469706673582212205a500bba3b7b3d7d4c89e6ec95b1b390335c62b55cef05f6dda7d748c01a0f4e64736f6c634300081300330000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf8000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c0000000000000000000000003f78544364c3eccdce4d9c89a630aea26122829d000000000000000000000000fd8df0db401ab7ec7a06a8465134fa32132e850c000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba000000000000000000000000d0efdf01dd8d650bba8992e2c42d0bc6d441a673

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063874d6d811161011a578063a64b6e5f116100ad578063d4add76a1161007c578063d4add76a1461054a578063d7b96d4e1461055d578063e46c3d4e14610584578063ed51e69c146105d9578063fb42714f146105ec57600080fd5b8063a64b6e5f146104d7578063b52bbe48146104ea578063c13d940414610510578063cc9641a81461052357600080fd5b80639a863476116100e95780639a863476146104625780639e27a51b1461048a5780639ef663001461049d578063a2e6d623146104b057600080fd5b8063874d6d811461042c5780638777f4d2146104345780638d804ee0146104475780638da5cb5b1461045a57600080fd5b806346c96aac116101925780636ca32a9e116101615780636ca32a9e146103c35780637201fb0e146103ea578063804cf8561461040457806384bdd3151461041957600080fd5b806346c96aac1461036357806363b828931461038a5780636bd2fe3e1461039d5780636be986ba146103b057600080fd5b8063351bae3b116101ce578063351bae3b146102cf578063378cbf75146103015780634225e5bb14610322578063452a93201461034357600080fd5b80630b2f728a14610200578063226883b71461023057806327b13b3c1461029957806333dee360146102bc575b600080fd5b600254610213906001600160801b031681565b6040516001600160801b0390911681526020015b60405180910390f35b61027061023e366004612dd9565b6190076020526000908152604090205460ff811690610100810461ffff1690630100000090046001600160a01b031683565b60408051931515845261ffff90921660208401526001600160a01b031690820152606001610227565b6102ac6102a7366004612dfd565b6105ff565b6040519015158152602001610227565b6102ac6102ca366004612e16565b610714565b6002546102e990600160801b90046001600160401b031681565b6040516001600160401b039091168152602001610227565b61031461030f366004612dfd565b610a32565b604051908152602001610227565b610314610330366004612dd9565b6190046020526000908152604090205481565b61034b610d8e565b6040516001600160a01b039091168152602001610227565b61034b7f000000000000000000000000fd8df0db401ab7ec7a06a8465134fa32132e850c81565b6102ac610398366004612dd9565b610e17565b6102ac6103ab366004612e42565b610e9f565b6102ac6103be366004612dd9565b610ee5565b61034b7f000000000000000000000000d0efdf01dd8d650bba8992e2c42d0bc6d441a67381565b6002546102e990600160c01b90046001600160401b031681565b610417610412366004612fac565b611010565b005b6102ac6104273660046130d1565b611445565b610314611612565b610213610442366004612dfd565b61164c565b60015461034b906001600160a01b031681565b61034b611681565b610475610470366004612dd9565b6116e1565b60408051928352602083019190915201610227565b6102ac610498366004613113565b6117fe565b6103146104ab366004612dd9565b611990565b61034b7f000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c81565b6102ac6104e5366004612e42565b6119de565b6104fd6104f8366004612dfd565b611ba1565b60405161ffff9091168152602001610227565b6102ac61051e3660046131af565b611bd0565b61034b7f0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf881565b6104756105583660046131df565b611d77565b61034b7f0000000000000000000000003f78544364c3eccdce4d9c89a630aea26122829d81565b6105ba610592366004612dfd565b611003602052600090815260409020546001600160a01b03811690600160a01b900460ff1682565b604080516001600160a01b039093168352901515602083015201610227565b60005461034b906001600160a01b031681565b6102ac6105fa366004612dd9565b612095565b6040516323b872dd60e01b8152336004820152306024820152604481018290526000907f000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c6001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610675573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610699919061323b565b506002546000906106b49084906001600160801b031661326e565b600280546001600160801b0319166001600160801b03831617905560408051858152602081018390529192507f54b8dd835b48a0b306a9a706a47fc0e08468ce12148a3b645c496018f9852ff9910160405180910390a150600192915050565b60007f0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf86001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610774573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107989190613281565b6001600160a01b0316336001600160a01b0316146107d15760405162461bcd60e51b81526004016107c89061329e565b60405180910390fd5b6000826001600160401b038111156107eb576107eb612e83565b604051908082528060200260200182016040528015610814578160200160208202803683370190505b5090506000610821611612565b905060005b848110156109b45760007f000000000000000000000000fd8df0db401ab7ec7a06a8465134fa32132e850c6001600160a01b0316634566a2686040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b491906132c2565b9050808483815181106108c9576108c96132db565b6020026020010181815250508260038261ffff81106108ea576108ea6132db565b6010810491909101805461ffff9384166002600f909416939093026101000a92830293909202199091169190911790556040805180820182526001600160a01b0389811680835260016020808501918252600087815261100382528690209451855492511515600160a01b026001600160a81b031990931694169390931717909255825191825281018390527f375399aa7a22a9cce4a6b9bf254f18feb160b830a7b95ca9884465b1eb46aedb910160405180910390a150806109ac816132f1565b915050610826565b50604051635bbe8aad60e01b81526001600160a01b03861690635bbe8aad906109e190859060040161330a565b6020604051808303816000875af1158015610a00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a24919061323b565b506001925050505b92915050565b6000818152611003602090815260408083208151808301909252546001600160a01b038116808352600160a01b90910460ff16151592820192909252903314610abd5760405162461bcd60e51b815260206004820152601760248201527f5265636569766572206e6f74207265676973746572656400000000000000000060448201526064016107c8565b600060038461ffff8110610ad357610ad36132db565b601091828204019190066002029054906101000a900461ffff1661ffff1690506000610afd611612565b9050808203610b1157506000949350505050565b6000546001600160a01b0316610b278183612197565b6001600160a01b038116610b7c578160038761ffff8110610b4a57610b4a6132db565b601091828204019190066002026101000a81548161ffff021916908361ffff1602179055506000945050505050919050565b60005b82841015610c5657610b90846132f1565b9350816001600160a01b031663a3af6b9b88866110048861ffff8110610bb857610bb86132db565b60028104919091015460405160e086901b6001600160e01b0319168152600481019490945260248401929092526001166010026101000a90046001600160801b031660448201526064016020604051808303816000875af1158015610c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4591906132c2565b610c4f908261326e565b9050610b7f565b8260038861ffff8110610c6b57610c6b6132db565b601091828204019190066002026101000a81548161ffff021916908361ffff160217905550846020015115610d0f573360009081526190046020526040902054610cb690829061326e565b3360008181526190046020526040908190209290925590517fda1c4f2d69a45f565043251bb71522280543796bb865d00e12065191714d470790610cfd9084815260200190565b60405180910390a29695505050505050565b600254600090610d299083906001600160801b031661326e565b600280546001600160801b0319166001600160801b03831617905560408051848152602081018390529192507f54b8dd835b48a0b306a9a706a47fc0e08468ce12148a3b645c496018f9852ff9910160405180910390a1506000979650505050505050565b60007f0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf86001600160a01b031663452a93206040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e129190613281565b905090565b33600090815261900660205260408120547f0000000000000000000000000000000000000000000000000de0b6b3a7640000811015610e8b5760405162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b60448201526064016107c8565b610e96338483612373565b50600192915050565b60008115610edb57336000908152619004602052604081208054849290610ec790849061334e565b90915550610edb9050600085858286612565565b5060019392505050565b60007f0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf86001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f699190613281565b6001600160a01b0316336001600160a01b031614610f995760405162461bcd60e51b81526004016107c89061329e565b600054610fb6906001600160a01b0316610fb1611612565b612197565b600080546001600160a01b0319166001600160a01b0384169081179091556040519081527f2c342266e3979163d824140326453c8bf5592ad2f774a58222ea35b5c0bfc774906020015b60405180910390a1506001919050565b336001600160a01b037f000000000000000000000000d0efdf01dd8d650bba8992e2c42d0bc6d441a673161461107d5760405162461bcd60e51b815260206004820152601260248201527110b232b83637bcb6b2b73a26b0b730b3b2b960711b60448201526064016107c8565b600080546001600160a01b038881166001600160a01b0319928316179092556001805488841692169190911790556040516324c9383760e01b8152600481018690527f000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c909116906324c93837906024016020604051808303816000875af115801561110c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611130919061323b565b5081516000908161113f611612565b61114a90600161326e565b905060005b828110156111f057600086828151811061116b5761116b6132db565b60200260200101519050806110048484611185919061326e565b61ffff8110611196576111966132db565b600291828204019190066010026101000a8154816001600160801b0302191690836001600160801b03160217905550806001600160801b0316856111da919061326e565b94505080806111e8906132f1565b91505061114f565b508351915060005b828110156112fe576000858281518110611214576112146132db565b60200260200101516020015190506000868381518110611236576112366132db565b60200260200101516000015190508186611250919061326e565b604051633950935160e01b81526001600160a01b038381166004830152602482018590529197507f000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c909116906339509351906044016020604051808303816000875af11580156112c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e8919061323b565b50505080806112f6906132f1565b9150506111f8565b50611309838861334e565b600280546001600160801b0319166001600160801b0392909216919091179055845160019061133990839061326e565b611343919061334e565b600280546001600160801b0316600160801b6001600160401b03938416026001600160c01b031617600160c01b928916929092029190911790556040516001600160a01b038a1681527f2c342266e3979163d824140326453c8bf5592ad2f774a58222ea35b5c0bfc7749060200160405180910390a16040516001600160a01b03891681527fe1a7ee8754d81e0a44e79c238dfe94867d6af6153c6967474dc7f60e9211d9fa9060200160405180910390a1600254604080518581526001600160801b0390921660208301527fe53029f1371dc130e1277d91cdacc0f9ece4b29159e62598ef1fc911551c6033910160405180910390a1505050505050505050565b60008315611598576127108311158061145f575061ffff83145b61149c5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a59081999595418dd60921b60448201526064016107c8565b6001600160a01b0382161515806114b4575061ffff83145b15611510576001600160a01b0382163b6115105760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6261636b206d757374206265206120636f6e7472616374000000000060448201526064016107c8565b604080516060810182526001815261ffff85811660208084019182526001600160a01b0387811685870190815233600090815261900790935295909120935184549251955162ffffff1990931690151562ffff001916176101009590931694909402919091176301000000600160b81b031916630100000091909316029190911790556115b7565b3360009081526190076020526040902080546001600160b81b03191690555b604080518515158152602081018590526001600160a01b0384169181019190915233907f4de72252e36ce14be9125843bdbb926e0ad0fb57c1a7255e7d4d05383fc184a3906060015b60405180910390a25060019392505050565b600062093a806116427f0000000000000000000000000000000000000000000000000000000064d428804261334e565b610e129190613361565b6110048161ffff811061165e57600080fd5b60029182820401919006601002915054906101000a90046001600160801b031681565b60007f0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf86001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dee573d6000803e3d6000fd5b60008060006116ee611612565b905060006110048261ffff8110611707576117076132db565b6002810491909101546001600160a01b03871660009081526190056020526040812060019093166010026101000a9091046001600160801b03169250908361ffff8110611756576117566132db565b6002810491909101546001805460405163423b1fe360e01b81526001600160a01b038b81166004830152929094166010026101000a9092046001600160801b031660248401819052604484018690529350169063423b1fe3906064016040805180830381865afa1580156117ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f29190613383565b94509450505050915091565b60006127108211156118465760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081b585e1199595418dd607a1b60448201526064016107c8565b600083815b81811015611974576000878783818110611867576118676132db565b905060200201602081019061187c9190612dd9565b604051631e0b040760e31b81523360048201526001600160a01b038c81166024830152919091169063f0582038906044016020604051808303816000875af11580156118cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f091906132c2565b90508061900460008a8a8681811061190a5761190a6132db565b905060200201602081019061191f9190612dd9565b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461194e919061334e565b9091555061195e9050818561326e565b935050808061196c906132f1565b91505061184b565b5061198284338a8a86612565565b506001979650505050505050565b6001600160a01b038116600090815261900660205260409020547f0000000000000000000000000000000000000000000000000de0b6b3a76400008110156119d9576000610a2c565b919050565b60007f0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf86001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a629190613281565b6001600160a01b0316336001600160a01b031614611a925760405162461bcd60e51b81526004016107c89061329e565b7f000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c6001600160a01b0316846001600160a01b031603611b8d57306001600160a01b03841603611b1a5760405162461bcd60e51b815260206004820152601460248201527314d95b19881d1c985b9cd9995c8819195b9a595960621b60448201526064016107c8565b600254600090611b349084906001600160801b031661334e565b600280546001600160801b0319166001600160801b03831617905560408051858152602081018390529192507fe53029f1371dc130e1277d91cdacc0f9ece4b29159e62598ef1fc911551c6033910160405180910390a1505b610edb6001600160a01b0385168484612b08565b60038161ffff8110611bb257600080fd5b60109182820401919006600202915054906101000a900461ffff1681565b60007f0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf86001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c549190613281565b6001600160a01b0316336001600160a01b031614611c845760405162461bcd60e51b81526004016107c89061329e565b600083815261100360209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910460ff16151591830191909152611cfa5760405162461bcd60e51b815260206004820152600a6024820152691251081b9bdd081cd95d60b21b60448201526064016107c8565b821515602080830191825260008681526110039091526040908190208351815493511515600160a01b026001600160a81b03199094166001600160a01b0390911617929092179091555184907f82a4ff8311333266bb50969521800e4bed9369da4894334ef456427e3ad921099061160090861515815260200190565b60405163e950342560e01b81526001600160a01b038581166004830152600091829182919085169063e950342590602401602060405180830381865afa158015611dc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de991906132c2565b90506000611df5611612565b905060006110048261ffff8110611e0e57611e0e6132db565b60028104919091015460019091166010026101000a90046001600160801b0316905060006001600160a01b03881615611e475787611e49565b895b6001600160a01b038116600090815261900560205260408120919250908461ffff8110611e7857611e786132db565b60028104919091015460019091166010026101000a90046001600160801b0316905060006001600160a01b038a1615611fe7576001600160a01b03808b16600090815261900760209081526040918290208251606081018452905460ff8116151580835261ffff610100830416938301939093526301000000900490931691830191909152611f1457600080985098505050505050505061208c565b602081015161ffff16915061fffe198201611fc8576040808201519051636a2243a960e01b81526001600160a01b0386811660048301528e81166024830152604482018a9052606482018690526084820188905290911690636a2243a99060a401602060405180830381865afa925050508015611fae575060408051601f3d908101601f19168201909252611fab918101906132c2565b60015b611fc557600080985098505050505050505061208c565b91505b612710821115611fe557600080985098505050505050505061208c565b505b6001546040516349955f6360e01b81526001600160a01b038581166004830152602482018990526044820185905260648201879052909116906349955f6390608401602060405180830381865afa158015612046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206a91906132c2565b9750612710612079828a6133a7565b6120839190613361565b96505050505050505b94509492505050565b60007f0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf86001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121199190613281565b6001600160a01b0316336001600160a01b0316146121495760405162461bcd60e51b81526004016107c89061329e565b600180546001600160a01b0319166001600160a01b0384169081179091556040519081527fe1a7ee8754d81e0a44e79c238dfe94867d6af6153c6967474dc7f60e9211d9fa90602001611000565b600254600160801b90046001600160401b03168181106121b657505050565b6001600160a01b0383166121f35750600280546001600160401b03909216600160801b0267ffffffffffffffff60801b1990921691909117905550565b60025460009081906001600160801b03165b8484101561232057612216846132f1565b60405163e8643de960e01b815260048101829052602481018390529094506001600160a01b0387169063e8643de99060440160408051808303816000875af1158015612266573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228a9190613383565b93509150816110048561ffff81106122a4576122a46132db565b600291828204019190066010026101000a8154816001600160801b0302191690836001600160801b0316021790555081816122df919061334e565b60408051848152602081018390529192507fe53029f1371dc130e1277d91cdacc0f9ece4b29159e62598ef1fc911551c6033910160405180910390a1612205565b600280546001600160801b03929092166001600160c01b031990921691909117600160801b6001600160401b0396871602176001600160c01b0316600160c01b9390951692909202939093179055505050565b600254600160c01b90046001600160401b0316600081900361243f576001600160a01b0384811660009081526190066020526040808220919091555163a9059cbb60e01b81528482166004820152602481018490527f000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c9091169063a9059cbb906044016020604051808303816000875af1158015612415573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612439919061323b565b5061255f565b600061246b7f0000000000000000000000000000000000000000000000000de0b6b3a764000084613361565b90506124977f0000000000000000000000000000000000000000000000000de0b6b3a7640000826133a7565b6124a1908461334e565b6001600160a01b03861660009081526190066020526040902055801561255d5760405163e2ab691d60e01b81526001600160a01b03858116600483015260248201839052604482018490527f0000000000000000000000003f78544364c3eccdce4d9c89a630aea26122829d169063e2ab691d906064016020604051808303816000875af1158015612537573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061255b919061323b565b505b505b50505050565b801561255d576000612575611612565b905060006110048261ffff811061258e5761258e6132db565b60028104919091015460019091166010026101000a90046001600160801b0316905060006001600160a01b038516156125c757846125c9565b865b6001600160a01b038116600090815261900560205260408120919250908461ffff81106125f8576125f86132db565b60028104919091015460019091166010026101000a90046001600160801b031690506000806001600160a01b0388161561280057506001600160a01b03808816600090815261900760209081526040918290208251606081018452905460ff8116151580835261ffff61010083041693830193909352630100000090049093169183018290529091906126c05760405162461bcd60e51b815260206004820152601060248201526f496e76616c69642064656c656761746560801b60448201526064016107c8565b61ffff8016816020015161ffff16036127aa57604051636a2243a960e01b81526001600160a01b038c811660048301528b81166024830152604482018a90526064820186905260848201889052831690636a2243a99060a401602060405180830381865afa158015612736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061275a91906132c2565b92506127108311156127a55760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642064656c65676174652066656560601b60448201526064016107c8565b6127b6565b806020015161ffff1692505b8b8311156127fe5760405162461bcd60e51b815260206004820152601560248201527419995948195e18d959591cc81b585e1199595418dd605a1b60448201526064016107c8565b505b600154604051630609d12160e41b81526001600160a01b038681166004830152602482018a90526044820186905260648201889052600092169063609d1210906084016020604051808303816000875af1158015612862573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061288691906132c2565b90506000612894828a61334e565b9050801561290f576002546000906128b69083906001600160801b031661326e565b600280546001600160801b0319166001600160801b03831617905560408051848152602081018390529192507f54b8dd835b48a0b306a9a706a47fc0e08468ce12148a3b645c496018f9852ff9910160405180910390a1505b5061291a888561326e565b6001600160a01b0386166000908152619005602052604090208861ffff8110612945576129456132db565b600291828204019190066010026101000a8154816001600160801b0302191690836001600160801b03160217905550826000146129a25761271061298984836133a7565b6129939190613361565b925061299f838261334e565b90505b6001600160a01b038b16600090815261900660205260409020546129c6908261326e565b90506129d38b8b83612373565b8215612a08576001600160a01b0389166000908152619006602052604081208054859290612a0290849061326e565b90915550505b6001600160a01b03821615612afa576040516346d1a77560e01b81526001600160a01b038c811660048301528b81166024830152604482018a9052606482018390526084820185905260a4820186905260c482018890528316906346d1a7759060e4016020604051808303816000875af1158015612a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aae919061323b565b612afa5760405162461bcd60e51b815260206004820152601a60248201527f44656c65676174652063616c6c6261636b2072656a656374656400000000000060448201526064016107c8565b505050505050505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612b5a908490612b5f565b505050565b6000612bb4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c319092919063ffffffff16565b805190915015612b5a5780806020019051810190612bd2919061323b565b612b5a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107c8565b6060612c408484600085612c48565b949350505050565b606082471015612ca95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107c8565b600080866001600160a01b03168587604051612cc591906133e2565b60006040518083038185875af1925050503d8060008114612d02576040519150601f19603f3d011682016040523d82523d6000602084013e612d07565b606091505b5091509150612d1887838387612d23565b979650505050505050565b60608315612d92578251600003612d8b576001600160a01b0385163b612d8b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107c8565b5081612c40565b612c408383815115612da75781518083602001fd5b8060405162461bcd60e51b81526004016107c891906133fe565b6001600160a01b0381168114612dd657600080fd5b50565b600060208284031215612deb57600080fd5b8135612df681612dc1565b9392505050565b600060208284031215612e0f57600080fd5b5035919050565b60008060408385031215612e2957600080fd5b8235612e3481612dc1565b946020939093013593505050565b600080600060608486031215612e5757600080fd5b8335612e6281612dc1565b92506020840135612e7281612dc1565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715612ebb57612ebb612e83565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612ee957612ee9612e83565b604052919050565b60006001600160401b03821115612f0a57612f0a612e83565b5060051b60200190565b600082601f830112612f2557600080fd5b81356020612f3a612f3583612ef1565b612ec1565b82815260069290921b84018101918181019086841115612f5957600080fd5b8286015b84811015612fa15760408189031215612f765760008081fd5b612f7e612e99565b8135612f8981612dc1565b81528185013585820152835291830191604001612f5d565b509695505050505050565b60008060008060008060c08789031215612fc557600080fd5b8635612fd081612dc1565b9550602087810135612fe181612dc1565b95506040880135945060608801356001600160401b03808216821461300557600080fd5b9094506080890135908082111561301b57600080fd5b818a0191508a601f83011261302f57600080fd5b813561303d612f3582612ef1565b81815260059190911b8301840190848101908d83111561305c57600080fd5b938501935b828510156130905784356001600160801b03811681146130815760008081fd5b82529385019390850190613061565b9650505060a08a01359250808311156130a857600080fd5b50506130b689828a01612f14565b9150509295509295509295565b8015158114612dd657600080fd5b6000806000606084860312156130e657600080fd5b83356130f1816130c3565b925060208401359150604084013561310881612dc1565b809150509250925092565b60008060008060006080868803121561312b57600080fd5b853561313681612dc1565b9450602086013561314681612dc1565b935060408601356001600160401b038082111561316257600080fd5b818801915088601f83011261317657600080fd5b81358181111561318557600080fd5b8960208260051b850101111561319a57600080fd5b96999598505060200195606001359392505050565b600080604083850312156131c257600080fd5b8235915060208301356131d4816130c3565b809150509250929050565b600080600080608085870312156131f557600080fd5b843561320081612dc1565b9350602085013561321081612dc1565b9250604085013561322081612dc1565b9150606085013561323081612dc1565b939692955090935050565b60006020828403121561324d57600080fd5b8151612df6816130c3565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a2c57610a2c613258565b60006020828403121561329357600080fd5b8151612df681612dc1565b6020808252600a908201526927b7363c9037bbb732b960b11b604082015260600190565b6000602082840312156132d457600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b60006001820161330357613303613258565b5060010190565b6020808252825182820181905260009190848201906040850190845b8181101561334257835183529284019291840191600101613326565b50909695505050505050565b81810381811115610a2c57610a2c613258565b60008261337e57634e487b7160e01b600052601260045260246000fd5b500490565b6000806040838503121561339657600080fd5b505080516020909101519092909150565b8082028115828204841417610a2c57610a2c613258565b60005b838110156133d95781810151838201526020016133c1565b50506000910152565b600082516133f48184602087016133be565b9190910192915050565b602081526000825180602084015261341d8160408501602087016133be565b601f01601f1916919091016040019291505056fea26469706673582212205a500bba3b7b3d7d4c89e6ec95b1b390335c62b55cef05f6dda7d748c01a0f4e64736f6c63430008130033

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

0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf8000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c0000000000000000000000003f78544364c3eccdce4d9c89a630aea26122829d000000000000000000000000fd8df0db401ab7ec7a06a8465134fa32132e850c000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba000000000000000000000000d0efdf01dd8d650bba8992e2c42d0bc6d441a673

-----Decoded View---------------
Arg [0] : _prismaCore (address): 0x5d17eA085F2FF5da3e6979D5d26F1dBaB664ccf8
Arg [1] : _token (address): 0xdA47862a83dac0c112BA89c6abC2159b95afd71C
Arg [2] : _locker (address): 0x3f78544364c3eCcDCe4d9C89a630AEa26122829d
Arg [3] : _voter (address): 0xfd8DF0Db401Ab7EC7a06a8465134FA32132e850C
Arg [4] : _stabilityPool (address): 0xed8B26D99834540C5013701bB3715faFD39993Ba
Arg [5] : _manager (address): 0xD0eFDF01DD8d650bBA8992E2c42D0bC6d441a673

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000005d17ea085f2ff5da3e6979d5d26f1dbab664ccf8
Arg [1] : 000000000000000000000000da47862a83dac0c112ba89c6abc2159b95afd71c
Arg [2] : 0000000000000000000000003f78544364c3eccdce4d9c89a630aea26122829d
Arg [3] : 000000000000000000000000fd8df0db401ab7ec7a06a8465134fa32132e850c
Arg [4] : 000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba
Arg [5] : 000000000000000000000000d0efdf01dd8d650bba8992e2c42d0bc6d441a673


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

The total supply of PRISMA is initially minted to this contract. The token balance held here can be considered "uncirculating".

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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