Contract 0x2b36868de0a1b8cf897afc8fe50f2cb78f44e5c7

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x2397eda6fd7f9f3b98f4d76b34d54b77117d9da28d908359f7edfe856881a0240x60806040202045472021-10-14 9:14:522 days 16 mins ago0xce2a22b4b52fc18e4343cc075e9fd8e6c438286f IN  Contract Creation0 MATIC0.15668997
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakeManager

Compiler Version
v0.8.3+commit.8d00100c

Optimization Enabled:
Yes with 50000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 23 : StakeManager.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;
// Base
import './StakeBase.sol';
// OpenZeppelin
import '@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol';
// Interfaces
import '../interfaces/IStakeManager.sol';

import '../libs/AxionSafeCast.sol';

contract StakeManager is IStakeManager, StakeBase {
    using AxionSafeCast for uint256;
    using SafeCastUpgradeable for uint256;
    /* Contract Variables ---------------------------------------------------------------------------------------*/

    Settings internal settings;
    Contracts internal contracts;
    StatFields internal statFields;
    InterestFields internal interestFields;

    uint256[] public interestPerShare;
    mapping(uint256 => StakeData) internal stakeData;
    mapping(uint256 => string) public name;

    /* Set Stakes ------------------------------------------------------------------------------------------------*/

    function recoverStake(
        address staker,
        uint256 start,
        uint256 shares,
        uint256 amount,
        uint256 stakingDays,
        uint256 firstPayout
    ) external override onlyExternalCaller returns (uint256) {
        statFields.lastStakeId++;
        shares = (shares / 1e12) * 1e12; // 1e6 decimals
        amount = (amount / 1e12) * 1e12;

        addToGlobalTotals(amount, shares);
        createStakeInternal(
            NewStake({
                id: statFields.lastStakeId,
                amount: amount,
                shares: shares,
                start: start,
                stakingDays: stakingDays,
                firstInterestDay: firstPayout
            })
        );

        contracts.ventureCapital.addTotalSharesOfAndRebalance(staker, shares); // 15k after first stake
        if (stakingDays >= settings.bpdDayRange) {
            contracts.bpd.addBpdShares(shares, start, stakingDays);
        }

        emit StakeCreated(
            staker,
            statFields.lastStakeId,
            stakeData[statFields.lastStakeId].amount,
            stakeData[statFields.lastStakeId].shares,
            stakeData[statFields.lastStakeId].start,
            stakeData[statFields.lastStakeId].stakingDays
        );

        return statFields.lastStakeId;
    }

    /** Set New Stake
        Description: Add stake to database
        @param staker {address} - Address of staker to add new stake for (Users can stake for eachother?)
        @param amount {uint256} - Amount to stake / burn from wallet
        @param stakingDays {uint256} - Length of stake
    */
    function createStake(
        address staker,
        uint256 amount,
        uint256 stakingDays
    ) external override onlyExternalCaller whenNotPaused returns (uint256) {
        statFields.lastStakeId++; // 7k

        //** TODO: Think about this */
        uint256 shares = getStakersSharesAmountInternal(amount, stakingDays); // 1k gas

        addToGlobalTotals(amount, shares); // 10k
        createStakeInternal( // 35k
            NewStake({
                id: statFields.lastStakeId,
                amount: amount,
                shares: shares,
                start: block.timestamp,
                stakingDays: stakingDays,
                firstInterestDay: interestPerShare.length
            })
        );

        contracts.ventureCapital.addTotalSharesOfAndRebalance(staker, shares); // 15k after first stake

        if (stakingDays >= settings.bpdDayRange) {
            // 30k
            contracts.bpd.addBpdShares(shares, block.timestamp, stakingDays);
        }

        emit StakeCreated( // 5k
            staker,
            statFields.lastStakeId,
            stakeData[statFields.lastStakeId].amount,
            stakeData[statFields.lastStakeId].shares,
            stakeData[statFields.lastStakeId].start,
            stakeData[statFields.lastStakeId].stakingDays
        );

        return statFields.lastStakeId;
    }

    function splitStake(uint256 stakeId, uint256 percentage)
        external
        override
        onlyExternalCaller
        whenNotPaused
        returns (uint256)
    {
        require(stakeData[stakeId].status == StakeStatus.Active, 'MANAGER: Stake not active');

        //** Get new stake id */
        statFields.lastStakeId++;

        //** Get the split amount */
        uint64 splitAmount = ((stakeData[stakeId].amount * uint64(percentage)) / uint64(100));
        uint64 splitShares = ((stakeData[stakeId].shares * uint64(percentage)) / uint64(100));

        //** subtract the split amount from current stake */
        stakeData[stakeId].amount -= splitAmount;
        stakeData[stakeId].shares -= splitShares;

        //** create new stake */
        createStakeInternal(
            NewStake({
                id: statFields.lastStakeId,
                amount: uint256(splitAmount) * 1e12,
                shares: uint256(splitShares) * 1e12,
                start: stakeData[stakeId].start,
                stakingDays: stakeData[stakeId].stakingDays,
                firstInterestDay: stakeData[stakeId].firstInterestDay
            })
        );

        return statFields.lastStakeId;
    }

    /** Upgrade Existing Stake
        Description: Upgrade existing stake layer 3 with max shares (5555 day stake)
        @param id {uint256} - ID should be less then LastSessionIdV3

        Modifier: OnlyExternalCaller - Can only be called by StakeUpgrader
     */
    function upgradeExistingStake(uint256 id, address staker)
        external
        override
        onlyExternalCaller
        whenNotPaused
    {
        upgradeStakeInternal(
            StakeUpgrade({
                id: id,
                staker: staker,
                firstInterestDay: stakeData[id].firstInterestDay,
                shares: uint256(stakeData[id].shares) * 1e12,
                amount: uint256(stakeData[id].amount) * 1e12,
                start: stakeData[id].start,
                stakingDays: stakeData[id].stakingDays
            })
        );
    }

    /** Upgrade Existing Stake Internal (Common)
        Description: Internal reusable components for upgrading Stake
        @param stakeUpgrade {StakeUpgrade} Input Struct
     */
    function upgradeStakeInternal(StakeUpgrade memory stakeUpgrade) internal {
        uint256 newAmount =
            getStakeInterestInternal(
                stakeUpgrade.firstInterestDay,
                stakeUpgrade.stakingDays,
                stakeUpgrade.shares
            ) + stakeUpgrade.amount;

        uint256 intendedEnd =
            stakeUpgrade.start + (settings.secondsInDay * stakeUpgrade.stakingDays);

        // We use "Actual end" so that if a user tries to withdraw their BPD early they don't get the shares
        if (stakeUpgrade.stakingDays >= settings.bpdDayRange) {
            newAmount += contracts.bpd.getBpdAmount(
                stakeUpgrade.shares,
                stakeUpgrade.start,
                block.timestamp < intendedEnd ? block.timestamp : intendedEnd
            );
        }

        //** TODO: Think about this */
        uint256 newShares = getStakersSharesAmountInternal(newAmount, 5555);

        require(
            newShares > stakeUpgrade.shares,
            'STAKING: New shares are not greater then previous shares'
        );

        uint256 newEnd = block.timestamp + (uint256(settings.secondsInDay) * 5555);

        contracts.ventureCapital.addTotalSharesOfAndRebalance(
            stakeUpgrade.staker,
            newShares - stakeUpgrade.shares
        );
        contracts.bpd.addBpdMaxShares(
            stakeUpgrade.shares,
            stakeUpgrade.start,
            stakeUpgrade.start + (uint256(settings.secondsInDay) * stakeUpgrade.stakingDays),
            newShares,
            block.timestamp,
            newEnd
        );

        addToGlobalTotals(
            newAmount - (stakeUpgrade.amount / 1e12) * 1e12,
            newShares - (stakeUpgrade.shares / 1e12) * 1e12
        );

        createStakeInternal(
            NewStake({
                id: stakeUpgrade.id,
                amount: newAmount,
                shares: newShares,
                start: block.timestamp,
                stakingDays: 5555,
                firstInterestDay: interestPerShare.length
            })
        );

        emit StakeUpgraded(
            stakeUpgrade.staker,
            stakeUpgrade.id,
            stakeData[stakeUpgrade.id].amount,
            newAmount,
            stakeData[stakeUpgrade.id].shares,
            newShares,
            block.timestamp,
            newEnd
        );
    }

    /** formula for shares calculation given a number of AXN and a start and end date
        @param amount {uint256} - amount of AXN
        @param stakingDays {uint256}
    */
    function getStakersSharesAmountInternal(uint256 amount, uint256 stakingDays)
        internal
        view
        returns (uint256)
    {
        uint256 numerator = amount * (1819 + stakingDays);
        uint256 denominator = 1820 * uint256(interestFields.shareRate);

        uint256 shares = (numerator * 1e18) / denominator;
        return (shares / 1e12) * 1e12;
    }

    function getStakersSharesAmount(uint256 amount, uint256 stakingDays)
        external
        view
        returns (uint256)
    {
        return getStakersSharesAmountInternal(amount, stakingDays);
    }

    /** add to Global Totals
        @param amount {uint256}
        @param shares {uint256}
     */
    function addToGlobalTotals(uint256 amount, uint256 shares) internal {
        /** Set Global Variables */
        statFields.sharesTotalSupply += (shares / 1e12).toUint72();

        statFields.totalStakedAmount += (amount / 1e12).toUint72();

        statFields.totalVcaRegisteredShares += (shares / 1e12).toUint72();
    }

    /** Set Stake Internal
        @param stake {Stake} - Stake input
     */
    function createStakeInternal(NewStake memory stake) internal {
        //once a day we need to call makePayout which takes the interest earned for the last day and adds it into the payout array
        if (block.timestamp >= interestFields.nextAddInterestTimestamp) addDailyInterest();

        /** Set Stake data */
        stakeData[stake.id].amount = (stake.amount / 1e12).toUint64();
        stakeData[stake.id].shares = (stake.shares / 1e12).toUint64();
        stakeData[stake.id].start = stake.start.toUint40();
        stakeData[stake.id].stakingDays = stake.stakingDays.toUint16();
        stakeData[stake.id].firstInterestDay = stake.firstInterestDay.toUint24();
        stakeData[stake.id].status = StakeStatus.Active;
    }

    /* Unset Stakes ------------------------------------------------------------------------------------------------*/

    /** Unset Stake
        Description: Withdraw stake and close it out
        @param staker {address}
        @param id {uint256}

        Modifier: OnlyExternalCaller - Must be called by StakeBurner
     */
    function unsetStake(
        address staker,
        uint256 id,
        uint256 payout
    ) external override onlyExternalCaller whenNotPaused {
        unsetStakeInternal(
            staker,
            id,
            uint256(stakeData[id].shares) * 1e12,
            uint256(stakeData[id].amount) * 1e12,
            payout
        );
    }

    /** Delete Stake Internal (Common)
        Description: Unset stakes common functinality function
        @param staker {address}
        @param id {uint256}
        @param shares {uint256}
        @param amount {uint256}
        @param payout {uint256}

        Modifier: OnlyExternalCaller - Must be called by StakeBurner
     */
    function unsetStakeInternal(
        address staker,
        uint256 id,
        uint256 shares,
        uint256 amount,
        uint256 payout
    ) internal {
        require(
            stakeData[id].status != StakeStatus.Withdrawn,
            'STAKE MANAGER: Stake withdrawn already.'
        );

        //once a day we need to call makePayout which takes the interest earned for the last day and adds it into the payout array
        if (block.timestamp >= interestFields.nextAddInterestTimestamp) addDailyInterest();

        // Subtract shares from IVentureCapital and rebalance
        contracts.ventureCapital.subTotalSharesOfAndRebalance(staker, shares);

        // Remove from global totals
        removeFromGlobalTotals(amount, shares);

        // Update payout and status to withdrawn
        stakeData[id].payout = (payout / 1e18).toUint40();
        stakeData[id].status = StakeStatus.Withdrawn;

        // Emit Event
        emit StakeDeleted(
            staker,
            id.toUint128(),
            stakeData[id].amount,
            stakeData[id].shares,
            stakeData[id].start,
            stakeData[id].stakingDays,
            block.timestamp
        );
    }

    /** @dev remove from global totals
        Description: Remove amount and shares from global totals.
        @param amount {uint256}
        @param shares {uint256}
     */
    function removeFromGlobalTotals(uint256 amount, uint256 shares) internal {
        /** Set Global Variables */
        statFields.sharesTotalSupply -= (shares / 1e12).toUint72();
        statFields.totalStakedAmount -= (amount / 1e12).toUint72();
        statFields.totalVcaRegisteredShares -= (shares / 1e12).toUint72();
    }

    /** Get the interest earned for a particular stake.
        Description: staking interest calculation goes through the payout array and calculates the interest based on the number of shares the user has and the payout for every day
        @param firstInterestDay {uint256} - Beginning of stake days since start of contract
        @param stakingDays {uint256} - Stake days
        @param shares {uint256} - # of shares for stake
     */
    function getStakeInterestInternal(
        uint256 firstInterestDay,
        uint256 stakingDays,
        uint256 shares
    ) internal view returns (uint256) {
        uint256 lastInterest;
        uint256 firstInterest;
        uint256 lastInterestDay = firstInterestDay + stakingDays;

        if (interestPerShare.length != 0) {
            lastInterest = interestPerShare[
                interestPerShare.length - 1 < lastInterestDay - 1
                    ? interestPerShare.length - 1
                    : lastInterestDay - 1
            ];
        }

        if (firstInterestDay != 0) {
            firstInterest = interestPerShare[firstInterestDay - 1];
        }

        return (shares * (lastInterest - firstInterest)) / 1e26;
    }

    function getStakeInterest(
        uint256 firstInterestDay,
        uint256 stakingDays,
        uint256 shares
    ) external view override returns (uint256) {
        return getStakeInterestInternal(firstInterestDay, stakingDays, shares);
    }

    function getStakeAndInterestById(uint256 stakeId)
        external
        view
        override
        returns (
            uint256 start,
            uint256 stakingDays,
            uint256 amount,
            uint256 shares,
            uint256 interest
        )
    {
        start = stakeData[stakeId].start;
        stakingDays = stakeData[stakeId].stakingDays;
        amount = uint256(stakeData[stakeId].amount) * 1e12;
        shares = uint256(stakeData[stakeId].shares) * 1e12;

        interest = getStakeInterestInternal(
            stakeData[stakeId].firstInterestDay,
            stakeData[stakeId].stakingDays,
            uint256(stakeData[stakeId].shares) * 1e12
        );
    }

    /** Interest ---------------------------------------------------------------------------- */

    /** Add Daily Interest
        Description: Runs once per day and takes all the AXN earned as interest and puts it into payout array for the day
    */
    // 179470
    function addDailyInterest() public {
        require(
            block.timestamp >= interestFields.nextAddInterestTimestamp,
            'Staking: Too early to add interest.'
        );
        uint256 todaysSharePayout; // free
        uint256 interest = getTodaysInterest();
        if (statFields.sharesTotalSupply == 0) {
            statFields.sharesTotalSupply = 1e6;
        } // Is this necessary? cost 1000 gas for the if statement, 212832.. Only needed for testing?

        // This if clause is only needed for testing it seems....
        if (interestPerShare.length != 0) {
            todaysSharePayout =
                interestPerShare[interestPerShare.length - 1] +
                ((interest * 1e26) / ((uint256(statFields.sharesTotalSupply) * 1e12)));
        } else {
            todaysSharePayout =
                (interest * 1e26) /
                ((uint256(statFields.sharesTotalSupply) * 1e12));
        }

        interestPerShare.push(todaysSharePayout);
        interestFields.nextAddInterestTimestamp += settings.secondsInDay;
        // // call updateShareRate once a day as sharerate increases based on the daily Payout amount
        updateShareRate(interest);
        emit DailyInterestAdded(
            interest,
            statFields.sharesTotalSupply,
            todaysSharePayout,
            block.timestamp
        );
    }

    /** Get Todays Interest
        Description: Get # of circulating supply and total in stakemanager contract add 8% yearly
     */
    function getTodaysInterest() internal returns (uint256) {
        uint256 amountTokenInDay = IERC20Upgradeable(contracts.token).balanceOf(address(this));
        IERC20Upgradeable(contracts.token).transfer(
            0x000000000000000000000000000000000000dEaD,
            amountTokenInDay
        ); // Send to dead address
        uint256 balanceOfDead =
            IERC20Upgradeable(contracts.token).balanceOf(
                0x000000000000000000000000000000000000dEaD
            );

        uint256 currentTokenTotalSupply = contracts.token.totalSupply() - balanceOfDead;
        uint256 inflation =
            (interestFields.APR *
                (currentTokenTotalSupply + (uint256(statFields.totalStakedAmount) * 1e12))) / 36500;

        return inflation;
    }

    /** Update Share Rate
        Description: function to increase the share rate price this happens on the first stake of every 'axion day' 12:04 utc
        @param _payout {uint} - amount of AXN that was bought back through the regular auction + 8% yearly amount
    */
    function updateShareRate(uint256 _payout) internal {
        uint256 currentTokenTotalSupply = contracts.token.totalSupply(); // 718485214285714285714285714

        uint256 growthFactor =
            (_payout * 1e18) /
                (currentTokenTotalSupply + (uint256(statFields.totalStakedAmount) * 1e12) + 1); //we calculate the total AXN supply as circulating + staked

        if (settings.shareRateScalingFactor == 0) {
            //use a shareRateScalingFactor which can be set in order to tune the speed of shareRate increase
            settings.shareRateScalingFactor = 1e18;
        }

        interestFields.shareRate = (
            ((uint256(interestFields.shareRate) *
                (1e36 + (uint256(settings.shareRateScalingFactor) * growthFactor))) / 1e36)
        )
            .toUint128(); //1e18 used for precision.
    }

    /** Set stake name
        @param newName {string}
        @param stakeId {uint256}
     */
    function setStakeName(string memory newName, uint256 stakeId)
        external
        override
        onlyExternalCaller
    {
        name[stakeId] = newName;
    }

    /** Utility ------------------------------------------------------------------ */

    /** Add Total VCA Registered Shares
        Description: Add to the total registered shares

        @param shares {uint256}
     */
    function addTotalVcaRegisteredShares(uint256 shares) external override onlyExternalCaller {
        statFields.totalVcaRegisteredShares += (shares / 1e12).toUint72();
    }

    /* Getters ------------------------------------------------------------------------------------------------*/

    /** Get Stake
        @param id {uint256}

        @return {StakeData}
     */
    function getStake(uint256 id) external view override returns (StakeData1e18 memory) {
        return
            StakeData1e18(
                uint256(stakeData[id].amount) * 1e12,
                uint256(stakeData[id].shares) * 1e12,
                stakeData[id].start,
                stakeData[id].stakingDays,
                stakeData[id].firstInterestDay,
                uint256(stakeData[id].payout) * 1e18,
                stakeData[id].status,
                name[id]
            );
    }

    function getStakeUri(uint256 id) external view override returns (StakeUri memory) {
        return
            StakeUri(
                name[id],
                stakeData[id].amount,
                stakeData[id].shares,
                stakeData[id].stakingDays,
                stakeData[id].payout,
                stakeData[id].status
            );
    }

    /** Get Stake
        @param id {uint256}

        @return {uint256} - End date in seconds of stake
     */
    function getStakeEnd(uint256 id) external view override returns (uint256) {
        return stakeData[id].start + (settings.secondsInDay * stakeData[id].stakingDays);
    }

    function getStakeShares(uint256 id) external view override returns (uint256) {
        return uint256(stakeData[id].shares) * 1e12;
    }

    /** Get Stake Withdrawn
        @param id {uint256}

        @return {bool} - Stake withdrawn
     */
    function getStakeWithdrawnOrExists(uint256 id) external view override returns (bool) {
        return
            stakeData[id].status == StakeStatus.Withdrawn ||
            stakeData[id].status != StakeStatus.Unknown;
    }

    /** get Total VCA Registered Shares
        Description: This function will return the total registered shares for VCA
        This differs from the total share supply due to the fact of V1 and V2 layer

        @return {uint256} - Total Registered Shares for VCA
     */
    function getTotalVcaRegisteredShares() external view override returns (uint256) {
        return uint256(statFields.totalVcaRegisteredShares) * 1e12;
    }

    function getStatFields() external view returns (StatFields memory) {
        return statFields;
    }

    function getInterestFields() external view returns (InterestFields memory) {
        return interestFields;
    }

    function getAPR() external view override returns (uint256) {
        return interestFields.APR;
    }

    function getSettings() external view returns (Settings memory) {
        return settings;
    }

    function getDaysFromStart() external view returns (uint256) {
        return (block.timestamp - settings.contractStartTimestamp) / settings.secondsInDay;
    }

    /** Setters ------------------------------------------------------------------------------------------------*/
    function setAPR(uint256 _apr) external onlyManager {
        interestFields.APR = _apr;
    }

    /** Initialize ------------------------------------------------------------------------------------------------*/

    /** Upgradeable Initialize Function
        @param _manager {address} - Address for contract manager (Gnosis Wallet) 
        @param _migrator {address} - Address for contract migrator (Deployer Addres)
     */
    function initialize(address _manager, address _migrator) external initializer {
        _setupRole(MANAGER_ROLE, _manager);
        _setupRole(MIGRATOR_ROLE, _migrator);
    }

    function init(
        address _stakeUtilities,
        address _stakeMinter,
        address _stakeBurner,
        address _stakeUpgrader,
        address _token,
        address _ventureCapital,
        address _bpd
    ) external onlyMigrator {
        _setupRole(EXTERNAL_CALLER_ROLE, _stakeMinter);
        _setupRole(EXTERNAL_CALLER_ROLE, _stakeBurner);
        _setupRole(EXTERNAL_CALLER_ROLE, _stakeUpgrader);
        _setupRole(EXTERNAL_CALLER_ROLE, _ventureCapital);
        _setupRole(EXTERNAL_CALLER_ROLE, _stakeUtilities);

        contracts.token = IToken(_token);
        contracts.ventureCapital = IVentureCapital(_ventureCapital);
        contracts.bpd = IBpd(_bpd);
    }

    function restore(
        uint128 _shareRateScalingFactor,
        uint32 _secondsInDay,
        uint64 _contractStartTimestamp,
        uint32 _bpdDayRange,
        uint128 _shareRate,
        uint128 _nextAddInterestTimestamp
    ) external onlyMigrator {
        settings.shareRateScalingFactor = _shareRateScalingFactor;
        settings.secondsInDay = _secondsInDay;
        settings.contractStartTimestamp = _contractStartTimestamp;
        settings.bpdDayRange = _bpdDayRange;
        interestFields.shareRate = _shareRate;
        interestFields.nextAddInterestTimestamp = _nextAddInterestTimestamp;
        interestFields.APR = 8;
        /** Stat fields will be added as we add the stakes back in */
    }

    function restorePayouts(uint256[] calldata payouts, uint256[] calldata shares)
        external
        onlyMigrator
    {
        require(payouts.length < 21, 'MANAGER: Sending too much data');
        require(payouts.length == shares.length, 'MANAGER: Payout.length != shares.length');

        for (uint256 i = 0; i < payouts.length; i++) {
            uint256 sharesTotalSupply = shares[i];

            if (sharesTotalSupply == 0) {
                sharesTotalSupply = 1e18;
            }

            if (interestPerShare.length != 0) {
                interestPerShare.push(
                    interestPerShare[interestPerShare.length - 1] +
                        ((payouts[i] * 1e26) / sharesTotalSupply)
                );
            } else {
                interestPerShare.push((payouts[i] * 1e26) / sharesTotalSupply);
            }
        }
    }
}

File 2 of 23 : StakeBase.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

// Abstracts
import '../abstracts/Pausable.sol';
import '../abstracts/ExternallyCallable.sol';
// Interfaces
import '../interfaces/IBpd.sol';
import '../interfaces/IToken.sol';
import '../interfaces/IVentureCapital.sol';

import '../enums/StakeStatus.sol';

contract StakeBase is Pausable, ExternallyCallable {
    struct StakeData {
        uint64 amount; //1e-6
        uint64 shares; //1e-6
        uint40 start;
        uint16 stakingDays;
        uint24 firstInterestDay;
        uint40 payout; // 0dps
        StakeStatus status;
    }

    struct NewStake {
        uint256 id; // Id of stake, should either be lastStakeId for new, or <= sessionId for set existings
        uint256 amount; // # of initial axion
        uint256 shares; // # of shares owned for stake
        uint256 start; // Start date in seconds
        uint256 stakingDays; // Number of staking days (start - end) / secondsInDay
        uint256 firstInterestDay; // first day of divs
    }

    /*----------------------------------------------------------------------------------------------------------------------------------------------*/

    event StakeCreated(
        address indexed account,
        uint128 indexed sessionId,
        uint80 amount,
        uint80 shares,
        uint40 start,
        uint16 stakingDays
    );

    event StakeDeleted(
        address indexed account,
        uint128 indexed sessionId,
        uint80 amount,
        uint80 shares,
        uint40 start,
        uint16 stakingDays,
        uint256 end
    );

    event StakeUpgraded(
        address indexed account,
        uint256 indexed sessionId,
        uint256 amount,
        uint256 newAmount,
        uint256 shares,
        uint256 newShares,
        uint256 start,
        uint256 end
    );

    event DailyInterestAdded(
        uint256 indexed value,
        uint256 indexed sharesTotalSupply,
        uint256 sharePayout,
        uint256 indexed time
    );

    /*----------------------------------------------------------------------------------------------------------------------------------------------*/

    struct Settings {
        //256 bits
        uint128 shareRateScalingFactor; //scaling factor, default 1 to be used on the shareRate calculation
        uint32 secondsInDay; // 24h * 60 * 60
        uint64 contractStartTimestamp; //time the contract started
        uint32 bpdDayRange; //350 days, time of the first BPD
    }

    struct InterestFields {
        uint256 APR;
        //256 bits
        uint128 shareRate; //shareRate used to calculate the number of shares
        uint128 nextAddInterestTimestamp; //used to calculate when the daily makePayout() should run
    }

    struct StatFields {
        //256 bits
        uint72 totalStakedAmount; // 1-e6 total amount of staked AXN
        uint72 sharesTotalSupply; // 1-e6 total shares supply
        uint72 totalVcaRegisteredShares; // 1-e6 total number of shares from accounts that registered for the VCA
        uint40 lastStakeId; //the ID of the last stake
    }

    struct Contracts {
        IToken token;
        IVentureCapital ventureCapital;
        IBpd bpd;
    }
}

File 3 of 23 : SafeCastUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCastUpgradeable {
    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 4 of 23 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 23 : IStakeManager.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import '../enums/StakeStatus.sol';

struct StakeData1e18 {
    uint256 amount;
    uint256 shares;
    uint256 start;
    uint256 stakingDays;
    uint256 firstInterestDay;
    uint256 payout;
    StakeStatus status;
    string name;
}

struct StakeUpgrade {
    uint256 id; // Id of stake
    address staker;
    uint256 firstInterestDay; // first day of divs
    uint256 shares; // # of shares owned for stake
    uint256 amount; // # amount of initial axn
    uint256 start; // Start Date in sconds
    uint256 stakingDays; // End date in seconds
}

struct StakeUri {
    string name;
    uint64 amount; //1e-6
    uint64 shares; //1e-6
    uint16 stakingDays;
    uint40 payout; // 0dps
    StakeStatus status;
}

interface IStakeManager {
    function recoverStake(
        address staker,
        uint256 start,
        uint256 shares,
        uint256 amount,
        uint256 stakingDays,
        uint256 firstPayout
    ) external returns (uint256);

    function getAPR() external view returns (uint256);

    function createStake(
        address staker,
        uint256 amount,
        uint256 stakingDays
    ) external returns (uint256);

    function upgradeExistingStake(uint256 id, address staker) external;

    function setStakeName(string memory newName, uint256 stakeId) external;

    function unsetStake(
        address staker,
        uint256 id,
        uint256 payout
    ) external;

    function getStake(uint256 id) external returns (StakeData1e18 memory);

    function getStakeEnd(uint256 id) external view returns (uint256);

    function getStakeShares(uint256 id) external view returns (uint256);

    function getStakeUri(uint256 id) external view returns (StakeUri memory);

    function getStakeInterest(
        uint256 firstInterestDay,
        uint256 stakingDays,
        uint256 shares
    ) external view returns (uint256);

    function splitStake(uint256 stakeId, uint256 percentage) external returns (uint256);

    function getStakeAndInterestById(uint256 stakeId)
        external
        view
        returns (
            uint256 start,
            uint256 stakingDays,
            uint256 amount,
            uint256 shares,
            uint256 interest
        );

    function getStakeWithdrawnOrExists(uint256 id) external view returns (bool);

    function getTotalVcaRegisteredShares() external view returns (uint256);

    function addTotalVcaRegisteredShares(uint256 shares) external;
}

File 6 of 23 : AxionSafeCast.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

library AxionSafeCast {
    function toUint24(uint256 value) internal pure returns (uint24) {
        require(value < 2**24, "SafeCast: value doesn't fit in 24 bits");
        return uint24(value);
    }

    function toUint40(uint256 value) internal pure returns (uint40) {
        require(value < 2**40, "SafeCast: value doesn't fit in 40 bits");
        return uint40(value);
    }

    function toUint48(uint256 value) internal pure returns (uint48) {
        require(value < 2**48, "SafeCast: value doesn't fit in 48 bits");
        return uint48(value);
    }

    function toUint72(uint256 value) internal pure returns (uint72) {
        require(value < 2**72, "SafeCast: value doesn't fit in 72 bits");
        return uint72(value);
    }

    function toUint88(uint256 value) internal pure returns (uint88) {
        require(value < 2**88, "SafeCast: value doesn't fit in 88 bits");
        return uint88(value);
    }
}

File 7 of 23 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import './Manageable.sol';
import './Migrateable.sol';

abstract contract Pausable is Manageable, Migrateable {
    event SetPaused(bool paused);

    modifier whenNotPaused() {
        require(
            paused == false ||
                hasRole(MIGRATOR_ROLE, msg.sender) ||
                hasRole(MANAGER_ROLE, msg.sender),
            'Function is paused'
        );
        _;
    }

    bool internal paused;

    function setPaused(bool _paused) external {
        require(
            hasRole(MIGRATOR_ROLE, msg.sender) || hasRole(MANAGER_ROLE, msg.sender),
            'Caller must be manager or migrator'
        );

        paused = _paused;
        emit SetPaused(_paused);
    }

    function getPaused() external view returns (bool) {
        return paused;
    }
}

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

pragma solidity >=0.8.0;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";

abstract contract ExternallyCallable is AccessControlUpgradeable {
    bytes32 public constant EXTERNAL_CALLER_ROLE = keccak256('EXTERNAL_CALLER_ROLE');

    modifier onlyExternalCaller() {
        require(
            hasRole(EXTERNAL_CALLER_ROLE, msg.sender),
            'Caller is not allowed'
        );
        _;
    }
}

File 9 of 23 : IBpd.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IBpd {
    function addBpdShares(
        uint256 shares,
        uint256 start,
        uint256 stakingDays
    ) external;

    function addBpdMaxShares(
        uint256 oldShares,
        uint256 oldStart,
        uint256 oldEnd,
        uint256 newShares,
        uint256 newStart,
        uint256 newEnd
    ) external;

    function getBpdAmount(
        uint256 shares,
        uint256 start,
        uint256 end
    ) external view returns (uint256);
}

File 10 of 23 : IToken.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import '@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol';

interface IToken is IERC20Upgradeable {
    function mint(address to, uint256 amount) external;

    function burn(address from, uint256 amount) external;
}

File 11 of 23 : IVentureCapital.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface IVentureCapital {
    function addTotalSharesOfAndRebalance(address staker, uint256 shares) external;

    function subTotalSharesOfAndRebalance(address staker, uint256 shares) external;

    function withdrawDivTokensFromToExternal(address from, address payable to) external;

    function withdrawDivTokensToAccelerator(address from, address tokenAddress, address payable acceleratorAddress) external;

    function transferSharesAndRebalance(
        address from,
        address to,
        uint256 shares
    ) external;

    function updateTokenPricePerShare(address tokenAddress, uint256 amountBought) external payable;

    function addDivToken(address tokenAddress) external;

    function getTokenInterestEarned(address accountAddress, address tokenAddress) external view returns (uint256);
}

File 12 of 23 : StakeStatus.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

enum StakeStatus {Unknown, Withdrawn, Active}

File 13 of 23 : Manageable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";

abstract contract Manageable is AccessControlUpgradeable {
    bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");

    modifier onlyManager() {
        require(
            hasRole(MANAGER_ROLE, msg.sender),
            "Caller is not a manager"
        );
        _;
    }

    /** Roles management - only for multi sig address */
    function setupRole(bytes32 role, address account) external onlyManager {
        _setupRole(role, account);
    }

    function isManager(address account) external view returns (bool) {
        return hasRole(MANAGER_ROLE, account);
    }
}

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

pragma solidity >=0.8.0;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";

abstract contract Migrateable is AccessControlUpgradeable {
    bytes32 public constant MIGRATOR_ROLE = keccak256("MIGRATOR_ROLE");

    modifier onlyMigrator() {
        require(
            hasRole(MIGRATOR_ROLE, msg.sender),
            "Caller is not a migrator"
        );
        _;
    }
}

File 15 of 23 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

    function __AccessControl_init_unchained() internal initializer {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

File 16 of 23 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 17 of 23 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

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

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

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 18 of 23 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

File 19 of 23 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    function __ERC165_init_unchained() internal initializer {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

File 20 of 23 : Initializable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 21 of 23 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 22 of 23 : ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

        return true;
    }

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

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

        return true;
    }

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

        _beforeTokenTransfer(sender, recipient, amount);

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

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 23 of 23 : IERC20MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";

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

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

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

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"sharesTotalSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharePayout","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"time","type":"uint256"}],"name":"DailyInterestAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"SetPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint128","name":"sessionId","type":"uint128"},{"indexed":false,"internalType":"uint80","name":"amount","type":"uint80"},{"indexed":false,"internalType":"uint80","name":"shares","type":"uint80"},{"indexed":false,"internalType":"uint40","name":"start","type":"uint40"},{"indexed":false,"internalType":"uint16","name":"stakingDays","type":"uint16"}],"name":"StakeCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint128","name":"sessionId","type":"uint128"},{"indexed":false,"internalType":"uint80","name":"amount","type":"uint80"},{"indexed":false,"internalType":"uint80","name":"shares","type":"uint80"},{"indexed":false,"internalType":"uint40","name":"start","type":"uint40"},{"indexed":false,"internalType":"uint16","name":"stakingDays","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"end","type":"uint256"}],"name":"StakeDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"sessionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"end","type":"uint256"}],"name":"StakeUpgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXTERNAL_CALLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIGRATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addDailyInterest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"addTotalVcaRegisteredShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"stakingDays","type":"uint256"}],"name":"createStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAPR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDaysFromStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInterestFields","outputs":[{"components":[{"internalType":"uint256","name":"APR","type":"uint256"},{"internalType":"uint128","name":"shareRate","type":"uint128"},{"internalType":"uint128","name":"nextAddInterestTimestamp","type":"uint128"}],"internalType":"struct StakeBase.InterestFields","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSettings","outputs":[{"components":[{"internalType":"uint128","name":"shareRateScalingFactor","type":"uint128"},{"internalType":"uint32","name":"secondsInDay","type":"uint32"},{"internalType":"uint64","name":"contractStartTimestamp","type":"uint64"},{"internalType":"uint32","name":"bpdDayRange","type":"uint32"}],"internalType":"struct StakeBase.Settings","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getStake","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stakingDays","type":"uint256"},{"internalType":"uint256","name":"firstInterestDay","type":"uint256"},{"internalType":"uint256","name":"payout","type":"uint256"},{"internalType":"enum StakeStatus","name":"status","type":"uint8"},{"internalType":"string","name":"name","type":"string"}],"internalType":"struct StakeData1e18","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"getStakeAndInterestById","outputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stakingDays","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"interest","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getStakeEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"firstInterestDay","type":"uint256"},{"internalType":"uint256","name":"stakingDays","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"getStakeInterest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getStakeShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getStakeUri","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint64","name":"amount","type":"uint64"},{"internalType":"uint64","name":"shares","type":"uint64"},{"internalType":"uint16","name":"stakingDays","type":"uint16"},{"internalType":"uint40","name":"payout","type":"uint40"},{"internalType":"enum StakeStatus","name":"status","type":"uint8"}],"internalType":"struct StakeUri","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getStakeWithdrawnOrExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"stakingDays","type":"uint256"}],"name":"getStakersSharesAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStatFields","outputs":[{"components":[{"internalType":"uint72","name":"totalStakedAmount","type":"uint72"},{"internalType":"uint72","name":"sharesTotalSupply","type":"uint72"},{"internalType":"uint72","name":"totalVcaRegisteredShares","type":"uint72"},{"internalType":"uint40","name":"lastStakeId","type":"uint40"}],"internalType":"struct StakeBase.StatFields","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalVcaRegisteredShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeUtilities","type":"address"},{"internalType":"address","name":"_stakeMinter","type":"address"},{"internalType":"address","name":"_stakeBurner","type":"address"},{"internalType":"address","name":"_stakeUpgrader","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_ventureCapital","type":"address"},{"internalType":"address","name":"_bpd","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_manager","type":"address"},{"internalType":"address","name":"_migrator","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"interestPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"stakingDays","type":"uint256"},{"internalType":"uint256","name":"firstPayout","type":"uint256"}],"name":"recoverStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_shareRateScalingFactor","type":"uint128"},{"internalType":"uint32","name":"_secondsInDay","type":"uint32"},{"internalType":"uint64","name":"_contractStartTimestamp","type":"uint64"},{"internalType":"uint32","name":"_bpdDayRange","type":"uint32"},{"internalType":"uint128","name":"_shareRate","type":"uint128"},{"internalType":"uint128","name":"_nextAddInterestTimestamp","type":"uint128"}],"name":"restore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"payouts","type":"uint256[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"}],"name":"restorePayouts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_apr","type":"uint256"}],"name":"setAPR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newName","type":"string"},{"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"setStakeName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"setupRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeId","type":"uint256"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"splitStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"payout","type":"uint256"}],"name":"unsetStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"staker","type":"address"}],"name":"upgradeExistingStake","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50615e7980620000216000396000f3fe608060405234801561001057600080fd5b50600436106102e75760003560e01c806386bb5d0911610191578063c922bdee116100e3578063ec87621c11610097578063f3ae241511610071578063f3ae24151461090e578063f6da95b914610921578063fa82ac7614610934576102e7565b8063ec87621c1461082c578063f0d4d59214610853578063f2dca64c14610866576102e7565b8063d547741f116100c8578063d547741f146107f3578063dc31045114610806578063dddda80014610819576102e7565b8063c922bdee146107c0578063ce325bf8146107d3576102e7565b8063b2acd29411610145578063b8d9a37b1161011f578063b8d9a37b14610792578063c0712cad146107a5578063c89d5b8b146107b8576102e7565b8063b2acd29414610759578063b5b63d681461076c578063b78deb4f1461077f576102e7565b806391d148541161017657806391d14854146106f8578063a03076781461073e578063a217fddf14610751576102e7565b806386bb5d09146106b55780638bf0890a146106f0576102e7565b806336568abe1161024a5780636fae2e15116101fe5780638194d820116101d85780638194d82014610576578063854303cf1461058957806385b4bb531461059c576102e7565b80636fae2e151461044e5780636fe0dab814610475578063766395b114610563576102e7565b8063485cc9551161022f578063485cc955146104105780635de5dff6146104235780636805b84b14610443576102e7565b806336568abe146103ea5780633c09cfc6146103fd576102e7565b806316c38b3c116102a1578063248a9ca311610286578063248a9ca3146103a15780632f2ff15d146103c457806334f41e80146103d7576102e7565b806316c38b3c146103795780631d6116f01461038e576102e7565b806301ffc9a7116102d257806301ffc9a71461032757806308a790291461034a5780630a6ab9da14610371576102e7565b80624a482b146102ec578062ad800c14610307575b600080fd5b6102f4610947565b6040519081526020015b60405180910390f35b61031a6103153660046156a2565b6109a3565b6040516102fe91906159d7565b61033a6103353660046156dc565b610a3d565b60405190151581526020016102fe565b6102f47f537f2b5f6ff8219c3d956b1dc717dcdcf7223a3b31bb5c99bb8d12a00d616b6d81565b6102f4610ad8565b61038c61038736600461566a565b610b0e565b005b61038c61039c3660046156a2565b610c6f565b6102f46103af3660046156a2565b60009081526065602052604090206001015490565b61038c6103d23660046156ba565b610d7c565b61038c6103e5366004615586565b610da8565b61038c6103f83660046156ba565b610f89565b6102f461040b366004615586565b61103c565b61038c61041e3660046154cf565b6114ec565b6104366104313660046156a2565b611657565b6040516102fe9190615a56565b60975460ff1661033a565b6102f47f600e5f1c60beb469a3fa6dd3814a4ae211cc6259a6d033bae218a742f2af01d381565b61051a6040805160808101825260008082526020820181905291810182905260608101919091525060408051608081018252609c5468ffffffffffffffffff808216835269010000000000000000008204811660208401527201000000000000000000000000000000000000820416928201929092527b0100000000000000000000000000000000000000000000000000000090910464ffffffffff16606082015290565b60408051825168ffffffffffffffffff908116825260208085015182169083015283830151169181019190915260609182015164ffffffffff16918101919091526080016102fe565b6102f46105713660046158a6565b61182a565b6102f46105843660046156a2565b61183f565b61038c6105973660046156a2565b611860565b61065a60408051608081018252600080825260208201819052918101829052606081019190915250604080516080810182526098546fffffffffffffffffffffffffffffffff8116825263ffffffff70010000000000000000000000000000000082048116602084015267ffffffffffffffff74010000000000000000000000000000000000000000830416938301939093527c01000000000000000000000000000000000000000000000000000000009004909116606082015290565b6040516102fe919081516fffffffffffffffffffffffffffffffff16815260208083015163ffffffff9081169183019190915260408084015167ffffffffffffffff1690830152606092830151169181019190915260800190565b6106c86106c33660046156a2565b6118fd565b604080519586526020860194909452928401919091526060830152608082015260a0016102fe565b61038c611a24565b61033a6107063660046156ba565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6102f461074c3660046156a2565b611d50565b6102f4600081565b61038c6107673660046156ba565b611d84565b61038c61077a3660046157ec565b612021565b61033a61078d3660046156a2565b6121b3565b6102f46107a0366004615885565b6122a1565b61038c6107b336600461571c565b6122b4565b609d546102f4565b6102f46107ce3660046155b8565b61236b565b6107e66107e13660046156a2565b612773565b6040516102fe91906159ea565b61038c6108013660046156ba565b6129c7565b6102f4610814366004615885565b6129ed565b61038c610827366004615601565b612ed8565b6102f47f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b61038c610861366004615501565b613242565b6108d260408051606081018252600080825260208201819052918101919091525060408051606081018252609d548152609e546fffffffffffffffffffffffffffffffff8082166020840152700100000000000000000000000000000000909104169181019190915290565b60408051825181526020808401516fffffffffffffffffffffffffffffffff9081169183019190915292820151909216908201526060016102fe565b61033a61091c3660046154b5565b613414565b6102f461092f3660046156a2565b613461565b61038c6109423660046156ba565b6134fb565b609854600090700100000000000000000000000000000000810463ffffffff16906109949074010000000000000000000000000000000000000000900467ffffffffffffffff1642615c2c565b61099e9190615b61565b905090565b60a160205260009081526040902080546109bc90615cf3565b80601f01602080910402602001604051908101604052809291908181526020018280546109e890615cf3565b8015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b505050505081565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610ad057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b90505b919050565b609c5460009061099e907201000000000000000000000000000000000000900468ffffffffffffffffff1664e8d4a51000615b9c565b3360009081527fef6f2468858ed34109a38be3b61b4af14274d50a88a6bc0eb799e1ca6dc2f621602052604090205460ff1680610b7957503360009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604090205460ff165b610c0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f43616c6c6572206d757374206265206d616e61676572206f72206d696772617460448201527f6f7200000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215159081179091556040519081527f3c70af01296aef045b2f5c9d3c30b05d4428fd257145b9c7fcd76418e65b59809060200160405180910390a150565b3360009081527f1858bf92c9c8978e4424cd219d3c5c2f2793c5893637bc6efd650dbcdf9435c4602052604090205460ff16610d07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43616c6c6572206973206e6f7420616c6c6f77656400000000000000000000006044820152606401610c01565b610d1e610d1964e8d4a5100083615b61565b61359d565b609c8054601290610d519084907201000000000000000000000000000000000000900468ffffffffffffffffff16615b3d565b92506101000a81548168ffffffffffffffffff021916908368ffffffffffffffffff16021790555050565b600082815260656020526040902060010154610d9981335b61363c565b610da3838361370e565b505050565b3360009081527f1858bf92c9c8978e4424cd219d3c5c2f2793c5893637bc6efd650dbcdf9435c4602052604090205460ff16610e40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43616c6c6572206973206e6f7420616c6c6f77656400000000000000000000006044820152606401610c01565b60975460ff161580610e8057503360009081527fef6f2468858ed34109a38be3b61b4af14274d50a88a6bc0eb799e1ca6dc2f621602052604090205460ff165b80610eb957503360009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604090205460ff165b610f1f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f46756e6374696f6e2069732070617573656400000000000000000000000000006044820152606401610c01565b600082815260a06020526040902054610da39084908490610f5b9068010000000000000000900467ffffffffffffffff1664e8d4a51000615b9c565b600086815260a06020526040902054610f839067ffffffffffffffff1664e8d4a51000615b9c565b85613802565b73ffffffffffffffffffffffffffffffffffffffff8116331461102e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610c01565b6110388282613b70565b5050565b3360009081527f1858bf92c9c8978e4424cd219d3c5c2f2793c5893637bc6efd650dbcdf9435c4602052604081205460ff166110d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43616c6c6572206973206e6f7420616c6c6f77656400000000000000000000006044820152606401610c01565b60975460ff16158061111457503360009081527fef6f2468858ed34109a38be3b61b4af14274d50a88a6bc0eb799e1ca6dc2f621602052604090205460ff165b8061114d57503360009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604090205460ff165b6111b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f46756e6374696f6e2069732070617573656400000000000000000000000000006044820152606401610c01565b609c80547b01000000000000000000000000000000000000000000000000000000900464ffffffffff1690601b6111e983615d80565b91906101000a81548164ffffffffff021916908364ffffffffff1602179055505060006112168484613c2b565b90506112228482613cb6565b6040805160c081018252609c547b01000000000000000000000000000000000000000000000000000000900464ffffffffff1681526020810186905290810182905242606082015260808101849052609f5460a082015261128290613de6565b609a546040517fb58191f400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152602482018490529091169063b58191f490604401600060405180830381600087803b1580156112f657600080fd5b505af115801561130a573d6000803e3d6000fd5b50506098547c0100000000000000000000000000000000000000000000000000000000900463ffffffff16851091506113d1905057609b546040517f8d897bb1000000000000000000000000000000000000000000000000000000008152600481018390524260248201526044810185905273ffffffffffffffffffffffffffffffffffffffff90911690638d897bb190606401600060405180830381600087803b1580156113b857600080fd5b505af11580156113cc573d6000803e3d6000fd5b505050505b609c547b01000000000000000000000000000000000000000000000000000000900464ffffffffff908116600081815260a0602090815260409182902054825167ffffffffffffffff80831682526801000000000000000083041692810192909252700100000000000000000000000000000000810490941691810191909152750100000000000000000000000000000000000000000090920461ffff1660608301529073ffffffffffffffffffffffffffffffffffffffff8716907f80129bc2689f74439bd2ea772218ca57cdda11db66c547c5875afdf6c3b8e2569060800160405180910390a35050609c547b01000000000000000000000000000000000000000000000000000000900464ffffffffff169392505050565b600054610100900460ff1680611505575060005460ff16155b611591576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c01565b600054610100900460ff161580156115d057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6115fa7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b088461407e565b6116247f600e5f1c60beb469a3fa6dd3814a4ae211cc6259a6d033bae218a742f2af01d38361407e565b8015610da357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055505050565b61168d6040805160c08101825260608082526000602083018190529282018390528101829052608081018290529060a082015290565b6040518060c0016040528060a1600085815260200190815260200160002080546116b690615cf3565b80601f01602080910402602001604051908101604052809291908181526020018280546116e290615cf3565b801561172f5780601f106117045761010080835404028352916020019161172f565b820191906000526020600020905b81548152906001019060200180831161171257829003601f168201915b5050509183525050600084815260a0602081815260408084205467ffffffffffffffff8082168488015268010000000000000000820416918601919091527501000000000000000000000000000000000000000000810461ffff1660608601527a010000000000000000000000000000000000000000000000000000810464ffffffffff16608086015292879052819052909101907f0100000000000000000000000000000000000000000000000000000000000000900460ff166002811115611822577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b905292915050565b6000611837848484614088565b949350505050565b609f818154811061184f57600080fd5b600091825260209091200154905081565b3360009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604090205460ff166118f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616c6c6572206973206e6f742061206d616e616765720000000000000000006044820152606401610c01565b609d55565b600081815260a0602052604081205464ffffffffff7001000000000000000000000000000000008204169161ffff750100000000000000000000000000000000000000000083041691819081906119639067ffffffffffffffff1664e8d4a51000615b9c565b600087815260a0602052604090205490935061199a9068010000000000000000900467ffffffffffffffff1664e8d4a51000615b9c565b600087815260a06020526040902054909250611a199077010000000000000000000000000000000000000000000000810462ffffff16907501000000000000000000000000000000000000000000810461ffff1690611a149068010000000000000000900467ffffffffffffffff1664e8d4a51000615b9c565b614088565b905091939590929450565b609e5470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16421015611adc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5374616b696e673a20546f6f206561726c7920746f2061646420696e7465726560448201527f73742e00000000000000000000000000000000000000000000000000000000006064820152608401610c01565b600080611ae76141b4565b609c549091506901000000000000000000900468ffffffffffffffffff16611b4057609c80547fffffffffffffffffffffffffffff000000000000000000ffffffffffffffffff166b0f42400000000000000000001790555b609f5415611bf457609c54611b72906901000000000000000000900468ffffffffffffffffff1664e8d4a51000615b9c565b611b87826a52b7d2dcc80cd2e4000000615b9c565b611b919190615b61565b609f8054611ba190600190615c2c565b81548110611bd8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154611bed9190615b05565b9150611c40565b609c54611c1e906901000000000000000000900468ffffffffffffffffff1664e8d4a51000615b9c565b611c33826a52b7d2dcc80cd2e4000000615b9c565b611c3d9190615b61565b91505b609f80546001810182556000919091527f0bc14066c33013fe88f66e314e4cf150b0b2d4d6451a1a51dbbd1c27cd11de2801829055609854609e80547001000000000000000000000000000000009283900463ffffffff1692601091611cba918591046fffffffffffffffffffffffffffffffff16615ad1565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550611cf9816144af565b609c5460405183815242916901000000000000000000900468ffffffffffffffffff169083907fae90169a78c38e905674f5a17835fe96cc4cc35af01ee5d949da35ad8498de6b9060200160405180910390a45050565b600081815260a06020526040812054610ad09068010000000000000000900467ffffffffffffffff1664e8d4a51000615b9c565b3360009081527f1858bf92c9c8978e4424cd219d3c5c2f2793c5893637bc6efd650dbcdf9435c4602052604090205460ff16611e1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43616c6c6572206973206e6f7420616c6c6f77656400000000000000000000006044820152606401610c01565b60975460ff161580611e5c57503360009081527fef6f2468858ed34109a38be3b61b4af14274d50a88a6bc0eb799e1ca6dc2f621602052604090205460ff165b80611e9557503360009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604090205460ff165b611efb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f46756e6374696f6e2069732070617573656400000000000000000000000000006044820152606401610c01565b6040805160e08101825283815273ffffffffffffffffffffffffffffffffffffffff8316602080830191909152600085815260a08083528482205477010000000000000000000000000000000000000000000000810462ffffff1695850195909552908690529052611038916060820190611f919068010000000000000000900467ffffffffffffffff1664e8d4a51000615b9c565b8152600085815260a06020908152604090912054910190611fc19067ffffffffffffffff1664e8d4a51000615b9c565b8152600085815260a06020818152604080842054700100000000000000000000000000000000810464ffffffffff168387015293899052919052750100000000000000000000000000000000000000000090910461ffff169101526146b7565b3360009081527fef6f2468858ed34109a38be3b61b4af14274d50a88a6bc0eb799e1ca6dc2f621602052604090205460ff166120b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43616c6c6572206973206e6f742061206d69677261746f7200000000000000006044820152606401610c01565b6098805463ffffffff9485167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff67ffffffffffffffff90971674010000000000000000000000000000000000000000029690961673ffffffffffffffffffffffffffffffffffffffff959097167001000000000000000000000000000000009081027fffffffffffffffffffffffff00000000000000000000000000000000000000009092166fffffffffffffffffffffffffffffffff998a16179190911794909416959095179390931790935590831602911617609e556008609d55565b60006001600083815260a060205260409020547f0100000000000000000000000000000000000000000000000000000000000000900460ff166002811115612224577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b1480610ad0575060008083815260a060205260409020547f0100000000000000000000000000000000000000000000000000000000000000900460ff166002811115612299577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b141592915050565b60006122ad8383613c2b565b9392505050565b3360009081527f1858bf92c9c8978e4424cd219d3c5c2f2793c5893637bc6efd650dbcdf9435c4602052604090205460ff1661234c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43616c6c6572206973206e6f7420616c6c6f77656400000000000000000000006044820152606401610c01565b600081815260a1602090815260409091208351610da392850190615301565b3360009081527f1858bf92c9c8978e4424cd219d3c5c2f2793c5893637bc6efd650dbcdf9435c4602052604081205460ff16612403576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43616c6c6572206973206e6f7420616c6c6f77656400000000000000000000006044820152606401610c01565b609c80547b01000000000000000000000000000000000000000000000000000000900464ffffffffff1690601b61243983615d80565b91906101000a81548164ffffffffff021916908364ffffffffff1602179055505064e8d4a510008561246b9190615b61565b61247a9064e8d4a51000615b9c565b945061248b64e8d4a5100085615b61565b61249a9064e8d4a51000615b9c565b93506124a68486613cb6565b6040805160c081018252609c547b01000000000000000000000000000000000000000000000000000000900464ffffffffff16815260208101869052908101869052606081018790526080810184905260a0810183905261250690613de6565b609a546040517fb58191f400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8981166004830152602482018890529091169063b58191f490604401600060405180830381600087803b15801561257a57600080fd5b505af115801561258e573d6000803e3d6000fd5b50506098547c0100000000000000000000000000000000000000000000000000000000900463ffffffff1685109150612656905057609b546040517f8d897bb100000000000000000000000000000000000000000000000000000000815260048101879052602481018890526044810185905273ffffffffffffffffffffffffffffffffffffffff90911690638d897bb190606401600060405180830381600087803b15801561263d57600080fd5b505af1158015612651573d6000803e3d6000fd5b505050505b609c547b01000000000000000000000000000000000000000000000000000000900464ffffffffff908116600081815260a0602090815260409182902054825167ffffffffffffffff80831682526801000000000000000083041692810192909252700100000000000000000000000000000000810490941691810191909152750100000000000000000000000000000000000000000090920461ffff1660608301529073ffffffffffffffffffffffffffffffffffffffff8916907f80129bc2689f74439bd2ea772218ca57cdda11db66c547c5875afdf6c3b8e2569060800160405180910390a35050609c547b01000000000000000000000000000000000000000000000000000000900464ffffffffff1695945050505050565b61277b615381565b6040805161010081018252600084815260a0602052919091205481906127b09067ffffffffffffffff1664e8d4a51000615b9c565b8152600084815260a060209081526040909120549101906127ec9068010000000000000000900467ffffffffffffffff1664e8d4a51000615b9c565b8152600084815260a0602081815260408084205464ffffffffff700100000000000000000000000000000000820481168488015261ffff75010000000000000000000000000000000000000000008304169287019290925262ffffff770100000000000000000000000000000000000000000000008204166060870152938890529190526080909201916128a7917a010000000000000000000000000000000000000000000000000000900416670de0b6b3a7640000615b9c565b8152600084815260a060209081526040909120549101907f0100000000000000000000000000000000000000000000000000000000000000900460ff16600281111561291c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b815260200160a16000858152602001908152602001600020805461293f90615cf3565b80601f016020809104026020016040519081016040528092919081815260200182805461296b90615cf3565b80156129b85780601f1061298d576101008083540402835291602001916129b8565b820191906000526020600020905b81548152906001019060200180831161299b57829003601f168201915b50505050508152509050919050565b6000828152606560205260409020600101546129e38133610d94565b610da38383613b70565b3360009081527f1858bf92c9c8978e4424cd219d3c5c2f2793c5893637bc6efd650dbcdf9435c4602052604081205460ff16612a85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43616c6c6572206973206e6f7420616c6c6f77656400000000000000000000006044820152606401610c01565b60975460ff161580612ac557503360009081527fef6f2468858ed34109a38be3b61b4af14274d50a88a6bc0eb799e1ca6dc2f621602052604090205460ff165b80612afe57503360009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604090205460ff165b612b64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f46756e6374696f6e2069732070617573656400000000000000000000000000006044820152606401610c01565b6002600084815260a060205260409020547f0100000000000000000000000000000000000000000000000000000000000000900460ff166002811115612bd3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14612c3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4d414e414745523a205374616b65206e6f7420616374697665000000000000006044820152606401610c01565b609c80547b01000000000000000000000000000000000000000000000000000000900464ffffffffff1690601b612c7083615d80565b825464ffffffffff9182166101009390930a928302919092021990911617905550600083815260a06020526040812054606490612cb890859067ffffffffffffffff16615c05565b612cc29190615b75565b600085815260a0602052604081205491925090606490612cf990869068010000000000000000900467ffffffffffffffff16615c05565b612d039190615b75565b600086815260a06020526040812080549293508492909190612d3090849067ffffffffffffffff16615c43565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508060a0600087815260200190815260200160002060000160088282829054906101000a900467ffffffffffffffff16612d8f9190615c43565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550612ea66040518060c00160405280609c600001601b9054906101000a900464ffffffffff1664ffffffffff1681526020018467ffffffffffffffff1664e8d4a51000612e019190615b9c565b8152602001612e1f67ffffffffffffffff851664e8d4a51000615b9c565b8152600088815260a06020818152604080842054700100000000000000000000000000000000810464ffffffffff16838701527501000000000000000000000000000000000000000000810461ffff1691860191909152928b90525277010000000000000000000000000000000000000000000000900462ffffff16606090910152613de6565b5050609c547b01000000000000000000000000000000000000000000000000000000900464ffffffffff169392505050565b3360009081527fef6f2468858ed34109a38be3b61b4af14274d50a88a6bc0eb799e1ca6dc2f621602052604090205460ff16612f70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43616c6c6572206973206e6f742061206d69677261746f7200000000000000006044820152606401610c01565b60158310612fda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4d414e414745523a2053656e64696e6720746f6f206d756368206461746100006044820152606401610c01565b828114613069576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d414e414745523a205061796f75742e6c656e67746820213d2073686172657360448201527f2e6c656e677468000000000000000000000000000000000000000000000000006064820152608401610c01565b60005b8381101561323b5760008383838181106130af577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135905080600014156130cc5750670de0b6b3a76400005b609f54156131ae57609f81878785818110613110577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201356a52b7d2dcc80cd2e400000061312d9190615b9c565b6131379190615b61565b609f805461314790600190615c2c565b8154811061317e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001546131939190615b05565b81546001810183556000928352602090922090910155613228565b609f818787858181106131ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201356a52b7d2dcc80cd2e40000006132079190615b9c565b6132119190615b61565b815460018101835560009283526020909220909101555b508061323381615d47565b91505061306c565b5050505050565b3360009081527fef6f2468858ed34109a38be3b61b4af14274d50a88a6bc0eb799e1ca6dc2f621602052604090205460ff166132da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43616c6c6572206973206e6f742061206d69677261746f7200000000000000006044820152606401610c01565b6133047f537f2b5f6ff8219c3d956b1dc717dcdcf7223a3b31bb5c99bb8d12a00d616b6d8761407e565b61332e7f537f2b5f6ff8219c3d956b1dc717dcdcf7223a3b31bb5c99bb8d12a00d616b6d8661407e565b6133587f537f2b5f6ff8219c3d956b1dc717dcdcf7223a3b31bb5c99bb8d12a00d616b6d8561407e565b6133827f537f2b5f6ff8219c3d956b1dc717dcdcf7223a3b31bb5c99bb8d12a00d616b6d8361407e565b6133ac7f537f2b5f6ff8219c3d956b1dc717dcdcf7223a3b31bb5c99bb8d12a00d616b6d8861407e565b6099805473ffffffffffffffffffffffffffffffffffffffff9485167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617909155609a805493851693821693909317909255609b805491909316911617905550505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604081205460ff16610ad0565b600081815260a060205260408120546098546134b4917501000000000000000000000000000000000000000000900461ffff1690700100000000000000000000000000000000900463ffffffff16615bd9565b600083815260a060205260409020546134ee9163ffffffff1690700100000000000000000000000000000000900464ffffffffff16615b1d565b64ffffffffff1692915050565b3360009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604090205460ff16613593576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616c6c6572206973206e6f742061206d616e616765720000000000000000006044820152606401610c01565b611038828261407e565b600069010000000000000000008210613638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203760448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610c01565b5090565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16611038576136948173ffffffffffffffffffffffffffffffffffffffff166014614bfb565b61369f836020614bfb565b6040516020016136b0929190615956565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610c01916004016159d7565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1661103857600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556137a43390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600085815260a060205260409020547f0100000000000000000000000000000000000000000000000000000000000000900460ff166002811115613871577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14156138ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f5354414b45204d414e414745523a205374616b652077697468647261776e206160448201527f6c72656164792e000000000000000000000000000000000000000000000000006064820152608401610c01565b609e5470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16421061393657613936611a24565b609a546040517f8d23de7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301526024820186905290911690638d23de7590604401600060405180830381600087803b1580156139aa57600080fd5b505af11580156139be573d6000803e3d6000fd5b505050506139cc8284614f01565b6139e66139e1670de0b6b3a764000083615b61565b615005565b600085815260a060205260409020805464ffffffffff929092167a010000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1679ffffffffffffffffffffffffffffffffffffffffffffffffffff909216919091177f0100000000000000000000000000000000000000000000000000000000000000179055613a8d8461509c565b600085815260a0602081815260409283902054835167ffffffffffffffff80831682526801000000000000000083041692810192909252700100000000000000000000000000000000810464ffffffffff1693820193909352750100000000000000000000000000000000000000000090920461ffff1660608301524260808301526fffffffffffffffffffffffffffffffff929092169173ffffffffffffffffffffffffffffffffffffffff8816917f040d78afb90eb080178c6ac4e476fbbac3e59eab3fc5e10e3f71136bd19a1b7f91015b60405180910390a35050505050565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff161561103857600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080613c3a8361071b615b05565b613c449085615b9c565b609e54909150600090613c6b906fffffffffffffffffffffffffffffffff1661071c615b9c565b9050600081613c8284670de0b6b3a7640000615b9c565b613c8c9190615b61565b9050613c9d64e8d4a5100082615b61565b613cac9064e8d4a51000615b9c565b9695505050505050565b613cc8610d1964e8d4a5100083615b61565b609c8054600990613cf29084906901000000000000000000900468ffffffffffffffffff16615b3d565b92506101000a81548168ffffffffffffffffff021916908368ffffffffffffffffff160217905550613d2e64e8d4a5100083610d199190615b61565b609c8054600090613d4b90849068ffffffffffffffffff16615b3d565b92506101000a81548168ffffffffffffffffff021916908368ffffffffffffffffff160217905550613d8764e8d4a5100082610d199190615b61565b609c8054601290613dba9084907201000000000000000000000000000000000000900468ffffffffffffffffff16615b3d565b92506101000a81548168ffffffffffffffffff021916908368ffffffffffffffffff1602179055505050565b609e5470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff164210613e1d57613e1d611a24565b613e3a64e8d4a510008260200151613e359190615b61565b61513e565b8151600090815260a060205260409081902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9390931692909217909155810151613e9b90613e359064e8d4a5100090615b61565b8151600090815260a060205260409020805467ffffffffffffffff9290921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff9092169190911790556060810151613efd90615005565b8151600090815260a060205260409020805464ffffffffff92909216700100000000000000000000000000000000027fffffffffffffffffffffff0000000000ffffffffffffffffffffffffffffffff9092169190911790556080810151613f64906151d8565b8151600090815260a060208190526040909120805461ffff939093167501000000000000000000000000000000000000000000027fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff90931692909217909155810151613fcf9061526c565b8151600090815260a06020526040808220805462ffffff9490941677010000000000000000000000000000000000000000000000027fffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffff9094169390931790925591518252902080547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0200000000000000000000000000000000000000000000000000000000000000179055565b611038828261370e565b60008080806140978688615b05565b609f549091501561412757609f6140af600183615c2c565b609f546140be90600190615c2c565b106140d3576140ce600183615c2c565b6140e2565b609f546140e290600190615c2c565b81548110614119577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015492505b861561417f57609f61413a600189615c2c565b81548110614171577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015491505b6a52b7d2dcc80cd2e40000006141958385615c2c565b61419f9087615b9c565b6141a99190615b61565b979650505050505050565b6099546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600091829173ffffffffffffffffffffffffffffffffffffffff909116906370a082319060240160206040518083038186803b15801561422257600080fd5b505afa158015614236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061425a919061586d565b6099546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815261dead60048201526024810183905291925073ffffffffffffffffffffffffffffffffffffffff169063a9059cbb90604401602060405180830381600087803b1580156142cf57600080fd5b505af11580156142e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143079190615686565b506099546040517f70a0823100000000000000000000000000000000000000000000000000000000815261dead600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a082319060240160206040518083038186803b15801561437457600080fd5b505afa158015614388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143ac919061586d565b609954604080517f18160ddd0000000000000000000000000000000000000000000000000000000081529051929350600092849273ffffffffffffffffffffffffffffffffffffffff16916318160ddd916004808301926020929190829003018186803b15801561441c57600080fd5b505afa158015614430573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614454919061586d565b61445e9190615c2c565b609c54909150600090618e94906144859068ffffffffffffffffff1664e8d4a51000615b9c565b61448f9084615b05565b609d5461449c9190615b9c565b6144a69190615b61565b94505050505090565b609954604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916318160ddd916004808301926020929190829003018186803b15801561451a57600080fd5b505afa15801561452e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614552919061586d565b609c549091506000906145759068ffffffffffffffffff1664e8d4a51000615b9c565b61457f9083615b05565b61458a906001615b05565b61459c84670de0b6b3a7640000615b9c565b6145a69190615b61565b6098549091506fffffffffffffffffffffffffffffffff166145f557609880547fffffffffffffffffffffffffffffffff0000000000000000000000000000000016670de0b6b3a76400001790555b609854614671906ec097ce7bc90715b34b9f10000000009061462a9084906fffffffffffffffffffffffffffffffff16615b9c565b614643906ec097ce7bc90715b34b9f1000000000615b05565b609e5461466291906fffffffffffffffffffffffffffffffff16615b9c565b61466c9190615b61565b61509c565b609e80547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff92909216919091179055505050565b600081608001516146d583604001518460c001518560600151614088565b6146df9190615b05565b60c08301516098549192506000916147119190700100000000000000000000000000000000900463ffffffff16615b9c565b8360a001516147209190615b05565b60985460c08501519192507c0100000000000000000000000000000000000000000000000000000000900463ffffffff161161483357609b54606084015160a085015173ffffffffffffffffffffffffffffffffffffffff90921691637e2f5f2d91904285116147905784614792565b425b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815260048101939093526024830191909152604482015260640160206040518083038186803b1580156147ee57600080fd5b505afa158015614802573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614826919061586d565b6148309083615b05565b91505b6000614841836115b3613c2b565b9050836060015181116148d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f5354414b494e473a204e65772073686172657320617265206e6f74206772656160448201527f746572207468656e2070726576696f75732073686172657300000000000000006064820152608401610c01565b60985460009061490290700100000000000000000000000000000000900463ffffffff166115b3615b9c565b61490c9042615b05565b609a546020870151606088015192935073ffffffffffffffffffffffffffffffffffffffff9091169163b58191f491906149469086615c2c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b1580156149b157600080fd5b505af11580156149c5573d6000803e3d6000fd5b5050609b54606088015160a089015160c08a015160985473ffffffffffffffffffffffffffffffffffffffff90941695506392ab3dfd945091929091614a2491700100000000000000000000000000000000900463ffffffff16615b9c565b8960a00151614a339190615b05565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526004810193909352602483019190915260448201526064810185905242608482015260a4810184905260c401600060405180830381600087803b158015614aa557600080fd5b505af1158015614ab9573d6000803e3d6000fd5b50505050614b2164e8d4a510008660800151614ad59190615b61565b614ae49064e8d4a51000615b9c565b614aee9086615c2c565b64e8d4a510008760600151614b039190615b61565b614b129064e8d4a51000615b9c565b614b1c9085615c2c565b613cb6565b6040805160c08101825286518152602081018690529081018390524260608201526115b36080820152609f5460a0820152614b5b90613de6565b8451602080870151600083815260a08084526040808320548b5184529281902054815167ffffffffffffffff94851681529586018b90526801000000000000000090049092169184019190915260608301869052426080840152820184905273ffffffffffffffffffffffffffffffffffffffff16907fde598ff0fa3b69b4f0a3f2caa9cfdda7c4da950fd3c1aab7af7e83b97ada41b09060c001613b61565b60606000614c0a836002615b9c565b614c15906002615b05565b67ffffffffffffffff811115614c54577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015614c7e576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110614cdc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110614d66577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000614da2846002615b9c565b614dad906001615b05565b90505b6001811115614e98577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110614e15577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b828281518110614e52577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93614e9181615cbe565b9050614db0565b5083156122ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c01565b614f13610d1964e8d4a5100083615b61565b609c8054600990614f3d9084906901000000000000000000900468ffffffffffffffffff16615c6c565b92506101000a81548168ffffffffffffffffff021916908368ffffffffffffffffff160217905550614f7964e8d4a5100083610d199190615b61565b609c8054600090614f9690849068ffffffffffffffffff16615c6c565b92506101000a81548168ffffffffffffffffff021916908368ffffffffffffffffff160217905550614fd264e8d4a5100082610d199190615b61565b609c8054601290613dba9084907201000000000000000000000000000000000000900468ffffffffffffffffff16615c6c565b6000650100000000008210613638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203460448201527f30206269747300000000000000000000000000000000000000000000000000006064820152608401610c01565b60006fffffffffffffffffffffffffffffffff821115613638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f32382062697473000000000000000000000000000000000000000000000000006064820152608401610c01565b600067ffffffffffffffff821115613638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203660448201527f34206269747300000000000000000000000000000000000000000000000000006064820152608401610c01565b600061ffff821115613638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f36206269747300000000000000000000000000000000000000000000000000006064820152608401610c01565b600063010000008210613638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f34206269747300000000000000000000000000000000000000000000000000006064820152608401610c01565b82805461530d90615cf3565b90600052602060002090601f01602090048101928261532f5760008555615375565b82601f1061534857805160ff1916838001178555615375565b82800160010185558215615375579182015b8281111561537557825182559160200191906001019061535a565b506136389291506153fe565b604051806101000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600060028111156153f1577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8152602001606081525090565b5b8082111561363857600081556001016153ff565b803573ffffffffffffffffffffffffffffffffffffffff81168114610ad357600080fd5b60008083601f840112615448578081fd5b50813567ffffffffffffffff81111561545f578182fd5b6020830191508360208260051b850101111561547a57600080fd5b9250929050565b80356fffffffffffffffffffffffffffffffff81168114610ad357600080fd5b803563ffffffff81168114610ad357600080fd5b6000602082840312156154c6578081fd5b6122ad82615413565b600080604083850312156154e1578081fd5b6154ea83615413565b91506154f860208401615413565b90509250929050565b600080600080600080600060e0888a03121561551b578283fd5b61552488615413565b965061553260208901615413565b955061554060408901615413565b945061554e60608901615413565b935061555c60808901615413565b925061556a60a08901615413565b915061557860c08901615413565b905092959891949750929550565b60008060006060848603121561559a578283fd5b6155a384615413565b95602085013595506040909401359392505050565b60008060008060008060c087890312156155d0578182fd5b6155d987615413565b9860208801359850604088013597606081013597506080810135965060a00135945092505050565b60008060008060408587031215615616578384fd5b843567ffffffffffffffff8082111561562d578586fd5b61563988838901615437565b90965094506020870135915080821115615651578384fd5b5061565e87828801615437565b95989497509550505050565b60006020828403121561567b578081fd5b81356122ad81615e32565b600060208284031215615697578081fd5b81516122ad81615e32565b6000602082840312156156b3578081fd5b5035919050565b600080604083850312156156cc578182fd5b823591506154f860208401615413565b6000602082840312156156ed578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146122ad578182fd5b6000806040838503121561572e578182fd5b823567ffffffffffffffff80821115615745578384fd5b818501915085601f830112615758578384fd5b81358181111561576a5761576a615e03565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156157b0576157b0615e03565b816040528281528860208487010111156157c8578687fd5b82602086016020830137918201602090810196909652509694909301359450505050565b60008060008060008060c08789031215615804578384fd5b61580d87615481565b955061581b602088016154a1565b9450604087013567ffffffffffffffff81168114615837578485fd5b9350615845606088016154a1565b925061585360808801615481565b915061586160a08801615481565b90509295509295509295565b60006020828403121561587e578081fd5b5051919050565b60008060408385031215615897578182fd5b50508035926020909101359150565b6000806000606084860312156158ba578081fd5b505081359360208301359350604090920135919050565b60038110615908577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b60008151808452615924816020860160208601615c8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161598e816017850160208801615c8e565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516159cb816028840160208801615c8e565b01602801949350505050565b6000602082526122ad602083018461590c565b60006020825282516020830152602083015160408301526040830151606083015260608301516080830152608083015160a083015260a083015160c083015260c0830151615a3b60e08401826158d1565b5060e08301516101008381015261183761012084018261590c565b600060208252825160c06020840152615a7260e084018261590c565b9050602084015167ffffffffffffffff8082166040860152806040870151166060860152505061ffff606085015116608084015264ffffffffff60808501511660a084015260a0840151615ac960c08501826158d1565b509392505050565b60006fffffffffffffffffffffffffffffffff808316818516808303821115615afc57615afc615da5565b01949350505050565b60008219821115615b1857615b18615da5565b500190565b600064ffffffffff808316818516808303821115615afc57615afc615da5565b600068ffffffffffffffffff808316818516808303821115615afc57615afc615da5565b600082615b7057615b70615dd4565b500490565b600067ffffffffffffffff80841680615b9057615b90615dd4565b92169190910492915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615615bd457615bd4615da5565b500290565b600063ffffffff80831681851681830481118215151615615bfc57615bfc615da5565b02949350505050565b600067ffffffffffffffff80831681851681830481118215151615615bfc57615bfc615da5565b600082821015615c3e57615c3e615da5565b500390565b600067ffffffffffffffff83811690831681811015615c6457615c64615da5565b039392505050565b600068ffffffffffffffffff83811690831681811015615c6457615c64615da5565b60005b83811015615ca9578181015183820152602001615c91565b83811115615cb8576000848401525b50505050565b600081615ccd57615ccd615da5565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600181811c90821680615d0757607f821691505b60208210811415615d41577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415615d7957615d79615da5565b5060010190565b600064ffffffffff80831681811415615d9b57615d9b615da5565b6001019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114615e4057600080fd5b5056fea26469706673582212201935d4a81bedcd29d5dd6a9f6903ab47b6b0b6cf4132b337ee0a28736b13183264736f6c63430008030033

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