false
true
0

Contract Address Details

0x7f683AaC0e76B270F0ebB1383a08c5b3B0d65D0e

Contract Name
Pension
Creator
0x9957cd–3e849e at 0x41f5f3–bbc6cf
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
1,067 Transactions
Transfers
1,531 Transfers
Gas Used
103,538,516
Last Balance Update
26041051
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
Pension




Optimization enabled
true
Compiler version
v0.8.20+commit.a1b79de6




Optimization runs
200
EVM Version
shanghai




Verified at
2024-01-07T21:21:57.947664Z

Pension.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

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

/** @notice CDP Token contract interface */
interface ICDPToken is IERC20 {
    /**
     * @notice Create new CDP tokens
     * @param to Address of the recipient
     * @param amount Amount of CDP tokens to create
     */
    function mint(
        address to,
        uint256 amount
    ) external;

    /**
     * @notice Destroy CDP tokens from existence
     * @param amount Amount to destroy
     * @dev Keeps track of destroyed CDP tokens 
     */    
    function burn(
        uint256 amount
    ) external;

    /**
     * @notice Destroy CDP tokens from existence from `account`
     * @param account Address to destroy CDP tokens from
     * @param amount Amount of CDP tokens to destroy
     * @dev Requirement: The caller must have a sufficient allowance
     */    
    function burnFrom(
        address account,
        uint256 amount
    ) external;
}


/**
 * @title Carpe Diem Pension
 * @author Carpe Diem
 * @notice Deposit and destroy CDP Tokens to get a share of the daily minted inflation
 * @dev Part of a system of three contracts. The other two are called Auction and CDPToken
 */
contract Pension is Ownable, Initializable {
    /** 
     * @notice Amount of shares in the system
     */
    uint256 public totalShares;

    /** 
     * @notice Pool of shares for the auction
     * @dev These shares cannot claim rewards
     */
    uint256 public auctionShares;

    /**
     * @notice Shares that are pending in the auction
     * @dev These shares cannot claim rewards
     */
    uint256 public activeAuctionShares;

    /** @notice Total amount of CDP rewards claimed */
    uint256 public totalCDPClaimed;

    /** @notice Total amount of shares distributed to referrers */
    uint256 public totalRefShares;

    /** 
     * @notice Number of unique addresses that have deposited
     * @dev Also includes users with destroyed shares 
     */
    uint256 public NoUsers;

    /** @notice Total amount of CDP deposited */
    uint256 public totalDeposited;

    /** 
     * @notice Value that only increases used to calculate users rewards 
     * @dev Increases every time CDP is minted
     */
    uint256 public rewardPerShare;

    /** @notice CDP Token */
    ICDPToken public CDP;
   
    struct UserInfo {
        address referral; // The referrer of the user
        uint256 shares; // How many tokens the user has provided
        uint256 lastInteraction; // last time user interacted
        uint256 CDPCollected; // Rewards collected by the user
        uint256 snapshot; // Saved snapshot of rewardPerShare
        uint256 storedReward; // Stored reward from before the snapshot that the user hasn't claimed yet
    }
    /** @notice Information about the user */
    mapping(address => UserInfo) public userInfo;

    /** @notice Total number of users mapped per day */
    mapping(uint256 => uint256) public NoUsersPerDay;

    struct dayInfo {
        uint256 CDPRewards; // CDP Minted on the day
        uint256 totalShares; // Total amount of shares on the day
    }
    /** @notice Total Rewards per day */
    mapping(uint256 => dayInfo) public dayInfoMap; // Info updated from Auction contract

    /** @notice Address of the Auction contract */
    address public AuctionContractAddress;

    address[] public UsersInfo;

    /** 
     * @notice Deposit by the user 
     * @param user Address of the user
     * @param timestamp Time of the event
     * @param amount Amount deposited
     */
    event DepositCDP(
        address indexed user,
        uint256 timestamp,
        uint256 amount
    );

    /**
     * @notice Shares given to the user
     * @param user Recipient of the shares
     * @param amount Amount of shares given
     */
    event MintShares(
        address indexed user,
        uint256 amount
    );

    /**
     * @notice Claimed rewards by the user
     * @param user Address of the user
     * @param timestamp Time of the event
     * @param amount Amount claimed
     */
    event ClaimCDP(
        address indexed user,
        uint256 timestamp,
        uint256 amount
    );

    /**
     * @notice Compounded rewards by the user
     * @param user Address of the user
     * @param timestamp Time of the event
     * @param amount Amount compounded
     */
    event CompoundCDP(
        address indexed user,
        uint256 timestamp,
        uint256 amount
    );

    /**
     * @notice Constuct the contract
     * @dev Needs to appoint the owner
     */
    constructor() Ownable(msg.sender) {}

    /**
     * @notice Connect to the other contracts
     * @dev Renounce ownership after configuration
     * @param _CDP Address of the CDPToken contract
     * @param _auctionAddress Address of the Auction contract
     */
    function initialize(
        address _CDP,
        address _auctionAddress
    ) public onlyOwner initializer {
        CDP = ICDPToken(_CDP);
        AuctionContractAddress = _auctionAddress;
        renounceOwnership();
    }

    /**
     * @notice Deposit CDP
     * @param _amount Amount of CDP to deposit
     * @param _referral Address of the (new) referrer, not necessary
     * @dev If no referral address is stored nor inserted, the shares go to the Auction pool
     */
    function depositCDP(
        uint256 _amount,
        address _referral
    ) external {
        require(msg.sender != _referral, "No self-referring");
        require(_amount >= 1e15, "Minimum deposit is 0.001 CDP");

        UserInfo storage user = userInfo[msg.sender];

        // Registers the user if the user interacts for the first time
        if (user.lastInteraction == 0) {
            UsersInfo.push(msg.sender);
            NoUsers += 1;
        }

        address ref;

        if (
            // Case 1: No referral is entered (_referral == address(0)) nor is stored for the user (user.referral == address(0))
            _referral == address(0) && user.referral == address(0)
        ) {
            // Set the ref to the auction address
            ref = AuctionContractAddress;
        } else if (
            // Case 2: No referral is entered (_referral == address(0)) but a referral is stored for the user (user.referral != address(0))
            _referral == address(0) && user.referral != address(0)
        ) {
            // Set the ref to the stored referral
            ref = user.referral;
        } else {
            // Case 3: A referral is entered
            // Update the user's referral to the provided referral
            user.referral = _referral;
            // Set the ref to the provided referral
            ref = _referral;
        }

        UserInfo storage userRef = userInfo[ref];
        uint256 snapshot = user.snapshot;
        uint256 userShares = user.shares;
        uint256 refSnapshot = userRef.snapshot;
        uint256 refShares = userRef.shares;
            
        user.storedReward += ((rewardPerShare - snapshot) * userShares) / 1e18; // Stores rewards before taking a new snapshot
        user.snapshot = rewardPerShare; // Takes a new snapshot for the user
        user.shares += _amount;

        if (ref == AuctionContractAddress) {
            auctionShares += (_amount) / 10;
        } else {
            // Registers the referral if the referral has no interactions
            if (userRef.lastInteraction == 0) {
                UsersInfo.push(ref);
                NoUsers += 1;
                userRef.lastInteraction = block.timestamp;
            }            
            // Stores rewards, takes a new snapshot, and adds shares for referral
            userRef.storedReward += ((rewardPerShare - refSnapshot) * refShares) / 1e18; 
            userRef.snapshot = rewardPerShare;
            userRef.shares += _amount / 10;
            totalRefShares += _amount / 10;
        }

        totalDeposited += _amount;
        auctionShares += (_amount * 2) / 10;
        totalShares += (_amount * 13) / 10;
        user.lastInteraction = block.timestamp;
        
        CDP.burnFrom(msg.sender, _amount);

        emit DepositCDP(msg.sender, block.timestamp, _amount);
    }

    /**
     * @notice Claim CDP rewards
     * @dev Compares the current rewardPerShare value with the user's snapshot to calculate the rewards
     */
    function claimCDP() external {
        UserInfo storage user = userInfo[msg.sender];

        uint256 pending;
        uint256 snapshot = user.snapshot;
        uint256 storedReward = user.storedReward;
        uint256 userShares = user.shares;

        pending += (((rewardPerShare - snapshot) * userShares) / 1e18) + storedReward;
        user.snapshot = rewardPerShare; // Takes a new snapshot for the user
        user.storedReward = 0; // Delete stored reward
        totalCDPClaimed += pending;
        user.CDPCollected += pending;
        user.lastInteraction = block.timestamp;

        CDP.transfer(msg.sender, pending);

        emit ClaimCDP(msg.sender, block.timestamp, pending);
    }

    /**
     * @notice Compound CDP rewards and get 15% more shares
     * @dev Referral and Auction shares are cut in half, so the total amount of shares created per CDP deposited remains at 1.3
     */
    function compoundCDP() external {
        UserInfo storage user = userInfo[msg.sender];
        UserInfo storage userRef = userInfo[user.referral];
        uint256 pending;
        uint256 snapshot = user.snapshot;
        uint256 storedReward = user.storedReward;
        uint256 userShares = user.shares;
        uint256 refSnapshot = userRef.snapshot;
        uint256 refShares = userRef.shares;

        pending += (((rewardPerShare - snapshot) * userShares) / 1e18) + storedReward;
        user.storedReward = 0; // Delete stored reward
        user.snapshot = rewardPerShare; // Takes a new snapshot for the user
        user.shares += (pending * 115) / 100;

        if (user.referral == address(0)) {
            // Add referral shares to auctionShares when no referral is stored
            auctionShares += (pending * 5) / 100;
        } else {
            // Stores rewards, takes a new snapshot, and adds shares for referral
            userRef.storedReward += ((rewardPerShare - refSnapshot) * refShares) / 1e18;
            userRef.snapshot = rewardPerShare;
            userRef.shares += (pending * 5) / 100;
            totalRefShares += (pending * 5) / 100;
        }

        totalDeposited += pending;
        auctionShares += (pending * 10) / 100;
        totalShares += (pending * 130) / 100;
        totalCDPClaimed += pending;
        user.CDPCollected += pending;
        user.lastInteraction = block.timestamp;

        CDP.burn(pending);

        emit CompoundCDP(msg.sender, block.timestamp, pending);
    }

    /**
     * @notice Transfer shares from auction to user
     * @dev Called by auction contract to collect shares for the user/day
     * @param _recipient Address to transfer the shares to
     * @param _amount Amount of shares to transfer
     */
    function mintShares(
        address _recipient,
        uint256 _amount
    ) external {
        require(msg.sender == AuctionContractAddress, "No permission");
        UserInfo storage user = userInfo[_recipient];

        uint256 snapshot = user.snapshot;
        uint256 userShares = user.shares;

        user.storedReward += ((rewardPerShare - snapshot) * userShares) / 1e18; // Stores rewards before taking a new snapshot
        user.snapshot = rewardPerShare; // Takes a new snapshot for the user
        user.shares += (_amount);
        user.lastInteraction = block.timestamp;
        activeAuctionShares -= (_amount);
        emit MintShares(_recipient, _amount);
    }

    /**
     * @notice Create daily inflation and add it to the rewards pool
     * @dev Called by auction contract to mint daily distribution and update daily rewards
     * @param _amount Amount of CDP to create
     * @param _day The day for which the inflation is created
     */
    function mintCDP(
        uint256 _amount,
        uint256 _day
    ) external {
        require(msg.sender == AuctionContractAddress, "No permission");
        uint256 denom = totalShares - auctionShares - activeAuctionShares;

        NoUsersPerDay[_day] = NoUsers;
        dayInfoMap[_day].totalShares = totalShares;

        // Only mint and distribute when there are active user shares
        if (denom != 0) {
            rewardPerShare += (_amount * 1e18) / denom;
            dayInfoMap[_day].CDPRewards = _amount;
            CDP.mint(address(this), _amount);
        }
    }

    /**
     * @notice 5% of the shares in the auction pool are transferred to the auction daily
     * @dev Called by auction contract to update Auction shares balance
     */
    function BurnSharesfromAuction() external returns (uint256) {
        require(msg.sender == AuctionContractAddress, "No permission");
        uint256 sharesDistributedinAuction = (5 * auctionShares) / 100;
        activeAuctionShares += sharesDistributedinAuction;
        auctionShares -= sharesDistributedinAuction;

        return sharesDistributedinAuction;
    }

    /**
     * @notice View function to see the pending reward for a user
     * @param _user: Address of the user
     * @return totalPending Pending reward for a given user
     */
    function pendingRewardCDP(
        address _user
    ) public view returns (uint256 totalPending) {
        UserInfo storage user = userInfo[_user];
        uint256 snapshot = user.snapshot;
        uint256 storedReward = user.storedReward;
        uint256 userShares = user.shares;

        totalPending += (((rewardPerShare - snapshot) * userShares) / 1e18) + storedReward; // Could be 0
    }

    /**
     * @notice Delete a user's shares if he hasn't interacted for 1111 days
     * @notice Claims and sends pending rewards to the targetted user
     * @param _target: Address of whom its shares are being destroyed
     */
    function Destroyshares(
        address _target
    ) external {
        UserInfo storage user = userInfo[_target];

        // Require that the current timestamp is greater than the user's last interaction plus 1111 days
        require(
            block.timestamp > user.lastInteraction + 1111 days,
            "Time requirement not met"
        );
        uint256 pending;
        uint256 snapshot = user.snapshot;
        uint256 storedReward = user.storedReward;
        uint256 userShares = user.shares;

        pending += (((rewardPerShare - snapshot) * userShares) / 1e18) + storedReward;
        user.storedReward = 0; // Delete stored reward
        totalCDPClaimed += pending;
        user.CDPCollected += pending;
        totalShares -= user.shares; // Reduce the total shares
        user.shares = 0; // Set the user's shares to 0

        CDP.transfer(_target, pending);

        emit ClaimCDP(_target, block.timestamp, pending);
    }

    /**
     * @notice Prove your presence
     */
    function Iamhere() external {
        UserInfo storage user = userInfo[msg.sender];
        require(
            user.lastInteraction != 0, 
            "Activate your account with depositCDP()"
        );
        user.lastInteraction = block.timestamp;
    }

    /**
     * @notice Get the total number of shares in the system
     * @return totalShares Total amount of shares
     */
    function gettotalShares() external view returns (uint256) {
        return totalShares;
    }
}
        

/@openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

/@openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

/@openzeppelin/contracts/proxy/utils/Initializable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}
          

/@openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

Compiler Settings

{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"shanghai","compilationTarget":{"Pension.sol":"Pension"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"InvalidInitialization","inputs":[]},{"type":"error","name":"NotInitializing","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"event","name":"ClaimCDP","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"CompoundCDP","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DepositCDP","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint64","name":"version","internalType":"uint64","indexed":false}],"anonymous":false},{"type":"event","name":"MintShares","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"AuctionContractAddress","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"BurnSharesfromAuction","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ICDPToken"}],"name":"CDP","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"Destroyshares","inputs":[{"type":"address","name":"_target","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"Iamhere","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"NoUsers","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"NoUsersPerDay","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"UsersInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"activeAuctionShares","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"auctionShares","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimCDP","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"compoundCDP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"CDPRewards","internalType":"uint256"},{"type":"uint256","name":"totalShares","internalType":"uint256"}],"name":"dayInfoMap","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"depositCDP","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"address","name":"_referral","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"gettotalShares","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_CDP","internalType":"address"},{"type":"address","name":"_auctionAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintCDP","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"uint256","name":"_day","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintShares","inputs":[{"type":"address","name":"_recipient","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"totalPending","internalType":"uint256"}],"name":"pendingRewardCDP","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerShare","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalCDPClaimed","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalDeposited","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalRefShares","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalShares","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"referral","internalType":"address"},{"type":"uint256","name":"shares","internalType":"uint256"},{"type":"uint256","name":"lastInteraction","internalType":"uint256"},{"type":"uint256","name":"CDPCollected","internalType":"uint256"},{"type":"uint256","name":"snapshot","internalType":"uint256"},{"type":"uint256","name":"storedReward","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"address","name":"","internalType":"address"}]}]
              

Contract Creation Code

0x608060405234801561000f575f80fd5b50338061003557604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b61003e81610044565b50610093565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6116a0806100a05f395ff3fe608060405234801561000f575f80fd5b50600436106101bb575f3560e01c80638f1d85ec116100f3578063c58f9eb911610093578063f0b1f2921161006e578063f0b1f292146103e2578063f2fde38b146103eb578063f4221ac6146103fe578063ff50abdc14610406575f80fd5b8063c58f9eb91461038c578063e4b85ed31461039f578063e8d6d199146103a7575f80fd5b8063a6aa0d7b116100ce578063a6aa0d7b1461035e578063ac764afc14610371578063bae48e841461037a578063c0a79b8214610383575f80fd5b80638f1d85ec1461033a57806391d4d4e9146103435780639e132c541461034b575f80fd5b8063485cc9551161015e5780635708b24b116101395780635708b24b146102f05780636afd6eea1461030f578063715018a6146103225780638da5cb5b1461032a575f80fd5b8063485cc955146102c2578063528c198a146102d557806356f8b167146102e8575f80fd5b8063233a24ae11610199578063233a24ae146102645780633a98ef39146102775780633d596c521461028e578063446a2ec8146102b9575f80fd5b8063084d3735146101bf578063084f1d05146101d45780631959a002146101dc575b5f80fd5b6101d26101cd3660046114c2565b61040f565b005b6101d2610538565b6102286101ea3660046114fd565b600a6020525f90815260409020805460018201546002830154600384015460048501546005909501546001600160a01b039094169492939192909186565b604080516001600160a01b0390971687526020870195909552938501929092526060840152608083015260a082015260c0015b60405180910390f35b6101d261027236600461151d565b610828565b61028060015481565b60405190815260200161025b565b6102a161029c366004611547565b610cbc565b6040516001600160a01b03909116815260200161025b565b61028060085481565b6101d26102d036600461155e565b610ce4565b6101d26102e3366004611586565b610e29565b6101d2610f41565b6102806102fe366004611547565b600b6020525f908152604090205481565b6009546102a1906001600160a01b031681565b6101d261109c565b5f546001600160a01b03166102a1565b61028060065481565b600154610280565b6101d26103593660046114fd565b6110af565b61028061036c3660046114fd565b61129d565b61028060045481565b61028060055481565b61028060035481565b600d546102a1906001600160a01b031681565b610280611311565b6103cd6103b5366004611547565b600c6020525f90815260409020805460019091015482565b6040805192835260208301919091520161025b565b61028060025481565b6101d26103f93660046114fd565b61138f565b6101d26113cc565b61028060075481565b600d546001600160a01b031633146104425760405162461bcd60e51b8152600401610439906115ae565b60405180910390fd5b5f60035460025460015461045691906115e9565b61046091906115e9565b6006545f848152600b602090815260408083209390935560018054600c90925292909120909101559050801561053357806104a384670de0b6b3a7640000611602565b6104ad9190611619565b60085f8282546104bd9190611638565b90915550505f828152600c60205260409081902084905560095490516340c10f1960e01b8152306004820152602481018590526001600160a01b03909116906340c10f19906044015f604051808303815f87803b15801561051c575f80fd5b505af115801561052e573d5f803e3d5ffd5b505050505b505050565b335f908152600a602052604080822080546001600160a01b031683529082206004808301546005840154600180860154938501549085015460085496979596939492938490670de0b6b3a76400009085906105949089906115e9565b61059e9190611602565b6105a89190611619565b6105b29190611638565b6105bc9087611638565b5f60058a015560085460048a0155955060646105d9876073611602565b6105e39190611619565b886001015f8282546105f59190611638565b909155505087546001600160a01b031661063b576064610616876005611602565b6106209190611619565b60025f8282546106309190611638565b909155506106e29050565b670de0b6b3a7640000818360085461065391906115e9565b61065d9190611602565b6106679190611619565b876005015f8282546106799190611638565b909155505060085460048801556064610693876005611602565b61069d9190611619565b876001015f8282546106af9190611638565b90915550606490506106c2876005611602565b6106cc9190611619565b60055f8282546106dc9190611638565b90915550505b8560075f8282546106f39190611638565b909155506064905061070687600a611602565b6107109190611619565b60025f8282546107209190611638565b9091555060649050610733876082611602565b61073d9190611619565b60015f82825461074d9190611638565b925050819055508560045f8282546107659190611638565b9250508190555085886003015f82825461077f9190611638565b9091555050426002890155600954604051630852cd8d60e31b8152600481018890526001600160a01b03909116906342966c68906024015f604051808303815f87803b1580156107cd575f80fd5b505af11580156107df573d5f803e3d5ffd5b505060408051428152602081018a90523393507f4a9d54f99a2106914622518258155d4052a554b3eb639cf7122f973500d53b0d92500160405180910390a25050505050505050565b6001600160a01b03811633036108745760405162461bcd60e51b81526020600482015260116024820152704e6f2073656c662d726566657272696e6760781b6044820152606401610439565b66038d7ea4c680008210156108cb5760405162461bcd60e51b815260206004820152601c60248201527f4d696e696d756d206465706f73697420697320302e30303120434450000000006044820152606401610439565b335f908152600a60205260408120600281015490910361094157600e8054600181810183555f9283527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd90910180546001600160a01b03191633179055600680549192909161093b908490611638565b90915550505b5f6001600160a01b038316158015610961575081546001600160a01b0316155b156109785750600d546001600160a01b03166109ca565b6001600160a01b038316158015610998575081546001600160a01b031615155b156109ae575080546001600160a01b03166109ca565b5080546001600160a01b0319166001600160a01b038316178155815b6001600160a01b0381165f908152600a602052604090206004808401546001808601549284015490840154600854929392670de0b6b3a7640000908490610a129087906115e9565b610a1c9190611602565b610a269190611619565b876005015f828254610a389190611638565b909155505060085460048801556001870180548a91905f90610a5b908490611638565b9091555050600d546001600160a01b0390811690871603610a9c57610a81600a8a611619565b60025f828254610a919190611638565b90915550610ba19050565b84600201545f03610b1257600e8054600180820183555f9283527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd90910180546001600160a01b0319166001600160a01b038a161790556006805491929091610b06908490611638565b90915550504260028601555b670de0b6b3a76400008183600854610b2a91906115e9565b610b349190611602565b610b3e9190611619565b856005015f828254610b509190611638565b90915550506008546004860155610b68600a8a611619565b856001015f828254610b7a9190611638565b90915550610b8b9050600a8a611619565b60055f828254610b9b9190611638565b90915550505b8860075f828254610bb29190611638565b90915550600a9050610bc58a6002611602565b610bcf9190611619565b60025f828254610bdf9190611638565b90915550600a9050610bf28a600d611602565b610bfc9190611619565b60015f828254610c0c9190611638565b909155505042600288015560095460405163079cc67960e41b8152336004820152602481018b90526001600160a01b03909116906379cc6790906044015f604051808303815f87803b158015610c60575f80fd5b505af1158015610c72573d5f803e3d5ffd5b505060408051428152602081018d90523393507f1e33a98db2ddc8bf1bef3967bda4f426b33842bc69c1e913cd0093cffd6651b992500160405180910390a2505050505050505050565b600e8181548110610ccb575f80fd5b5f918252602090912001546001600160a01b0316905081565b610cec611447565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f81158015610d315750825b90505f8267ffffffffffffffff166001148015610d4d5750303b155b905081158015610d5b575080155b15610d795760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610da357845460ff60401b1916600160401b1785555b600980546001600160a01b03808a166001600160a01b031992831617909255600d805492891692909116919091179055610ddb61109c565b831561052e57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050565b600d546001600160a01b03163314610e535760405162461bcd60e51b8152600401610439906115ae565b6001600160a01b0382165f908152600a6020526040902060048101546001820154600854670de0b6b3a7640000908290610e8e9085906115e9565b610e989190611602565b610ea29190611619565b836005015f828254610eb49190611638565b909155505060085460048401556001830180548591905f90610ed7908490611638565b9091555050426002840155600380548591905f90610ef69084906115e9565b90915550506040518481526001600160a01b038616907fe0db2c42b942601357f9499d6f0520c824b2ce7513135a456b661d1d3e45de5e906020015b60405180910390a25050505050565b335f908152600a602052604081206004810154600582015460018301546008549394938290670de0b6b3a7640000908390610f7d9087906115e9565b610f879190611602565b610f919190611619565b610f9b9190611638565b610fa59085611638565b935060085485600401819055505f85600501819055508360045f828254610fcc9190611638565b9250508190555083856003015f828254610fe69190611638565b909155505042600286015560095460405163a9059cbb60e01b8152336004820152602481018690526001600160a01b039091169063a9059cbb906044016020604051808303815f875af115801561103f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611063919061164b565b50604080514281526020810186905233917fa0710d748988d676c0dc746bcb68ad36c1d3374a2de4b9e344dacbe1c922186e9101610f32565b6110a4611447565b6110ad5f611473565b565b6001600160a01b0381165f908152600a6020526040902060028101546110d9906305b8b280611638565b42116111275760405162461bcd60e51b815260206004820152601860248201527f54696d6520726571756972656d656e74206e6f74206d657400000000000000006044820152606401610439565b6004810154600582015460018301546008545f939291908290670de0b6b3a76400009083906111579087906115e9565b6111619190611602565b61116b9190611619565b6111759190611638565b61117f9085611638565b93505f85600501819055508360045f82825461119b9190611638565b9250508190555083856003015f8282546111b59190611638565b92505081905550846001015460015f8282546111d191906115e9565b90915550505f600186015560095460405163a9059cbb60e01b81526001600160a01b038881166004830152602482018790529091169063a9059cbb906044016020604051808303815f875af115801561122c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611250919061164b565b5060408051428152602081018690526001600160a01b038816917fa0710d748988d676c0dc746bcb68ad36c1d3374a2de4b9e344dacbe1c922186e910160405180910390a2505050505050565b6001600160a01b0381165f908152600a602052604081206004810154600582015460018301546008548290670de0b6b3a76400009083906112df9087906115e9565b6112e99190611602565b6112f39190611619565b6112fd9190611638565b6113079086611638565b9695505050505050565b600d545f906001600160a01b0316331461133d5760405162461bcd60e51b8152600401610439906115ae565b5f6064600254600561134f9190611602565b6113599190611619565b90508060035f82825461136c9190611638565b925050819055508060025f82825461138491906115e9565b909155509092915050565b611397611447565b6001600160a01b0381166113c057604051631e4fbdf760e01b81525f6004820152602401610439565b6113c981611473565b50565b335f908152600a60205260408120600281015490910361143e5760405162461bcd60e51b815260206004820152602760248201527f416374697661746520796f7572206163636f756e742077697468206465706f736044820152666974434450282960c81b6064820152608401610439565b42600290910155565b5f546001600160a01b031633146110ad5760405163118cdaa760e01b8152336004820152602401610439565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f80604083850312156114d3575f80fd5b50508035926020909101359150565b80356001600160a01b03811681146114f8575f80fd5b919050565b5f6020828403121561150d575f80fd5b611516826114e2565b9392505050565b5f806040838503121561152e575f80fd5b8235915061153e602084016114e2565b90509250929050565b5f60208284031215611557575f80fd5b5035919050565b5f806040838503121561156f575f80fd5b611578836114e2565b915061153e602084016114e2565b5f8060408385031215611597575f80fd5b6115a0836114e2565b946020939093013593505050565b6020808252600d908201526c2737903832b936b4b9b9b4b7b760991b604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b818103818111156115fc576115fc6115d5565b92915050565b80820281158282048414176115fc576115fc6115d5565b5f8261163357634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156115fc576115fc6115d5565b5f6020828403121561165b575f80fd5b81518015158114611516575f80fdfea2646970667358221220c474e67f5213f3b5bcde0842942ff9b006e6d3d5b59d63a6d2e0ffcb3d1b7bf764736f6c63430008140033

Deployed ByteCode

0x608060405234801561000f575f80fd5b50600436106101bb575f3560e01c80638f1d85ec116100f3578063c58f9eb911610093578063f0b1f2921161006e578063f0b1f292146103e2578063f2fde38b146103eb578063f4221ac6146103fe578063ff50abdc14610406575f80fd5b8063c58f9eb91461038c578063e4b85ed31461039f578063e8d6d199146103a7575f80fd5b8063a6aa0d7b116100ce578063a6aa0d7b1461035e578063ac764afc14610371578063bae48e841461037a578063c0a79b8214610383575f80fd5b80638f1d85ec1461033a57806391d4d4e9146103435780639e132c541461034b575f80fd5b8063485cc9551161015e5780635708b24b116101395780635708b24b146102f05780636afd6eea1461030f578063715018a6146103225780638da5cb5b1461032a575f80fd5b8063485cc955146102c2578063528c198a146102d557806356f8b167146102e8575f80fd5b8063233a24ae11610199578063233a24ae146102645780633a98ef39146102775780633d596c521461028e578063446a2ec8146102b9575f80fd5b8063084d3735146101bf578063084f1d05146101d45780631959a002146101dc575b5f80fd5b6101d26101cd3660046114c2565b61040f565b005b6101d2610538565b6102286101ea3660046114fd565b600a6020525f90815260409020805460018201546002830154600384015460048501546005909501546001600160a01b039094169492939192909186565b604080516001600160a01b0390971687526020870195909552938501929092526060840152608083015260a082015260c0015b60405180910390f35b6101d261027236600461151d565b610828565b61028060015481565b60405190815260200161025b565b6102a161029c366004611547565b610cbc565b6040516001600160a01b03909116815260200161025b565b61028060085481565b6101d26102d036600461155e565b610ce4565b6101d26102e3366004611586565b610e29565b6101d2610f41565b6102806102fe366004611547565b600b6020525f908152604090205481565b6009546102a1906001600160a01b031681565b6101d261109c565b5f546001600160a01b03166102a1565b61028060065481565b600154610280565b6101d26103593660046114fd565b6110af565b61028061036c3660046114fd565b61129d565b61028060045481565b61028060055481565b61028060035481565b600d546102a1906001600160a01b031681565b610280611311565b6103cd6103b5366004611547565b600c6020525f90815260409020805460019091015482565b6040805192835260208301919091520161025b565b61028060025481565b6101d26103f93660046114fd565b61138f565b6101d26113cc565b61028060075481565b600d546001600160a01b031633146104425760405162461bcd60e51b8152600401610439906115ae565b60405180910390fd5b5f60035460025460015461045691906115e9565b61046091906115e9565b6006545f848152600b602090815260408083209390935560018054600c90925292909120909101559050801561053357806104a384670de0b6b3a7640000611602565b6104ad9190611619565b60085f8282546104bd9190611638565b90915550505f828152600c60205260409081902084905560095490516340c10f1960e01b8152306004820152602481018590526001600160a01b03909116906340c10f19906044015f604051808303815f87803b15801561051c575f80fd5b505af115801561052e573d5f803e3d5ffd5b505050505b505050565b335f908152600a602052604080822080546001600160a01b031683529082206004808301546005840154600180860154938501549085015460085496979596939492938490670de0b6b3a76400009085906105949089906115e9565b61059e9190611602565b6105a89190611619565b6105b29190611638565b6105bc9087611638565b5f60058a015560085460048a0155955060646105d9876073611602565b6105e39190611619565b886001015f8282546105f59190611638565b909155505087546001600160a01b031661063b576064610616876005611602565b6106209190611619565b60025f8282546106309190611638565b909155506106e29050565b670de0b6b3a7640000818360085461065391906115e9565b61065d9190611602565b6106679190611619565b876005015f8282546106799190611638565b909155505060085460048801556064610693876005611602565b61069d9190611619565b876001015f8282546106af9190611638565b90915550606490506106c2876005611602565b6106cc9190611619565b60055f8282546106dc9190611638565b90915550505b8560075f8282546106f39190611638565b909155506064905061070687600a611602565b6107109190611619565b60025f8282546107209190611638565b9091555060649050610733876082611602565b61073d9190611619565b60015f82825461074d9190611638565b925050819055508560045f8282546107659190611638565b9250508190555085886003015f82825461077f9190611638565b9091555050426002890155600954604051630852cd8d60e31b8152600481018890526001600160a01b03909116906342966c68906024015f604051808303815f87803b1580156107cd575f80fd5b505af11580156107df573d5f803e3d5ffd5b505060408051428152602081018a90523393507f4a9d54f99a2106914622518258155d4052a554b3eb639cf7122f973500d53b0d92500160405180910390a25050505050505050565b6001600160a01b03811633036108745760405162461bcd60e51b81526020600482015260116024820152704e6f2073656c662d726566657272696e6760781b6044820152606401610439565b66038d7ea4c680008210156108cb5760405162461bcd60e51b815260206004820152601c60248201527f4d696e696d756d206465706f73697420697320302e30303120434450000000006044820152606401610439565b335f908152600a60205260408120600281015490910361094157600e8054600181810183555f9283527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd90910180546001600160a01b03191633179055600680549192909161093b908490611638565b90915550505b5f6001600160a01b038316158015610961575081546001600160a01b0316155b156109785750600d546001600160a01b03166109ca565b6001600160a01b038316158015610998575081546001600160a01b031615155b156109ae575080546001600160a01b03166109ca565b5080546001600160a01b0319166001600160a01b038316178155815b6001600160a01b0381165f908152600a602052604090206004808401546001808601549284015490840154600854929392670de0b6b3a7640000908490610a129087906115e9565b610a1c9190611602565b610a269190611619565b876005015f828254610a389190611638565b909155505060085460048801556001870180548a91905f90610a5b908490611638565b9091555050600d546001600160a01b0390811690871603610a9c57610a81600a8a611619565b60025f828254610a919190611638565b90915550610ba19050565b84600201545f03610b1257600e8054600180820183555f9283527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd90910180546001600160a01b0319166001600160a01b038a161790556006805491929091610b06908490611638565b90915550504260028601555b670de0b6b3a76400008183600854610b2a91906115e9565b610b349190611602565b610b3e9190611619565b856005015f828254610b509190611638565b90915550506008546004860155610b68600a8a611619565b856001015f828254610b7a9190611638565b90915550610b8b9050600a8a611619565b60055f828254610b9b9190611638565b90915550505b8860075f828254610bb29190611638565b90915550600a9050610bc58a6002611602565b610bcf9190611619565b60025f828254610bdf9190611638565b90915550600a9050610bf28a600d611602565b610bfc9190611619565b60015f828254610c0c9190611638565b909155505042600288015560095460405163079cc67960e41b8152336004820152602481018b90526001600160a01b03909116906379cc6790906044015f604051808303815f87803b158015610c60575f80fd5b505af1158015610c72573d5f803e3d5ffd5b505060408051428152602081018d90523393507f1e33a98db2ddc8bf1bef3967bda4f426b33842bc69c1e913cd0093cffd6651b992500160405180910390a2505050505050505050565b600e8181548110610ccb575f80fd5b5f918252602090912001546001600160a01b0316905081565b610cec611447565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f81158015610d315750825b90505f8267ffffffffffffffff166001148015610d4d5750303b155b905081158015610d5b575080155b15610d795760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610da357845460ff60401b1916600160401b1785555b600980546001600160a01b03808a166001600160a01b031992831617909255600d805492891692909116919091179055610ddb61109c565b831561052e57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050565b600d546001600160a01b03163314610e535760405162461bcd60e51b8152600401610439906115ae565b6001600160a01b0382165f908152600a6020526040902060048101546001820154600854670de0b6b3a7640000908290610e8e9085906115e9565b610e989190611602565b610ea29190611619565b836005015f828254610eb49190611638565b909155505060085460048401556001830180548591905f90610ed7908490611638565b9091555050426002840155600380548591905f90610ef69084906115e9565b90915550506040518481526001600160a01b038616907fe0db2c42b942601357f9499d6f0520c824b2ce7513135a456b661d1d3e45de5e906020015b60405180910390a25050505050565b335f908152600a602052604081206004810154600582015460018301546008549394938290670de0b6b3a7640000908390610f7d9087906115e9565b610f879190611602565b610f919190611619565b610f9b9190611638565b610fa59085611638565b935060085485600401819055505f85600501819055508360045f828254610fcc9190611638565b9250508190555083856003015f828254610fe69190611638565b909155505042600286015560095460405163a9059cbb60e01b8152336004820152602481018690526001600160a01b039091169063a9059cbb906044016020604051808303815f875af115801561103f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611063919061164b565b50604080514281526020810186905233917fa0710d748988d676c0dc746bcb68ad36c1d3374a2de4b9e344dacbe1c922186e9101610f32565b6110a4611447565b6110ad5f611473565b565b6001600160a01b0381165f908152600a6020526040902060028101546110d9906305b8b280611638565b42116111275760405162461bcd60e51b815260206004820152601860248201527f54696d6520726571756972656d656e74206e6f74206d657400000000000000006044820152606401610439565b6004810154600582015460018301546008545f939291908290670de0b6b3a76400009083906111579087906115e9565b6111619190611602565b61116b9190611619565b6111759190611638565b61117f9085611638565b93505f85600501819055508360045f82825461119b9190611638565b9250508190555083856003015f8282546111b59190611638565b92505081905550846001015460015f8282546111d191906115e9565b90915550505f600186015560095460405163a9059cbb60e01b81526001600160a01b038881166004830152602482018790529091169063a9059cbb906044016020604051808303815f875af115801561122c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611250919061164b565b5060408051428152602081018690526001600160a01b038816917fa0710d748988d676c0dc746bcb68ad36c1d3374a2de4b9e344dacbe1c922186e910160405180910390a2505050505050565b6001600160a01b0381165f908152600a602052604081206004810154600582015460018301546008548290670de0b6b3a76400009083906112df9087906115e9565b6112e99190611602565b6112f39190611619565b6112fd9190611638565b6113079086611638565b9695505050505050565b600d545f906001600160a01b0316331461133d5760405162461bcd60e51b8152600401610439906115ae565b5f6064600254600561134f9190611602565b6113599190611619565b90508060035f82825461136c9190611638565b925050819055508060025f82825461138491906115e9565b909155509092915050565b611397611447565b6001600160a01b0381166113c057604051631e4fbdf760e01b81525f6004820152602401610439565b6113c981611473565b50565b335f908152600a60205260408120600281015490910361143e5760405162461bcd60e51b815260206004820152602760248201527f416374697661746520796f7572206163636f756e742077697468206465706f736044820152666974434450282960c81b6064820152608401610439565b42600290910155565b5f546001600160a01b031633146110ad5760405163118cdaa760e01b8152336004820152602401610439565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f80604083850312156114d3575f80fd5b50508035926020909101359150565b80356001600160a01b03811681146114f8575f80fd5b919050565b5f6020828403121561150d575f80fd5b611516826114e2565b9392505050565b5f806040838503121561152e575f80fd5b8235915061153e602084016114e2565b90509250929050565b5f60208284031215611557575f80fd5b5035919050565b5f806040838503121561156f575f80fd5b611578836114e2565b915061153e602084016114e2565b5f8060408385031215611597575f80fd5b6115a0836114e2565b946020939093013593505050565b6020808252600d908201526c2737903832b936b4b9b9b4b7b760991b604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b818103818111156115fc576115fc6115d5565b92915050565b80820281158282048414176115fc576115fc6115d5565b5f8261163357634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156115fc576115fc6115d5565b5f6020828403121561165b575f80fd5b81518015158114611516575f80fdfea2646970667358221220c474e67f5213f3b5bcde0842942ff9b006e6d3d5b59d63a6d2e0ffcb3d1b7bf764736f6c63430008140033