false
true

Contract Address Details

0xCa98cD011599523121072c0574b5c97fF565B2dE

Contract Name
GDCrowdsale
Creator
0x8687d8–47bc82 at 0x58915b–921bb5
Balance
0
Tokens
Fetching tokens...
Transactions
3 Transactions
Transfers
4 Transfers
Gas Used
538,221
Last Balance Update
23771184
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
GDCrowdsale




Optimization enabled
true
Compiler version
v0.8.18+commit.87f61d96




Optimization runs
1000000
EVM Version
default




Verified at
2025-03-11T23:50:07.487959Z

Constructor Arguments

0x000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd0000000000000000000000008687d85e907657107323b4b3ad2b814b9647bc820000000000000000000000000000000000000000000000000000000000093a80

Arg [0] (address) : 0xabccefb00528c9c792ac7c46997f0f6ee5dcdddd
Arg [1] (address) : 0x8687d85e907657107323b4b3ad2b814b9647bc82
Arg [2] (uint256) : 604800

              

contracts/factory/GDCrowdsale.sol

Sol2uml
new
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";

error InvalidAddress();
error InvalidAmount();
error InvalidState();
error AlreadyParticipated();
error InsufficientBalance();
error CrowdsaleNotEnded();
error CrowdsaleEnded();
error AlreadyDistributed();
error InvalidDuration();

/**
 * @title GD Token Crowdsale Contract
 * @dev Improved implementation of the GD token crowdsale
 */
contract GDCrowdsale is ReentrancyGuard, Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    struct PurchaseInfo {
        uint256 purchaseTime;
        uint256 ethAmount;
        uint256 tokenAmount;
        uint256 price;
    }

    enum CrowdsaleState { Active, Paused, Ended }

    // Immutable state variables
    IERC20 public immutable saleToken;
    address payable public immutable fundingWallet;
    uint256 public immutable startTime;

    // State variables
    uint256 public totalRaised;
    uint256 public totalTokensSold;
    CrowdsaleState public state;
    uint256 public initialDuration;    // Initial crowdsale duration
    uint256 public extraDuration;      // Additional duration for extension

    // Constants
    uint256 public constant MIN_PURCHASE_AMOUNT = 0.01 ether;
    uint256 public constant MAX_PURCHASE_AMOUNT = 1 ether;
    uint256 public constant INITIAL_PRICE_PER_UNIT = 0.01 ether;  // 1M tokens = 0.01 ETH
    uint256 public constant FINAL_PRICE_PER_UNIT = 0.012 ether;    // 1M tokens = 0.012 ETH

    // Storage
    mapping(address => PurchaseInfo) public purchases;
    address[] public purchasers;

    // Events
    event TokensPurchased(
        address indexed purchaser,
        uint256 ethAmount,
        uint256 tokenAmount,
        uint256 price,
        uint256 time
    );
    
    event UnallocatedTokensDistributed(
        address indexed burnAddress,
        address indexed liquidityAddress,
        uint256 burnAmount,
        uint256 liquidityAmount,
        uint256 time
    );
    
    event CrowdsaleStateChanged(
        CrowdsaleState indexed previousState,
        CrowdsaleState indexed newState,
        uint256 time
    );

    event TokensWithdrawn(
        address indexed token,
        address indexed to,
        uint256 amount,
        uint256 time
    );

    event EthWithdrawn(
        address indexed to,
        uint256 amount,
        uint256 time
    );

    event CrowdsaleDurationUpdated(
        uint256 oldDuration,
        uint256 newDuration,
        uint256 time
    );

    uint256 public baseTokenAmount;  // Amount of tokens per unit (1M tokens)

    constructor(
        IERC20 _saleToken, 
        address payable _fundingWallet,
        uint256 _initialDuration
    ) {
        if (address(_saleToken) == address(0) || _fundingWallet == address(0)) 
            revert InvalidAddress();
        if (_initialDuration == 0) revert InvalidDuration();
        
        saleToken = _saleToken;
        fundingWallet = _fundingWallet;
        startTime = block.timestamp;
        initialDuration = _initialDuration;  // Set initial duration
        extraDuration = 0;                   // Initialize extra duration
        state = CrowdsaleState.Active;

        uint8 decimals = IERC20Metadata(address(_saleToken)).decimals();
        baseTokenAmount = 1000000 * 10**decimals;  // 1M tokens as base unit
    }

    modifier onlyWhileOpen() {
        if (state != CrowdsaleState.Active) revert InvalidState();
        if (block.timestamp >= startTime + initialDuration + extraDuration) revert CrowdsaleEnded();
        _;
    }

    modifier validatePurchase(uint256 amount) {
        if (purchases[msg.sender].purchaseTime != 0) revert AlreadyParticipated();
        if (amount < MIN_PURCHASE_AMOUNT || amount > MAX_PURCHASE_AMOUNT) 
            revert InvalidAmount();
        _;
    }

    /**
     * @dev Update crowdsale duration
     * @param _extraDuration Additional duration in seconds
     */
    function updateCrowdsaleDuration(uint256 _extraDuration) external onlyOwner {
        if (state == CrowdsaleState.Ended) revert CrowdsaleEnded();
        
        uint256 oldDuration = initialDuration + extraDuration;
        extraDuration = _extraDuration;
        
        emit CrowdsaleDurationUpdated(oldDuration, initialDuration + extraDuration, block.timestamp);
    }

    /**
     * @dev Get current token rate
     * @return Current rate for 1M tokens
     */
    function getCurrentPrice() public view returns (uint256) {
        if (block.timestamp >= startTime + initialDuration) {
            return FINAL_PRICE_PER_UNIT;
        }
        
        uint256 elapsed = block.timestamp - startTime;
        uint256 priceIncrease = FINAL_PRICE_PER_UNIT.sub(INITIAL_PRICE_PER_UNIT)
            .mul(elapsed)
            .div(initialDuration);
            
        return Math.min(
            INITIAL_PRICE_PER_UNIT.add(priceIncrease),
            FINAL_PRICE_PER_UNIT
        );
    }

    /**
     * @dev Calculate token amount for given ETH
     * @param ethAmount Amount of ETH
     * @return Token amount
     */
    function calculateTokenAmount(uint256 ethAmount) public view returns (uint256) {
        return ethAmount.mul(baseTokenAmount).div(getCurrentPrice());
    }

    /**
     * @dev contribute with ETH
     */
    function contribute() public payable 
        nonReentrant 
        onlyWhileOpen 
        validatePurchase(msg.value) 
    {
        uint256 currentPrice = getCurrentPrice();
        uint256 tokenAmount = calculateTokenAmount(msg.value);

        if (saleToken.balanceOf(address(this)) < tokenAmount) 
            revert InsufficientBalance();

        // Record purchase
        purchases[msg.sender] = PurchaseInfo({
            purchaseTime: block.timestamp,
            ethAmount: msg.value,
            tokenAmount: tokenAmount,
            price: currentPrice
        });
        purchasers.push(msg.sender);
        totalRaised = totalRaised.add(msg.value);
        totalTokensSold = totalTokensSold.add(tokenAmount);

        // Transfer tokens and ETH
        saleToken.safeTransfer(msg.sender, tokenAmount);
        (bool success, ) = fundingWallet.call{value: msg.value}("");
        require(success, "ETH transfer failed");

        emit TokensPurchased(
            msg.sender,
            msg.value,
            tokenAmount,
            currentPrice,
            block.timestamp
        );
    }

    /**
     * @dev Distribute remaining tokens
     * @param liquidityMiningAddress Address for liquidity mining
     */
    function distributeUnallocatedTokens(
        address liquidityMiningAddress
    ) external onlyOwner {
        if (block.timestamp < startTime + initialDuration + extraDuration) 
            revert CrowdsaleNotEnded();
        if (state == CrowdsaleState.Ended) 
            revert AlreadyDistributed();
        if (liquidityMiningAddress == address(0)) 
            revert InvalidAddress();
        
        uint256 remaining = saleToken.balanceOf(address(this));
        if (remaining == 0) revert InsufficientBalance();

        uint256 halfAmount = remaining.div(2);
        
        // Distribute tokens
        saleToken.safeTransfer(address(0), halfAmount);
        saleToken.safeTransfer(liquidityMiningAddress, halfAmount);

        state = CrowdsaleState.Ended;
        
        emit UnallocatedTokensDistributed(
            address(0),
            liquidityMiningAddress,
            halfAmount,
            halfAmount,
            block.timestamp
        );
    }

    /**
     * @dev Set crowdsale state
     * @param _state New state
     */
    function setCrowdsaleState(CrowdsaleState _state) external onlyOwner {
        if (_state == CrowdsaleState.Ended || state == CrowdsaleState.Ended) 
            revert InvalidState();
        
        CrowdsaleState previousState = state;
        state = _state;
        
        emit CrowdsaleStateChanged(previousState, _state, block.timestamp);
    }

    /**
     * @dev Emergency withdraw any token
     * @param _token Token address
     * @param _to Recipient address
     */
    function emergencyWithdrawTokens(
        IERC20 _token,
        address _to
    ) external onlyOwner {
        if (_to == address(0)) revert InvalidAddress();
        
        uint256 balance = _token.balanceOf(address(this));
        if (balance == 0) revert InsufficientBalance();
        
        _token.safeTransfer(_to, balance);
        
        emit TokensWithdrawn(
            address(_token),
            _to,
            balance,
            block.timestamp
        );
    }

    /**
     * @dev Get crowdsale status
     */
    function getCrowdsaleStatus() external view returns (
        uint256 currentPrice,
        uint256 remainingTime,
        uint256 totalParticipants,
        uint256 raisedAmount,
        uint256 remainingTokens,
        CrowdsaleState currentState
    ) {
        uint256 _remainingTime = 0;
        uint256 totalDuration = initialDuration.add(extraDuration);
        if (block.timestamp < startTime + totalDuration) {
            _remainingTime = startTime.add(totalDuration).sub(block.timestamp);
        }

        return (
            getCurrentPrice(),
            _remainingTime,
            purchasers.length,
            totalRaised,
            saleToken.balanceOf(address(this)),
            state
        );
    }

    /**
     * @dev Get purchasers with pagination
     */
    function getPurchasersPaginated(uint256 offset, uint256 limit) 
        external 
        view 
        returns (
            address[] memory _purchasers,
            uint256 total
        ) 
    {
        uint256 end = offset + limit;
        if (end > purchasers.length) {
            end = purchasers.length;
        }
        
        address[] memory result = new address[](end - offset);
        for (uint256 i = offset; i < end; i++) {
            result[i - offset] = purchasers[i];
        }
        
        return (result, purchasers.length);
    }

    /**
     * @dev Get purchase info for multiple addresses
     */
    function getPurchaseInfoBatch(address[] calldata _purchasers) 
        external 
        view 
        returns (PurchaseInfo[] memory) 
    {
        PurchaseInfo[] memory result = new PurchaseInfo[](_purchasers.length);
        for (uint256 i = 0; i < _purchasers.length; i++) {
            result[i] = purchases[_purchasers[i]];
        }
        return result;
    }

    /**
     * @dev Get crowdsale statistics
     * @return ethRaised Total ETH raised in crowdsale
     * @return tokensSold Total tokens sold in crowdsale
     * @return participantsCount Total number of unique participants
     */
    function getCrowdsaleStats() public view returns (
        uint256 ethRaised,
        uint256 tokensSold,
        uint256 participantsCount
    ) {
        return (totalRaised, totalTokensSold, purchasers.length);
    }

    receive() external payable {
        if(msg.value > 0) {
            contribute();
        }
    }
}
        

@openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}
          

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

@openzeppelin/contracts/utils/math/Math.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}
          

@openzeppelin/contracts/utils/math/SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}
          

Compiler Settings

{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":1000000,"enabled":true},"libraries":{}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_saleToken","internalType":"contract IERC20"},{"type":"address","name":"_fundingWallet","internalType":"address payable"},{"type":"uint256","name":"_initialDuration","internalType":"uint256"}]},{"type":"error","name":"AlreadyDistributed","inputs":[]},{"type":"error","name":"AlreadyParticipated","inputs":[]},{"type":"error","name":"CrowdsaleEnded","inputs":[]},{"type":"error","name":"CrowdsaleNotEnded","inputs":[]},{"type":"error","name":"InsufficientBalance","inputs":[]},{"type":"error","name":"InvalidAddress","inputs":[]},{"type":"error","name":"InvalidAmount","inputs":[]},{"type":"error","name":"InvalidDuration","inputs":[]},{"type":"error","name":"InvalidState","inputs":[]},{"type":"event","name":"CrowdsaleDurationUpdated","inputs":[{"type":"uint256","name":"oldDuration","internalType":"uint256","indexed":false},{"type":"uint256","name":"newDuration","internalType":"uint256","indexed":false},{"type":"uint256","name":"time","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"CrowdsaleStateChanged","inputs":[{"type":"uint8","name":"previousState","internalType":"enum GDCrowdsale.CrowdsaleState","indexed":true},{"type":"uint8","name":"newState","internalType":"enum GDCrowdsale.CrowdsaleState","indexed":true},{"type":"uint256","name":"time","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"EthWithdrawn","inputs":[{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"time","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":"event","name":"TokensPurchased","inputs":[{"type":"address","name":"purchaser","internalType":"address","indexed":true},{"type":"uint256","name":"ethAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"tokenAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"price","internalType":"uint256","indexed":false},{"type":"uint256","name":"time","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TokensWithdrawn","inputs":[{"type":"address","name":"token","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"time","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UnallocatedTokensDistributed","inputs":[{"type":"address","name":"burnAddress","internalType":"address","indexed":true},{"type":"address","name":"liquidityAddress","internalType":"address","indexed":true},{"type":"uint256","name":"burnAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"liquidityAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"time","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"FINAL_PRICE_PER_UNIT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"INITIAL_PRICE_PER_UNIT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_PURCHASE_AMOUNT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MIN_PURCHASE_AMOUNT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"baseTokenAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateTokenAmount","inputs":[{"type":"uint256","name":"ethAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"contribute","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"distributeUnallocatedTokens","inputs":[{"type":"address","name":"liquidityMiningAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdrawTokens","inputs":[{"type":"address","name":"_token","internalType":"contract IERC20"},{"type":"address","name":"_to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"extraDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"fundingWallet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"ethRaised","internalType":"uint256"},{"type":"uint256","name":"tokensSold","internalType":"uint256"},{"type":"uint256","name":"participantsCount","internalType":"uint256"}],"name":"getCrowdsaleStats","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"currentPrice","internalType":"uint256"},{"type":"uint256","name":"remainingTime","internalType":"uint256"},{"type":"uint256","name":"totalParticipants","internalType":"uint256"},{"type":"uint256","name":"raisedAmount","internalType":"uint256"},{"type":"uint256","name":"remainingTokens","internalType":"uint256"},{"type":"uint8","name":"currentState","internalType":"enum GDCrowdsale.CrowdsaleState"}],"name":"getCrowdsaleStatus","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCurrentPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct GDCrowdsale.PurchaseInfo[]","components":[{"type":"uint256","name":"purchaseTime","internalType":"uint256"},{"type":"uint256","name":"ethAmount","internalType":"uint256"},{"type":"uint256","name":"tokenAmount","internalType":"uint256"},{"type":"uint256","name":"price","internalType":"uint256"}]}],"name":"getPurchaseInfoBatch","inputs":[{"type":"address[]","name":"_purchasers","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"_purchasers","internalType":"address[]"},{"type":"uint256","name":"total","internalType":"uint256"}],"name":"getPurchasersPaginated","inputs":[{"type":"uint256","name":"offset","internalType":"uint256"},{"type":"uint256","name":"limit","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"initialDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"purchasers","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"purchaseTime","internalType":"uint256"},{"type":"uint256","name":"ethAmount","internalType":"uint256"},{"type":"uint256","name":"tokenAmount","internalType":"uint256"},{"type":"uint256","name":"price","internalType":"uint256"}],"name":"purchases","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"saleToken","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCrowdsaleState","inputs":[{"type":"uint8","name":"_state","internalType":"enum GDCrowdsale.CrowdsaleState"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"enum GDCrowdsale.CrowdsaleState"}],"name":"state","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalRaised","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalTokensSold","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateCrowdsaleDuration","inputs":[{"type":"uint256","name":"_extraDuration","internalType":"uint256"}]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

0x60e06040523480156200001157600080fd5b5060405162002797380380620027978339810160408190526200003491620001d4565b6001600055620000443362000169565b6001600160a01b03831615806200006257506001600160a01b038216155b15620000815760405163e6c4247b60e01b815260040160405180910390fd5b80600003620000a357604051637616640160e01b815260040160405180910390fd5b6001600160a01b03808416608052821660a0524260c0526005819055600060068190556004805460ff191660018302179055506000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000117573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200013d91906200021c565b90506200014c81600a6200035d565b6200015b90620f42406200036e565b600955506200038892505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381168114620001d157600080fd5b50565b600080600060608486031215620001ea57600080fd5b8351620001f781620001bb565b60208501519093506200020a81620001bb565b80925050604084015190509250925092565b6000602082840312156200022f57600080fd5b815160ff811681146200024157600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156200029f57816000190482111562000283576200028362000248565b808516156200029157918102915b93841c939080029062000263565b509250929050565b600082620002b85750600162000357565b81620002c75750600062000357565b8160018114620002e05760028114620002eb576200030b565b600191505062000357565b60ff841115620002ff57620002ff62000248565b50506001821b62000357565b5060208310610133831016604e8410600b841016171562000330575081810a62000357565b6200033c83836200025e565b806000190482111562000353576200035362000248565b0290505b92915050565b60006200024160ff841683620002a7565b808202811582820484141762000357576200035762000248565b60805160a05160c051612384620004136000396000818161039f015281816106c301528181610e0f01528181610e430152818161106701528181611850015261189201526000818161029e01526109d901526000818161059a01528181610824015281816109ae01528181610eb10152818161119c0152818161128101526112c301526123846000f3fe6080604052600436106101c65760003560e01c80638da5cb5b116100f7578063c19d93fb11610095578063dbfb72ee11610064578063dbfb72ee14610568578063e985e36714610588578063eb91d37e146105bc578063f2fde38b146105d157600080fd5b8063c19d93fb14610508578063c5c4744c1461052f578063d7bb99ba14610545578063db1678761461054d57600080fd5b8063a8d7c20b116100d1578063a8d7c20b1461048e578063aa48b5e5146104a4578063ac2885e9146104c4578063b815a357146104f257600080fd5b80638da5cb5b146104235780638fc516e71461044e578063a24bcf461461046e57600080fd5b80635cad7cfb11610164578063715018a61161013e578063715018a61461037857806378e979251461038d5780637f49f644146102e4578063842a77d3146103c157600080fd5b80635cad7cfb1461031f57806360a09a0d1461034657806363b201171461036257600080fd5b80633c4b40b8116101a05780633c4b40b81461028c5780634781ca76146102c057806354545bfb146102e4578063576bc025146102ff57600080fd5b80630388c128146101e0578063110719ed1461021657806312923b651461024757600080fd5b366101db5734156101d9576101d96105f1565b005b600080fd5b3480156101ec57600080fd5b506102006101fb366004611e92565b610b13565b60405161020d9190611f07565b60405180910390f35b34801561022257600080fd5b506002546003546008546040805193845260208401929092529082015260600161020d565b34801561025357600080fd5b50610267610262366004611f6b565b610c6c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161020d565b34801561029857600080fd5b506102677f000000000000000000000000000000000000000000000000000000000000000081565b3480156102cc57600080fd5b506102d660065481565b60405190815260200161020d565b3480156102f057600080fd5b506102d6662386f26fc1000081565b34801561030b57600080fd5b506101d961031a366004611f6b565b610ca3565b34801561032b57600080fd5b50610334610de4565b60405161020d96959493929190611fee565b34801561035257600080fd5b506102d6670de0b6b3a764000081565b34801561036e57600080fd5b506102d660035481565b34801561038457600080fd5b506101d9610f4d565b34801561039957600080fd5b506102d67f000000000000000000000000000000000000000000000000000000000000000081565b3480156103cd57600080fd5b506104036103dc366004612040565b60076020526000908152604090208054600182015460028301546003909301549192909184565b60408051948552602085019390935291830152606082015260800161020d565b34801561042f57600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff16610267565b34801561045a57600080fd5b506101d9610469366004612040565b610fda565b34801561047a57600080fd5b506102d6610489366004611f6b565b611379565b34801561049a57600080fd5b506102d660095481565b3480156104b057600080fd5b506101d96104bf36600461205d565b61139a565b3480156104d057600080fd5b506104e46104df36600461207e565b611529565b60405161020d9291906120a0565b3480156104fe57600080fd5b506102d660055481565b34801561051457600080fd5b506004546105229060ff1681565b60405161020d91906120fe565b34801561053b57600080fd5b506102d660025481565b6101d96105f1565b34801561055957600080fd5b506102d6662aa1efb94e000081565b34801561057457600080fd5b506101d961058336600461210c565b61163b565b34801561059457600080fd5b506102677f000000000000000000000000000000000000000000000000000000000000000081565b3480156105c857600080fd5b506102d6611849565b3480156105dd57600080fd5b506101d96105ec366004612040565b611916565b600260005403610662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600090815560045460ff16600281111561068057610680611f84565b146106b7576040517fbaf3f0f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546005546106e7907f0000000000000000000000000000000000000000000000000000000000000000612174565b6106f19190612174565b4210610729576040517fd499d29f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260076020526040902054349015610772576040517f22ce1a0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b662386f26fc1000081108061078e5750670de0b6b3a764000081115b156107c5576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006107cf611849565b905060006107dc34611379565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801561086b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088f9190612187565b10156108c7576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051608081018252428152346020808301828152838501868152606085018881523360008181526007909552968420955186559151600180870191909155905160028087019190915591516003909501949094556008805494850181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee390920180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169093179092555461098191611a46565b6002556003546109919082611a46565b6003556109d573ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163383611a59565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163460405160006040518083038185875af1925050503d8060008114610a4f576040519150601f19603f3d011682016040523d82523d6000602084013e610a54565b606091505b5050905080610abf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c6564000000000000000000000000006044820152606401610659565b604080513481526020810184905290810184905242606082015233907f34987d73948b60cfba9beeb35760c345a3be430f3540605113911ead78a0830e9060800160405180910390a2505060016000555050565b606060008267ffffffffffffffff811115610b3057610b306121a0565b604051908082528060200260200182016040528015610b8c57816020015b610b796040518060800160405280600081526020016000815260200160008152602001600081525090565b815260200190600190039081610b4e5790505b50905060005b83811015610c625760076000868684818110610bb057610bb06121cf565b9050602002016020810190610bc59190612040565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050828281518110610c4457610c446121cf565b60200260200101819052508080610c5a906121fe565b915050610b92565b5090505b92915050565b60088181548110610c7c57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b600260045460ff166002811115610d3d57610d3d611f84565b03610d74576040517fd499d29f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600654600554610d869190612174565b9050816006819055507fb6a57a98fb87d8a2ce4f0a0e88314d5db2dd60f4db3c12b1efb07675442036da81600654600554610dc19190612174565b604080519283526020830191909152429082015260600160405180910390a15050565b600080600080600080600080610e07600654600554611a4690919063ffffffff16565b9050610e33817f0000000000000000000000000000000000000000000000000000000000000000612174565b421015610e7157610e6e42610e687f000000000000000000000000000000000000000000000000000000000000000084611a46565b90611aeb565b91505b610e79611849565b6008546002546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152859291907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f319190612187565b600454949d939c50919a509850965060ff909116945092505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610fce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b610fd86000611af7565b565b60015473ffffffffffffffffffffffffffffffffffffffff16331461105b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b60065460055461108b907f0000000000000000000000000000000000000000000000000000000000000000612174565b6110959190612174565b4210156110ce576040517f09af549600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260045460ff1660028111156110e7576110e7611f84565b0361111e576040517fcce553a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661116b576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156111f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121c9190612187565b905080600003611258576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611265826002611b6e565b90506112a973ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600083611a59565b6112ea73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168483611a59565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660021790556040805182815260208101839052429181019190915273ffffffffffffffffffffffffffffffffffffffff8416906000907f5e9e3288e61ee42a01d4c8dbe06ad262f092567d140c1abeb34ad1443b9f021f906060015b60405180910390a3505050565b6000610c66611386611849565b600954611394908590611b7a565b90611b6e565b60015473ffffffffffffffffffffffffffffffffffffffff16331461141b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b600281600281111561142f5761142f611f84565b14806114515750600260045460ff16600281111561144f5761144f611f84565b145b15611488576040517fbaf3f0f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805460ff81169183917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360028111156114c9576114c9611f84565b02179055508160028111156114e0576114e0611f84565b8160028111156114f2576114f2611f84565b6040514281527f8b0ede44a5d742d907c9beb8e7abb0f81b08b6f4626a5c357e1fe4515544adb99060200160405180910390a35050565b60606000806115388486612174565b60085490915081111561154a57506008545b60006115568683612236565b67ffffffffffffffff81111561156e5761156e6121a0565b604051908082528060200260200182016040528015611597578160200160208202803683370190505b509050855b8281101561162b57600881815481106115b7576115b76121cf565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16826115e48984612236565b815181106115f4576115f46121cf565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015280611623816121fe565b91505061159c565b5060085490969095509350505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146116bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b73ffffffffffffffffffffffffffffffffffffffff8116611709576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015611776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179a9190612187565b9050806000036117d6576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117f773ffffffffffffffffffffffffffffffffffffffff84168383611a59565b6040805182815242602082015273ffffffffffffffffffffffffffffffffffffffff80851692908616917f6b83b455c317523498e4e86849438d4356ad79ba6b355a5e6d5bc05eca6c780f910161136c565b60006005547f00000000000000000000000000000000000000000000000000000000000000006118799190612174565b421061188b5750662aa1efb94e000090565b60006118b77f000000000000000000000000000000000000000000000000000000000000000042612236565b905060006118ec600554611394846118e6662386f26fc10000662aa1efb94e0000611aeb90919063ffffffff16565b90611b7a565b905061190f611902662386f26fc1000083611a46565b662aa1efb94e0000611b86565b9250505090565b60015473ffffffffffffffffffffffffffffffffffffffff163314611997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b73ffffffffffffffffffffffffffffffffffffffff8116611a3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610659565b611a4381611af7565b50565b6000611a528284612174565b9392505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611ae6908490611b9c565b505050565b6000611a528284612236565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611a528284612249565b6000611a528284612284565b6000818310611b955781611a52565b5090919050565b6000611bfe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611ca89092919063ffffffff16565b805190915015611ae65780806020019051810190611c1c919061229b565b611ae6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610659565b6060611cb78484600085611cbf565b949350505050565b606082471015611d51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610659565b843b611db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610659565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611de291906122e1565b60006040518083038185875af1925050503d8060008114611e1f576040519150601f19603f3d011682016040523d82523d6000602084013e611e24565b606091505b5091509150611e34828286611e3f565b979650505050505050565b60608315611e4e575081611a52565b825115611e5e5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065991906122fd565b60008060208385031215611ea557600080fd5b823567ffffffffffffffff80821115611ebd57600080fd5b818501915085601f830112611ed157600080fd5b813581811115611ee057600080fd5b8660208260051b8501011115611ef557600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b82811015611f5e57815180518552868101518786015285810151868601526060908101519085015260809093019290850190600101611f24565b5091979650505050505050565b600060208284031215611f7d57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60038110611fea577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b600060c082019050878252866020830152856040830152846060830152836080830152611e3460a0830184611fb3565b73ffffffffffffffffffffffffffffffffffffffff81168114611a4357600080fd5b60006020828403121561205257600080fd5b8135611a528161201e565b60006020828403121561206f57600080fd5b813560038110611a5257600080fd5b6000806040838503121561209157600080fd5b50508035926020909101359150565b604080825283519082018190526000906020906060840190828701845b828110156120ef57815173ffffffffffffffffffffffffffffffffffffffff16845292840192908401906001016120bd565b50505092019290925292915050565b60208101610c668284611fb3565b6000806040838503121561211f57600080fd5b823561212a8161201e565b9150602083013561213a8161201e565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610c6657610c66612145565b60006020828403121561219957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361222f5761222f612145565b5060010190565b81810381811115610c6657610c66612145565b60008261227f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082028115828204841417610c6657610c66612145565b6000602082840312156122ad57600080fd5b81518015158114611a5257600080fd5b60005b838110156122d85781810151838201526020016122c0565b50506000910152565b600082516122f38184602087016122bd565b9190910192915050565b602081526000825180602084015261231c8160408501602087016122bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220fb75c37205f90ac573bfbab9b7c2b2a8099e69245349e97a5c09b62a931d469864736f6c63430008120033000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd0000000000000000000000008687d85e907657107323b4b3ad2b814b9647bc820000000000000000000000000000000000000000000000000000000000093a80

Deployed ByteCode

0x6080604052600436106101c65760003560e01c80638da5cb5b116100f7578063c19d93fb11610095578063dbfb72ee11610064578063dbfb72ee14610568578063e985e36714610588578063eb91d37e146105bc578063f2fde38b146105d157600080fd5b8063c19d93fb14610508578063c5c4744c1461052f578063d7bb99ba14610545578063db1678761461054d57600080fd5b8063a8d7c20b116100d1578063a8d7c20b1461048e578063aa48b5e5146104a4578063ac2885e9146104c4578063b815a357146104f257600080fd5b80638da5cb5b146104235780638fc516e71461044e578063a24bcf461461046e57600080fd5b80635cad7cfb11610164578063715018a61161013e578063715018a61461037857806378e979251461038d5780637f49f644146102e4578063842a77d3146103c157600080fd5b80635cad7cfb1461031f57806360a09a0d1461034657806363b201171461036257600080fd5b80633c4b40b8116101a05780633c4b40b81461028c5780634781ca76146102c057806354545bfb146102e4578063576bc025146102ff57600080fd5b80630388c128146101e0578063110719ed1461021657806312923b651461024757600080fd5b366101db5734156101d9576101d96105f1565b005b600080fd5b3480156101ec57600080fd5b506102006101fb366004611e92565b610b13565b60405161020d9190611f07565b60405180910390f35b34801561022257600080fd5b506002546003546008546040805193845260208401929092529082015260600161020d565b34801561025357600080fd5b50610267610262366004611f6b565b610c6c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161020d565b34801561029857600080fd5b506102677f0000000000000000000000008687d85e907657107323b4b3ad2b814b9647bc8281565b3480156102cc57600080fd5b506102d660065481565b60405190815260200161020d565b3480156102f057600080fd5b506102d6662386f26fc1000081565b34801561030b57600080fd5b506101d961031a366004611f6b565b610ca3565b34801561032b57600080fd5b50610334610de4565b60405161020d96959493929190611fee565b34801561035257600080fd5b506102d6670de0b6b3a764000081565b34801561036e57600080fd5b506102d660035481565b34801561038457600080fd5b506101d9610f4d565b34801561039957600080fd5b506102d67f0000000000000000000000000000000000000000000000000000000067d0cc1781565b3480156103cd57600080fd5b506104036103dc366004612040565b60076020526000908152604090208054600182015460028301546003909301549192909184565b60408051948552602085019390935291830152606082015260800161020d565b34801561042f57600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff16610267565b34801561045a57600080fd5b506101d9610469366004612040565b610fda565b34801561047a57600080fd5b506102d6610489366004611f6b565b611379565b34801561049a57600080fd5b506102d660095481565b3480156104b057600080fd5b506101d96104bf36600461205d565b61139a565b3480156104d057600080fd5b506104e46104df36600461207e565b611529565b60405161020d9291906120a0565b3480156104fe57600080fd5b506102d660055481565b34801561051457600080fd5b506004546105229060ff1681565b60405161020d91906120fe565b34801561053b57600080fd5b506102d660025481565b6101d96105f1565b34801561055957600080fd5b506102d6662aa1efb94e000081565b34801561057457600080fd5b506101d961058336600461210c565b61163b565b34801561059457600080fd5b506102677f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd81565b3480156105c857600080fd5b506102d6611849565b3480156105dd57600080fd5b506101d96105ec366004612040565b611916565b600260005403610662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600090815560045460ff16600281111561068057610680611f84565b146106b7576040517fbaf3f0f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546005546106e7907f0000000000000000000000000000000000000000000000000000000067d0cc17612174565b6106f19190612174565b4210610729576040517fd499d29f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260076020526040902054349015610772576040517f22ce1a0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b662386f26fc1000081108061078e5750670de0b6b3a764000081115b156107c5576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006107cf611849565b905060006107dc34611379565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd16906370a0823190602401602060405180830381865afa15801561086b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088f9190612187565b10156108c7576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051608081018252428152346020808301828152838501868152606085018881523360008181526007909552968420955186559151600180870191909155905160028087019190915591516003909501949094556008805494850181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee390920180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169093179092555461098191611a46565b6002556003546109919082611a46565b6003556109d573ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd163383611a59565b60007f0000000000000000000000008687d85e907657107323b4b3ad2b814b9647bc8273ffffffffffffffffffffffffffffffffffffffff163460405160006040518083038185875af1925050503d8060008114610a4f576040519150601f19603f3d011682016040523d82523d6000602084013e610a54565b606091505b5050905080610abf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c6564000000000000000000000000006044820152606401610659565b604080513481526020810184905290810184905242606082015233907f34987d73948b60cfba9beeb35760c345a3be430f3540605113911ead78a0830e9060800160405180910390a2505060016000555050565b606060008267ffffffffffffffff811115610b3057610b306121a0565b604051908082528060200260200182016040528015610b8c57816020015b610b796040518060800160405280600081526020016000815260200160008152602001600081525090565b815260200190600190039081610b4e5790505b50905060005b83811015610c625760076000868684818110610bb057610bb06121cf565b9050602002016020810190610bc59190612040565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050828281518110610c4457610c446121cf565b60200260200101819052508080610c5a906121fe565b915050610b92565b5090505b92915050565b60088181548110610c7c57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b600260045460ff166002811115610d3d57610d3d611f84565b03610d74576040517fd499d29f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600654600554610d869190612174565b9050816006819055507fb6a57a98fb87d8a2ce4f0a0e88314d5db2dd60f4db3c12b1efb07675442036da81600654600554610dc19190612174565b604080519283526020830191909152429082015260600160405180910390a15050565b600080600080600080600080610e07600654600554611a4690919063ffffffff16565b9050610e33817f0000000000000000000000000000000000000000000000000000000067d0cc17612174565b421015610e7157610e6e42610e687f0000000000000000000000000000000000000000000000000000000067d0cc1784611a46565b90611aeb565b91505b610e79611849565b6008546002546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152859291907f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd73ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f319190612187565b600454949d939c50919a509850965060ff909116945092505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610fce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b610fd86000611af7565b565b60015473ffffffffffffffffffffffffffffffffffffffff16331461105b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b60065460055461108b907f0000000000000000000000000000000000000000000000000000000067d0cc17612174565b6110959190612174565b4210156110ce576040517f09af549600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260045460ff1660028111156110e7576110e7611f84565b0361111e576040517fcce553a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661116b576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd73ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156111f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121c9190612187565b905080600003611258576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611265826002611b6e565b90506112a973ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd16600083611a59565b6112ea73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000abccefb00528c9c792ac7c46997f0f6ee5dcdddd168483611a59565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660021790556040805182815260208101839052429181019190915273ffffffffffffffffffffffffffffffffffffffff8416906000907f5e9e3288e61ee42a01d4c8dbe06ad262f092567d140c1abeb34ad1443b9f021f906060015b60405180910390a3505050565b6000610c66611386611849565b600954611394908590611b7a565b90611b6e565b60015473ffffffffffffffffffffffffffffffffffffffff16331461141b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b600281600281111561142f5761142f611f84565b14806114515750600260045460ff16600281111561144f5761144f611f84565b145b15611488576040517fbaf3f0f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805460ff81169183917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360028111156114c9576114c9611f84565b02179055508160028111156114e0576114e0611f84565b8160028111156114f2576114f2611f84565b6040514281527f8b0ede44a5d742d907c9beb8e7abb0f81b08b6f4626a5c357e1fe4515544adb99060200160405180910390a35050565b60606000806115388486612174565b60085490915081111561154a57506008545b60006115568683612236565b67ffffffffffffffff81111561156e5761156e6121a0565b604051908082528060200260200182016040528015611597578160200160208202803683370190505b509050855b8281101561162b57600881815481106115b7576115b76121cf565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16826115e48984612236565b815181106115f4576115f46121cf565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015280611623816121fe565b91505061159c565b5060085490969095509350505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146116bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b73ffffffffffffffffffffffffffffffffffffffff8116611709576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015611776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179a9190612187565b9050806000036117d6576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117f773ffffffffffffffffffffffffffffffffffffffff84168383611a59565b6040805182815242602082015273ffffffffffffffffffffffffffffffffffffffff80851692908616917f6b83b455c317523498e4e86849438d4356ad79ba6b355a5e6d5bc05eca6c780f910161136c565b60006005547f0000000000000000000000000000000000000000000000000000000067d0cc176118799190612174565b421061188b5750662aa1efb94e000090565b60006118b77f0000000000000000000000000000000000000000000000000000000067d0cc1742612236565b905060006118ec600554611394846118e6662386f26fc10000662aa1efb94e0000611aeb90919063ffffffff16565b90611b7a565b905061190f611902662386f26fc1000083611a46565b662aa1efb94e0000611b86565b9250505090565b60015473ffffffffffffffffffffffffffffffffffffffff163314611997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610659565b73ffffffffffffffffffffffffffffffffffffffff8116611a3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610659565b611a4381611af7565b50565b6000611a528284612174565b9392505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611ae6908490611b9c565b505050565b6000611a528284612236565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611a528284612249565b6000611a528284612284565b6000818310611b955781611a52565b5090919050565b6000611bfe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611ca89092919063ffffffff16565b805190915015611ae65780806020019051810190611c1c919061229b565b611ae6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610659565b6060611cb78484600085611cbf565b949350505050565b606082471015611d51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610659565b843b611db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610659565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611de291906122e1565b60006040518083038185875af1925050503d8060008114611e1f576040519150601f19603f3d011682016040523d82523d6000602084013e611e24565b606091505b5091509150611e34828286611e3f565b979650505050505050565b60608315611e4e575081611a52565b825115611e5e5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065991906122fd565b60008060208385031215611ea557600080fd5b823567ffffffffffffffff80821115611ebd57600080fd5b818501915085601f830112611ed157600080fd5b813581811115611ee057600080fd5b8660208260051b8501011115611ef557600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b82811015611f5e57815180518552868101518786015285810151868601526060908101519085015260809093019290850190600101611f24565b5091979650505050505050565b600060208284031215611f7d57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60038110611fea577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b600060c082019050878252866020830152856040830152846060830152836080830152611e3460a0830184611fb3565b73ffffffffffffffffffffffffffffffffffffffff81168114611a4357600080fd5b60006020828403121561205257600080fd5b8135611a528161201e565b60006020828403121561206f57600080fd5b813560038110611a5257600080fd5b6000806040838503121561209157600080fd5b50508035926020909101359150565b604080825283519082018190526000906020906060840190828701845b828110156120ef57815173ffffffffffffffffffffffffffffffffffffffff16845292840192908401906001016120bd565b50505092019290925292915050565b60208101610c668284611fb3565b6000806040838503121561211f57600080fd5b823561212a8161201e565b9150602083013561213a8161201e565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610c6657610c66612145565b60006020828403121561219957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361222f5761222f612145565b5060010190565b81810381811115610c6657610c66612145565b60008261227f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082028115828204841417610c6657610c66612145565b6000602082840312156122ad57600080fd5b81518015158114611a5257600080fd5b60005b838110156122d85781810151838201526020016122c0565b50506000910152565b600082516122f38184602087016122bd565b9190910192915050565b602081526000825180602084015261231c8160408501602087016122bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220fb75c37205f90ac573bfbab9b7c2b2a8099e69245349e97a5c09b62a931d469864736f6c63430008120033