ETH Price: $2,162.21 (+4.31%)

Contract

0xe2287dCBFe0D9aE5E2CCd46447ED37e29F0C94De
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Age:90D
Reset Filter

Transaction Hash
Method
Block
From
To

There are no matching entries

Update your filters to view other transactions

Age:90D
Reset Filter

Advanced mode:
Parent Transaction Hash Method Block
From
To

There are no matching entries

Update your filters to view other transactions

View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FinaCrowdsale

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;
pragma abicoder v2; // solhint-disable-line

import "@openzeppelin/contracts/utils/Pausable.sol";
import "./CappedTokenSoldCrowdsaleHelper.sol";
import "./FinaWhitelistCrowdsaleHelper.sol";
import "./HoldErc20TokenCrowdsaleHelper.sol";
import "./NoDeliveryCrowdsale.sol";
import "./TimedCrowdsaleHelper.sol";
import "./interfaces/IFinaCrowdsale.sol";

/**
 * @title FinaCrowdsale
 * @author Enjinstarter
 * @dev Defina "FINA" Crowdsale where there is no delivery of tokens in each purchase.
 */
contract FinaCrowdsale is
    NoDeliveryCrowdsale,
    CappedTokenSoldCrowdsaleHelper,
    HoldErc20TokenCrowdsaleHelper,
    TimedCrowdsaleHelper,
    FinaWhitelistCrowdsaleHelper,
    Pausable,
    IFinaCrowdsale
{
    using SafeMath for uint256;

    // https://github.com/crytic/slither/wiki/Detector-Documentation#too-many-digits
    // slither-disable-next-line too-many-digits
    address public constant DEAD_ADDRESS =
        0x000000000000000000000000000000000000dEaD;

    struct FinaCrowdsaleInfo {
        uint256 tokenCap;
        address whitelistContract;
        address tokenHold;
        uint256 minTokenHoldAmount;
    }

    address public governanceAccount;
    address public crowdsaleAdmin;

    // max 1 lot
    constructor(
        address wallet_,
        FinaCrowdsaleInfo memory crowdsaleInfo,
        LotsInfo memory lotsInfo,
        Timeframe memory timeframe,
        PaymentTokenInfo[] memory paymentTokensInfo
    )
        Crowdsale(wallet_, DEAD_ADDRESS, lotsInfo, paymentTokensInfo)
        CappedTokenSoldCrowdsaleHelper(crowdsaleInfo.tokenCap)
        HoldErc20TokenCrowdsaleHelper(
            crowdsaleInfo.tokenHold,
            crowdsaleInfo.minTokenHoldAmount
        )
        TimedCrowdsaleHelper(timeframe)
        FinaWhitelistCrowdsaleHelper(crowdsaleInfo.whitelistContract)
    {
        governanceAccount = msg.sender;
        crowdsaleAdmin = msg.sender;
    }

    modifier onlyBy(address account) {
        require(msg.sender == account, "FinaCrowdsale: sender unauthorized");
        _;
    }

    /**
     * @return availableLots Available number of lots for beneficiary
     */
    function getAvailableLotsFor(address beneficiary)
        external
        view
        override
        returns (uint256 availableLots)
    {
        if (!whitelisted(beneficiary)) {
            return 0;
        }

        availableLots = _getAvailableTokensFor(beneficiary).div(
            getBeneficiaryCap(beneficiary)
        );
    }

    /**
     * @return remainingTokens Remaining number of tokens for crowdsale
     */
    function getRemainingTokens()
        external
        view
        override
        returns (uint256 remainingTokens)
    {
        remainingTokens = tokenCap().sub(tokensSold);
    }

    function pause() external override onlyBy(crowdsaleAdmin) {
        _pause();
    }

    function unpause() external override onlyBy(crowdsaleAdmin) {
        _unpause();
    }

    function extendTime(uint256 newClosingTime)
        external
        override
        onlyBy(crowdsaleAdmin)
    {
        _extendTime(newClosingTime);
    }

    function setGovernanceAccount(address account)
        external
        override
        onlyBy(governanceAccount)
    {
        require(account != address(0), "FinaCrowdsale: zero account");

        governanceAccount = account;
    }

    function setCrowdsaleAdmin(address account)
        external
        override
        onlyBy(governanceAccount)
    {
        require(account != address(0), "FinaCrowdsale: zero account");

        crowdsaleAdmin = account;
    }

    /**
     * @param beneficiary Address receiving the tokens
     * @return lotSize_ lot size of token being sold
     */
    function _lotSize(address beneficiary)
        internal
        view
        override
        returns (uint256 lotSize_)
    {
        lotSize_ = getBeneficiaryCap(beneficiary);
    }

    /**
     * @dev Override to extend the way in which payment token is converted to tokens.
     * @param lots Number of lots of token being sold
     * @param beneficiary Address receiving the tokens
     * @return tokenAmount Number of tokens that will be purchased
     */
    function _getTokenAmount(uint256 lots, address beneficiary)
        internal
        view
        override
        returns (uint256 tokenAmount)
    {
        tokenAmount = lots.mul(_lotSize(beneficiary));
    }

    /**
     * @param beneficiary Token beneficiary
     * @param paymentToken ERC20 payment token address
     * @param weiAmount Amount of wei contributed
     * @param tokenAmount Number of tokens to be purchased
     */
    function _preValidatePurchase(
        address beneficiary,
        address paymentToken,
        uint256 weiAmount,
        uint256 tokenAmount
    )
        internal
        view
        override
        whenNotPaused
        onlyWhileOpen
        tokenCapNotExceeded(tokensSold, tokenAmount)
        holdsSufficientTokens(beneficiary)
        isWhitelisted(beneficiary)
    {
        // TODO: Investigate why modifier and require() don't work consistently for beneficiaryCapNotExceeded()
        if (
            getTokensPurchasedBy(beneficiary).add(tokenAmount) >
            getBeneficiaryCap(beneficiary)
        ) {
            revert("FinaCrowdsale: beneficiary cap exceeded");
        }

        super._preValidatePurchase(
            beneficiary,
            paymentToken,
            weiAmount,
            tokenAmount
        );
    }

    /**
     * @dev Extend parent behavior to update purchased amount of tokens by beneficiary.
     * @param beneficiary Token purchaser
     * @param paymentToken ERC20 payment token address
     * @param weiAmount Amount in wei of ERC20 payment token
     * @param tokenAmount Number of tokens to be purchased
     */
    function _updatePurchasingState(
        address beneficiary,
        address paymentToken,
        uint256 weiAmount,
        uint256 tokenAmount
    ) internal override {
        super._updatePurchasingState(
            beneficiary,
            paymentToken,
            weiAmount,
            tokenAmount
        );

        _updateBeneficiaryTokensPurchased(beneficiary, tokenAmount);
    }
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

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

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

    bool private _paused;

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

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

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

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

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

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

// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;

import "@openzeppelin/contracts/math/SafeMath.sol";

/**
 * @title CappedTokenSoldCrowdsaleHelper
 * @author Enjinstarter
 * @dev Helper for crowdsale with a limit for total tokens sold.
 */
contract CappedTokenSoldCrowdsaleHelper {
    using SafeMath for uint256;

    uint256 private _tokenCap;

    /**
     * @param tokenCap_ Max amount of tokens to be sold
     */
    constructor(uint256 tokenCap_) {
        require(tokenCap_ > 0, "CappedTokenSoldHelper: zero cap");
        _tokenCap = tokenCap_;
    }

    modifier tokenCapNotExceeded(uint256 tokensSold, uint256 tokenAmount) {
        require(
            tokensSold.add(tokenAmount) <= _tokenCap,
            "CappedTokenSoldHelper: cap exceeded"
        );
        _;
    }

    /**
     * @return tokenCap_ the token cap of the crowdsale.
     */
    function tokenCap() public view returns (uint256 tokenCap_) {
        tokenCap_ = _tokenCap;
    }

    /**
     * @dev Checks whether the token cap has been reached.
     * @return tokenCapReached_ Whether the token cap was reached
     */
    function tokenCapReached(uint256 tokensSold)
        external
        view
        returns (bool tokenCapReached_)
    {
        tokenCapReached_ = (tokensSold >= _tokenCap);
    }
}

// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "./interfaces/IFinaWhitelist.sol";

/**
 * @title FinaWhitelistCrowdsaleHelper
 * @author Enjinstarter
 * @dev Helper for crowdsale in which only whitelisted users can contribute.
 */
contract FinaWhitelistCrowdsaleHelper {
    using SafeMath for uint256;

    address public whitelistContract;

    mapping(address => uint256) private _tokensPurchased;

    /**
     * @param whitelistContract_ whitelist contract address
     */
    constructor(address whitelistContract_) {
        require(
            whitelistContract_ != address(0),
            "FinaWhitelistCrowdsaleHelper: zero whitelist address"
        );

        whitelistContract = whitelistContract_;
    }

    // TODO: Investigate why modifier and require() don't work consistently for beneficiaryCapNotExceeded()
    /*
    modifier beneficiaryCapNotExceeded(
        address beneficiary,
        uint256 tokenAmount
    ) {
        require(
            _tokensPurchased[beneficiary].add(tokenAmount) <=
                IFinaWhitelist(whitelistContract).whitelistedAmountFor(
                    beneficiary
                ),
            "FinaWhitelistCrowdsaleHelper: beneficiary cap exceeded"
        );
        _;
    }
    */

    modifier isWhitelisted(address account) {
        require(
            IFinaWhitelist(whitelistContract).isWhitelisted(account),
            "FinaWhitelistCrowdsaleHelper: account not whitelisted"
        );
        _;
    }

    /**
     * @return tokenCap Cap for beneficiary in wei
     */
    function getBeneficiaryCap(address beneficiary)
        public
        view
        returns (uint256 tokenCap)
    {
        require(
            beneficiary != address(0),
            "FinaWhitelistCrowdsaleHelper: zero beneficiary address"
        );

        tokenCap = IFinaWhitelist(whitelistContract).whitelistedAmountFor(
            beneficiary
        );
    }

    /**
     * @dev Returns the amount of tokens purchased so far by specific beneficiary.
     * @param beneficiary Address of contributor
     * @return tokensPurchased Tokens purchased by beneficiary so far in wei
     */
    function getTokensPurchasedBy(address beneficiary)
        public
        view
        returns (uint256 tokensPurchased)
    {
        require(
            beneficiary != address(0),
            "FinaWhitelistCrowdsaleHelper: zero beneficiary address"
        );

        tokensPurchased = _tokensPurchased[beneficiary];
    }

    function whitelisted(address account)
        public
        view
        returns (bool whitelisted_)
    {
        require(
            account != address(0),
            "FinaWhitelistCrowdsaleHelper: zero account"
        );

        whitelisted_ = IFinaWhitelist(whitelistContract).isWhitelisted(account);
    }

    /**
     * @param beneficiary Address of contributor
     * @param tokenAmount Amount in wei of token being purchased
     */
    function _updateBeneficiaryTokensPurchased(
        address beneficiary,
        uint256 tokenAmount
    ) internal {
        _tokensPurchased[beneficiary] = _tokensPurchased[beneficiary].add(
            tokenAmount
        );
    }

    /**
     * @return availableTokens Available number of tokens for purchase by beneficiary
     */
    function _getAvailableTokensFor(address beneficiary)
        internal
        view
        returns (uint256 availableTokens)
    {
        availableTokens = getBeneficiaryCap(beneficiary).sub(
            getTokensPurchasedBy(beneficiary)
        );
    }
}

File 5 of 17 : HoldErc20TokenCrowdsaleHelper.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;

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

/**
 * @title HoldErc20TokenCrowdsaleHelper
 * @author Enjinstarter
 * @dev Helper for crowdsale where only wallets with specified amount of ERC20 token can contribute.
 */
contract HoldErc20TokenCrowdsaleHelper {
    using SafeERC20 for IERC20;

    address public tokenHoldContract;
    uint256 public minTokenHoldAmount;

    /**
     * @param tokenHoldContract_ ERC20 token contract address
     * @param minTokenHoldAmount_ minimum amount of token required to hold
     */
    constructor(address tokenHoldContract_, uint256 minTokenHoldAmount_) {
        require(
            tokenHoldContract_ != address(0),
            "HoldErc20TokenCrowdsaleHelper: zero token hold address"
        );

        require(
            minTokenHoldAmount_ > 0,
            "HoldErc20TokenCrowdsaleHelper: zero min token hold amount"
        );

        tokenHoldContract = tokenHoldContract_;
        minTokenHoldAmount = minTokenHoldAmount_;
    }

    modifier holdsSufficientTokens(address account) {
        require(
            IERC20(tokenHoldContract).balanceOf(account) >= minTokenHoldAmount,
            "HoldErc20TokenCrowdsaleHelper: account hold less than min"
        );
        _;
    }
}

File 6 of 17 : NoDeliveryCrowdsale.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;

import "./Crowdsale.sol";

/**
 * @title NoDeliveryCrowdsale
 * @author Enjinstarter
 * @dev Extension of Crowdsale contract where purchased tokens are not delivered.
 */
abstract contract NoDeliveryCrowdsale is Crowdsale {
    /**
     * @dev Overrides delivery by not delivering tokens upon purchase.
     */
    function _deliverTokens(address, uint256) internal pure override {
        return;
    }
}

// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;
pragma abicoder v2; // solhint-disable-line

import "@openzeppelin/contracts/math/SafeMath.sol";

/**
 * @title TimedCrowdsaleHelper
 * @author Enjinstarter
 * @dev Helper for crowdsale accepting contributions only within a time frame.
 */
contract TimedCrowdsaleHelper {
    using SafeMath for uint256;

    struct Timeframe {
        uint256 openingTime;
        uint256 closingTime;
    }

    Timeframe private _timeframe;

    /**
     * Event for crowdsale extending
     * @param prevClosingTime old closing time
     * @param newClosingTime new closing time
     */
    event TimedCrowdsaleExtended(
        uint256 prevClosingTime,
        uint256 newClosingTime
    );

    /**
     * @dev Reverts if not in crowdsale time range.
     */
    modifier onlyWhileOpen() {
        require(isOpen(), "TimedCrowdsaleHelper: not open");
        _;
    }

    /**
     * @dev Constructor, takes crowdsale opening and closing times.
     * @param timeframe Crowdsale opening and closing times
     */
    constructor(Timeframe memory timeframe) {
        require(
            timeframe.openingTime >= block.timestamp,
            "TimedCrowdsaleHelper: opening time is before current time"
        );
        require(
            timeframe.closingTime > timeframe.openingTime,
            "TimedCrowdsaleHelper: closing time is before opening time"
        );

        _timeframe.openingTime = timeframe.openingTime;
        _timeframe.closingTime = timeframe.closingTime;
    }

    /**
     * @return the crowdsale opening time.
     */
    function openingTime() external view returns (uint256) {
        return _timeframe.openingTime;
    }

    /**
     * @return the crowdsale closing time.
     */
    function closingTime() public view returns (uint256) {
        return _timeframe.closingTime;
    }

    /**
     * @return true if the crowdsale is open, false otherwise.
     */
    function isOpen() public view returns (bool) {
        return
            block.timestamp >= _timeframe.openingTime &&
            block.timestamp <= _timeframe.closingTime;
    }

    /**
     * @dev Checks whether the period in which the crowdsale is open has already elapsed.
     * @return Whether crowdsale period has elapsed
     */
    function hasClosed() public view returns (bool) {
        return block.timestamp > _timeframe.closingTime;
    }

    /**
     * @dev Extend crowdsale.
     * @param newClosingTime Crowdsale closing time
     */
    // https://github.com/crytic/slither/wiki/Detector-Documentation#dead-code
    // slither-disable-next-line dead-code
    function _extendTime(uint256 newClosingTime) internal {
        require(!hasClosed(), "TimedCrowdsaleHelper: already closed");
        uint256 oldClosingTime = _timeframe.closingTime;
        require(
            newClosingTime > oldClosingTime,
            "TimedCrowdsaleHelper: before current closing time"
        );

        _timeframe.closingTime = newClosingTime;

        emit TimedCrowdsaleExtended(oldClosingTime, newClosingTime);
    }
}

// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;

import "./ICrowdsale.sol";

/**
 * @title IFinaCrowdsale
 * @author Enjinstarter
 */
interface IFinaCrowdsale is ICrowdsale {
    function getAvailableLotsFor(address beneficiary)
        external
        view
        returns (uint256 availableLots);

    function getRemainingTokens()
        external
        view
        returns (uint256 remainingTokens);

    function pause() external;

    function unpause() external;

    function extendTime(uint256 newClosingTime) external;

    function setGovernanceAccount(address account) external;

    function setCrowdsaleAdmin(address account) external;
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
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) {
        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) {
        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) {
        // 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) {
        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) {
        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) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @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) {
        require(b <= a, "SafeMath: subtraction overflow");
        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) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @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. 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) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        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) {
        require(b > 0, "SafeMath: modulo by zero");
        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) {
        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.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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) {
        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) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;

/**
 * @title IFinaWhitelist
 * @author Enjinstarter
 */
interface IFinaWhitelist {
    function addWhitelisted(address account, uint256 amount) external;

    function removeWhitelisted(address account) external;

    function addWhitelistedBatch(
        address[] memory accounts,
        uint256[] memory amounts
    ) external;

    function removeWhitelistedBatch(address[] memory accounts) external;

    function setGovernanceAccount(address account) external;

    function setWhitelistAdmin(address account) external;

    function isWhitelisted(address account)
        external
        view
        returns (bool isWhitelisted_);

    function whitelistedAmountFor(address account)
        external
        view
        returns (uint256 whitelistedAmount);

    event WhitelistedAdded(address indexed account, uint256 amount);
    event WhitelistedRemoved(address indexed account);
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
    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'
        // solhint-disable-next-line max-line-length
        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).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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);
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <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;
        // solhint-disable-next-line no-inline-assembly
        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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;
pragma abicoder v2; // solhint-disable-line

import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./interfaces/ICrowdsale.sol";

/**
 * @title Crowdsale
 * @author Enjinstarter
 * @dev Crowdsale is a base contract for managing a token crowdsale,
 * allowing investors to purchase tokens with ERC20 tokens. This contract implements
 * such functionality in its most fundamental form and can be extended to provide additional
 * functionality and/or custom behavior.
 * The external interface represents the basic interface for purchasing tokens, and conforms
 * the base architecture for crowdsales. It is *not* intended to be modified / overridden.
 * The internal interface conforms the extensible and modifiable surface of crowdsales. Override
 * the methods to add functionality. Consider using 'super' where appropriate to concatenate
 * behavior.
 */
contract Crowdsale is ReentrancyGuard, ICrowdsale {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    uint256 public constant MAX_NUM_PAYMENT_TOKENS = 10;
    uint256 public constant TOKEN_MAX_DECIMALS = 18;
    uint256 public constant TOKEN_SELLING_SCALE = 10**TOKEN_MAX_DECIMALS;

    // Amount of tokens sold
    uint256 public tokensSold;

    // The token being sold
    // https://github.com/crytic/slither/wiki/Detector-Documentation#variable-names-are-too-similar
    // slither-disable-next-line similar-names
    address private _tokenSelling;

    // Lot size and maximum number of lots for token being sold
    LotsInfo private _lotsInfo;

    // Payment tokens
    // https://github.com/crytic/slither/wiki/Detector-Documentation#variable-names-are-too-similar
    // slither-disable-next-line similar-names
    address[] private _paymentTokens;

    // Payment token decimals
    // https://github.com/crytic/slither/wiki/Detector-Documentation#variable-names-are-too-similar
    // slither-disable-next-line similar-names
    mapping(address => uint256) private _paymentDecimals;

    // Indicates whether ERC20 token is acceptable for payment
    mapping(address => bool) private _isPaymentTokens;

    // Address where funds are collected
    address private _wallet;

    // How many weis one token costs for each ERC20 payment token
    mapping(address => uint256) private _rates;

    // Amount of wei raised for each payment token
    mapping(address => uint256) private _weiRaised;

    /**
     * @dev Rates will denote how many weis one token costs for each ERC20 payment token.
     * For USDC or USDT payment token which has 6 decimals, minimum rate will
     * be 1000000000000 which will correspond to a price of USD0.000001 per token.
     * @param wallet_ Address where collected funds will be forwarded to
     * @param tokenSelling_ Address of the token being sold
     * @param lotsInfo Lot size and maximum number of lots for token being sold
     * @param paymentTokensInfo Addresses, decimals, rates and lot sizes of ERC20 tokens acceptable for payment
     */
    constructor(
        address wallet_,
        address tokenSelling_,
        LotsInfo memory lotsInfo,
        PaymentTokenInfo[] memory paymentTokensInfo
    ) {
        require(wallet_ != address(0), "Crowdsale: zero wallet address");
        require(
            tokenSelling_ != address(0),
            "Crowdsale: zero token selling address"
        );
        require(lotsInfo.lotSize > 0, "Crowdsale: zero lot size");
        require(lotsInfo.maxLots > 0, "Crowdsale: zero max lots");
        require(paymentTokensInfo.length > 0, "Crowdsale: zero payment tokens");
        require(
            paymentTokensInfo.length < MAX_NUM_PAYMENT_TOKENS,
            "Crowdsale: exceed max payment tokens"
        );

        _wallet = wallet_;
        _tokenSelling = tokenSelling_;
        _lotsInfo = lotsInfo;

        for (uint256 i = 0; i < paymentTokensInfo.length; i++) {
            uint256 paymentDecimal = paymentTokensInfo[i].paymentDecimal;
            require(
                paymentDecimal <= TOKEN_MAX_DECIMALS,
                "Crowdsale: decimals exceed 18"
            );
            address paymentToken = paymentTokensInfo[i].paymentToken;
            require(
                paymentToken != address(0),
                "Crowdsale: zero payment token address"
            );
            uint256 rate_ = paymentTokensInfo[i].rate;
            require(rate_ > 0, "Crowdsale: zero rate");

            _isPaymentTokens[paymentToken] = true;
            _paymentTokens.push(paymentToken);
            _paymentDecimals[paymentToken] = paymentDecimal;
            _rates[paymentToken] = rate_;
        }
    }

    /**
     * @return tokenSelling_ the token being sold
     */
    function tokenSelling()
        external
        view
        override
        returns (address tokenSelling_)
    {
        tokenSelling_ = _tokenSelling;
    }

    /**
     * @return wallet_ the address where funds are collected
     */
    function wallet() external view override returns (address wallet_) {
        wallet_ = _wallet;
    }

    /**
     * @return paymentTokens_ the payment tokens
     */
    function paymentTokens()
        external
        view
        override
        returns (address[] memory paymentTokens_)
    {
        paymentTokens_ = _paymentTokens;
    }

    /**
     * @param paymentToken ERC20 payment token address
     * @return rate_ how many weis one token costs for specified ERC20 payment token
     */
    function rate(address paymentToken)
        external
        view
        override
        returns (uint256 rate_)
    {
        require(
            paymentToken != address(0),
            "Crowdsale: zero payment token address"
        );
        require(
            isPaymentToken(paymentToken),
            "Crowdsale: payment token unaccepted"
        );

        rate_ = _rate(paymentToken);
    }

    /**
     * @param beneficiary Address performing the token purchase
     * @return lotSize_ lot size of token being sold
     */
    function lotSize(address beneficiary)
        public
        view
        override
        returns (uint256 lotSize_)
    {
        require(
            beneficiary != address(0),
            "Crowdsale: zero beneficiary address"
        );

        lotSize_ = _lotSize(beneficiary);
    }

    /**
     * @return maxLots_ maximum number of lots for token being sold
     */
    function maxLots() external view override returns (uint256 maxLots_) {
        maxLots_ = _lotsInfo.maxLots;
    }

    /**
     * @param paymentToken ERC20 payment token address
     * @return weiRaised_ the amount of wei raised
     */
    function weiRaisedFor(address paymentToken)
        external
        view
        override
        returns (uint256 weiRaised_)
    {
        weiRaised_ = _weiRaisedFor(paymentToken);
    }

    /**
     * @param paymentToken ERC20 payment token address
     * @return isPaymentToken_ whether token is accepted for payment
     */
    function isPaymentToken(address paymentToken)
        public
        view
        override
        returns (bool isPaymentToken_)
    {
        require(
            paymentToken != address(0),
            "Crowdsale: zero payment token address"
        );

        isPaymentToken_ = _isPaymentTokens[paymentToken];
    }

    /**
     * @dev Override to extend the way in which payment token is converted to tokens.
     * @param lots Number of lots of token being sold
     * @param beneficiary Address receiving the tokens
     * @return tokenAmount Number of tokens being sold that will be purchased
     */
    function getTokenAmount(uint256 lots, address beneficiary)
        external
        view
        override
        returns (uint256 tokenAmount)
    {
        require(lots > 0, "Crowdsale: zero lots");
        require(
            beneficiary != address(0),
            "Crowdsale: zero beneficiary address"
        );

        tokenAmount = _getTokenAmount(lots, beneficiary);
    }

    /**
     * @dev Override to extend the way in which payment token is converted to tokens.
     * @param paymentToken ERC20 payment token address
     * @param lots Number of lots of token being sold
     * @param beneficiary Address receiving the tokens
     * @return weiAmount Amount in wei of ERC20 payment token
     */
    function getWeiAmount(
        address paymentToken,
        uint256 lots,
        address beneficiary
    ) external view override returns (uint256 weiAmount) {
        require(
            paymentToken != address(0),
            "Crowdsale: zero payment token address"
        );
        require(lots > 0, "Crowdsale: zero lots");
        require(
            beneficiary != address(0),
            "Crowdsale: zero beneficiary address"
        );
        require(
            isPaymentToken(paymentToken),
            "Crowdsale: payment token unaccepted"
        );

        weiAmount = _getWeiAmount(paymentToken, lots, beneficiary);
    }

    /**
     * @param paymentToken ERC20 payment token address
     * @param lots Number of lots of token being sold
     */
    function buyTokens(address paymentToken, uint256 lots) external override {
        _buyTokensFor(msg.sender, paymentToken, lots);
    }

    /**
     * @param beneficiary Recipient of the token purchase
     * @param paymentToken ERC20 payment token address
     * @param lots Number of lots of token being sold
     */
    function buyTokensFor(
        address beneficiary,
        address paymentToken,
        uint256 lots
    ) external override {
        _buyTokensFor(beneficiary, paymentToken, lots);
    }

    /**
     * @dev low level token purchase ***DO NOT OVERRIDE***
     * This function has a non-reentrancy guard, so it shouldn't be called by
     * another `nonReentrant` function.
     * @param beneficiary Recipient of the token purchase
     * @param paymentToken ERC20 payment token address
     * @param lots Number of lots of token being sold
     */
    function _buyTokensFor(
        address beneficiary,
        address paymentToken,
        uint256 lots
    ) internal nonReentrant {
        require(
            beneficiary != address(0),
            "Crowdsale: zero beneficiary address"
        );
        require(
            paymentToken != address(0),
            "Crowdsale: zero payment token address"
        );
        require(lots > 0, "Crowdsale: zero lots");
        require(
            isPaymentToken(paymentToken),
            "Crowdsale: payment token unaccepted"
        );

        // calculate token amount to be created
        uint256 tokenAmount = _getTokenAmount(lots, beneficiary);
        // calculate wei amount to transfer to wallet
        uint256 weiAmount = _getWeiAmount(paymentToken, lots, beneficiary);

        _preValidatePurchase(beneficiary, paymentToken, weiAmount, tokenAmount);

        // update state
        _weiRaised[paymentToken] = _weiRaised[paymentToken].add(weiAmount);
        tokensSold = tokensSold.add(tokenAmount);

        _updatePurchasingState(
            beneficiary,
            paymentToken,
            weiAmount,
            tokenAmount
        );

        emit TokensPurchased(
            msg.sender,
            beneficiary,
            paymentToken,
            lots,
            weiAmount,
            tokenAmount
        );

        _processPurchase(beneficiary, tokenAmount);
        _forwardFunds(paymentToken, weiAmount);
        _postValidatePurchase(
            beneficiary,
            paymentToken,
            weiAmount,
            tokenAmount
        );
    }

    /**
     * @param paymentToken ERC20 payment token address
     * @return weiRaised_ the amount of wei raised
     */
    function _weiRaisedFor(address paymentToken)
        internal
        view
        virtual
        returns (uint256 weiRaised_)
    {
        require(
            paymentToken != address(0),
            "Crowdsale: zero payment token address"
        );
        require(
            isPaymentToken(paymentToken),
            "Crowdsale: payment token unaccepted"
        );

        weiRaised_ = _weiRaised[paymentToken];
    }

    /**
     * @param paymentToken ERC20 payment token address
     * @return rate_ how many weis one token costs for specified ERC20 payment token
     */
    function _rate(address paymentToken)
        internal
        view
        virtual
        returns (uint256 rate_)
    {
        rate_ = _rates[paymentToken];
    }

    /**
     * @return lotSize_ lot size of token being sold
     */
    function _lotSize(address)
        internal
        view
        virtual
        returns (uint256 lotSize_)
    {
        lotSize_ = _lotsInfo.lotSize;
    }

    /**
     * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met.
     * Use `super` in contracts that inherit from Crowdsale to extend their validations.
     * Example from CappedCrowdsale.sol's _preValidatePurchase method:
     *     super._preValidatePurchase(beneficiary, weiAmount);
     *     require(weiRaised().add(weiAmount) <= cap);
     * @param beneficiary Address performing the token purchase
     * @param paymentToken ERC20 payment token address
     * @param weiAmount Amount in wei of ERC20 payment token
     * @param tokenAmount Number of tokens to be purchased
     */
    function _preValidatePurchase(
        address beneficiary,
        address paymentToken,
        uint256 weiAmount,
        uint256 tokenAmount
    ) internal view virtual {
        // solhint-disable-previous-line no-empty-blocks
    }

    /**
     * @dev Validation of an executed purchase. Observe state and use revert statements to undo/rollback when valid
     * conditions are not met.
     * @param beneficiary Address performing the token purchase
     * @param paymentToken ERC20 payment token address
     * @param weiAmount Amount in wei of ERC20 payment token
     * @param tokenAmount Number of tokens to be purchased
     */
    function _postValidatePurchase(
        address beneficiary,
        address paymentToken,
        uint256 weiAmount,
        uint256 tokenAmount
    ) internal view virtual {
        // solhint-disable-previous-line no-empty-blocks
    }

    /**
     * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends
     * its tokens.
     * @param beneficiary Address performing the token purchase
     * @param tokenAmount Number of tokens to be emitted
     */
    // https://github.com/crytic/slither/wiki/Detector-Documentation#dead-code
    // slither-disable-next-line dead-code
    function _deliverTokens(address beneficiary, uint256 tokenAmount)
        internal
        virtual
    {
        IERC20(_tokenSelling).safeTransfer(beneficiary, tokenAmount);
    }

    /**
     * @dev Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send
     * tokens.
     * @param beneficiary Address receiving the tokens
     * @param tokenAmount Number of tokens to be purchased
     */
    function _processPurchase(address beneficiary, uint256 tokenAmount)
        internal
        virtual
    {
        _deliverTokens(beneficiary, tokenAmount);
    }

    /**
     * @dev Override for extensions that require an internal state to check for validity (current user contributions,
     * etc.)
     * @param beneficiary Address receiving the tokens
     * @param paymentToken ERC20 payment token address
     * @param weiAmount Amount in wei of ERC20 payment token
     * @param tokenAmount Number of tokens to be purchased
     */
    function _updatePurchasingState(
        address beneficiary,
        address paymentToken,
        uint256 weiAmount,
        uint256 tokenAmount
    ) internal virtual {
        // solhint-disable-previous-line no-empty-blocks
    }

    /**
     * @dev Override to extend the way in which payment token is converted to tokens.
     * @param lots Number of lots of token being sold
     * @return tokenAmount Number of tokens that will be purchased
     */
    function _getTokenAmount(uint256 lots, address)
        internal
        view
        virtual
        returns (uint256 tokenAmount)
    {
        tokenAmount = lots.mul(_lotsInfo.lotSize).mul(TOKEN_SELLING_SCALE);
    }

    /**
     * @dev Override to extend the way in which payment token is converted to tokens.
     * @param paymentToken ERC20 payment token address
     * @param lots Number of lots of token being sold
     * @param beneficiary Address receiving the tokens
     * @return weiAmount Amount in wei of ERC20 payment token
     */
    function _getWeiAmount(
        address paymentToken,
        uint256 lots,
        address beneficiary
    ) internal view virtual returns (uint256 weiAmount) {
        uint256 rate_ = _rate(paymentToken);
        uint256 tokenAmount = _getTokenAmount(lots, beneficiary);
        weiAmount = tokenAmount.mul(rate_).div(TOKEN_SELLING_SCALE);
    }

    /**
     * @dev Determines how ERC20 payment token is stored/forwarded on purchases.
     */
    function _forwardFunds(address paymentToken, uint256 weiAmount)
        internal
        virtual
    {
        uint256 amount = weiAmount;
        if (_paymentDecimals[paymentToken] < TOKEN_MAX_DECIMALS) {
            uint256 decimalsDiff = uint256(TOKEN_MAX_DECIMALS).sub(
                _paymentDecimals[paymentToken]
            );
            amount = weiAmount.div(10**decimalsDiff);
        }

        IERC20(paymentToken).safeTransferFrom(msg.sender, _wallet, amount);
    }
}

File 16 of 17 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        _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;
    }
}

// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Enjinstarter
pragma solidity ^0.7.6;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @title ICrowdsale
 * @author Enjinstarter
 */
interface ICrowdsale {
    struct LotsInfo {
        uint256 lotSize;
        uint256 maxLots;
    }

    struct PaymentTokenInfo {
        address paymentToken;
        uint256 paymentDecimal;
        uint256 rate;
    }

    function tokenSelling() external view returns (address tokenSelling_);

    function wallet() external view returns (address wallet_);

    function paymentTokens()
        external
        view
        returns (address[] memory paymentTokens_);

    function rate(address paymentToken) external view returns (uint256 rate_);

    function lotSize(address beneficiary)
        external
        view
        returns (uint256 lotSize_);

    function maxLots() external view returns (uint256 maxLots_);

    function weiRaisedFor(address paymentToken)
        external
        view
        returns (uint256 weiRaised_);

    function isPaymentToken(address paymentToken)
        external
        view
        returns (bool isPaymentToken_);

    function getTokenAmount(uint256 lots, address beneficiary)
        external
        view
        returns (uint256 tokenAmount);

    function getWeiAmount(
        address paymentToken,
        uint256 lots,
        address beneficiary
    ) external view returns (uint256 weiAmount);

    function buyTokens(address paymentToken, uint256 lots) external;

    function buyTokensFor(
        address beneficiary,
        address paymentToken,
        uint256 lots
    ) external;

    /**
     * Event for token purchase logging
     * @param purchaser who paid for the tokens
     * @param beneficiary who got the tokens
     * @param paymentToken address of ERC20 token used for payment
     * @param lots number of lots to purchase
     * @param weiAmount weis paid for purchase
     * @param tokenAmount amount of tokens purchased
     */
    event TokensPurchased(
        address indexed purchaser,
        address indexed beneficiary,
        address indexed paymentToken,
        uint256 lots,
        uint256 weiAmount,
        uint256 tokenAmount
    );
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"wallet_","type":"address"},{"components":[{"internalType":"uint256","name":"tokenCap","type":"uint256"},{"internalType":"address","name":"whitelistContract","type":"address"},{"internalType":"address","name":"tokenHold","type":"address"},{"internalType":"uint256","name":"minTokenHoldAmount","type":"uint256"}],"internalType":"struct FinaCrowdsale.FinaCrowdsaleInfo","name":"crowdsaleInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"lotSize","type":"uint256"},{"internalType":"uint256","name":"maxLots","type":"uint256"}],"internalType":"struct ICrowdsale.LotsInfo","name":"lotsInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"openingTime","type":"uint256"},{"internalType":"uint256","name":"closingTime","type":"uint256"}],"internalType":"struct TimedCrowdsaleHelper.Timeframe","name":"timeframe","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"paymentDecimal","type":"uint256"},{"internalType":"uint256","name":"rate","type":"uint256"}],"internalType":"struct ICrowdsale.PaymentTokenInfo[]","name":"paymentTokensInfo","type":"tuple[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"prevClosingTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newClosingTime","type":"uint256"}],"name":"TimedCrowdsaleExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"purchaser","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"paymentToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"lots","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weiAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"TokensPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEAD_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_NUM_PAYMENT_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_MAX_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_SELLING_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"lots","type":"uint256"}],"name":"buyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"lots","type":"uint256"}],"name":"buyTokensFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crowdsaleAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newClosingTime","type":"uint256"}],"name":"extendTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"getAvailableLotsFor","outputs":[{"internalType":"uint256","name":"availableLots","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"getBeneficiaryCap","outputs":[{"internalType":"uint256","name":"tokenCap","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemainingTokens","outputs":[{"internalType":"uint256","name":"remainingTokens","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lots","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"}],"name":"getTokenAmount","outputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"getTokensPurchasedBy","outputs":[{"internalType":"uint256","name":"tokensPurchased","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"lots","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"}],"name":"getWeiAmount","outputs":[{"internalType":"uint256","name":"weiAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governanceAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasClosed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"}],"name":"isPaymentToken","outputs":[{"internalType":"bool","name":"isPaymentToken_","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"lotSize","outputs":[{"internalType":"uint256","name":"lotSize_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLots","outputs":[{"internalType":"uint256","name":"maxLots_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minTokenHoldAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentTokens","outputs":[{"internalType":"address[]","name":"paymentTokens_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"}],"name":"rate","outputs":[{"internalType":"uint256","name":"rate_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"setCrowdsaleAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"setGovernanceAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenCap","outputs":[{"internalType":"uint256","name":"tokenCap_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokensSold","type":"uint256"}],"name":"tokenCapReached","outputs":[{"internalType":"bool","name":"tokenCapReached_","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenHoldContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenSelling","outputs":[{"internalType":"address","name":"tokenSelling_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wallet","outputs":[{"internalType":"address","name":"wallet_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"}],"name":"weiRaisedFor","outputs":[{"internalType":"uint256","name":"weiRaised_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"whitelisted_","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620027c3380380620027c38339810160408190526200003491620005fd565b60208401516040850151606086015186516001600055859291908961dead89886001600160a01b038416620000865760405162461bcd60e51b81526004016200007d9062000982565b60405180910390fd5b6001600160a01b038316620000af5760405162461bcd60e51b81526004016200007d90620006e7565b8151620000d05760405162461bcd60e51b81526004016200007d9062000849565b6000826020015111620000f75760405162461bcd60e51b81526004016200007d9062000880565b60008151116200011b5760405162461bcd60e51b81526004016200007d90620008b7565b600a8151106200013f5760405162461bcd60e51b81526004016200007d9062000771565b600880546001600160a01b038087166001600160a01b03199283161790925560028054928616929091169190911790558151600355602082015160045560005b8151811015620002d45760008282815181106200019857fe5b60200260200101516020015190506012811115620001ca5760405162461bcd60e51b81526004016200007d90620007b5565b6000838381518110620001d957fe5b60209081029190910101515190506001600160a01b038116620002105760405162461bcd60e51b81526004016200007d906200072c565b60008484815181106200021f57fe5b602002602001015160400151905060008111620002505760405162461bcd60e51b81526004016200007d90620008ee565b6001600160a01b039091166000818152600760209081526040808320805460ff19166001908117909155600580548083019091557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b031916861790559383526006825280832095909555600990529290922055016200017f565b5050505050600081116200032f576040805162461bcd60e51b815260206004820152601f60248201527f436170706564546f6b656e536f6c6448656c7065723a207a65726f2063617000604482015290519081900360640190fd5b600b556001600160a01b038216620003795760405162461bcd60e51b8152600401808060200182810382526036815260200180620027596036913960400191505060405180910390fd5b60008111620003ba5760405162461bcd60e51b8152600401808060200182810382526039815260200180620027206039913960400191505060405180910390fd5b600c80546001600160a01b0319166001600160a01b039390931692909217909155600d558051421115620004025760405162461bcd60e51b81526004016200007d90620007ec565b8051602082015111620004295760405162461bcd60e51b81526004016200007d9062000925565b8051600e5560200151600f556001600160a01b0381166200047c5760405162461bcd60e51b81526004018080602001828103825260348152602001806200278f6034913960400191505060405180910390fd5b601080546001600160a01b039092166001600160a01b0319928316179055601280543361010081026001600160a81b0319909216919091179091556013805490921617905550620009dd9350505050565b80516001600160a01b0381168114620004e557600080fd5b919050565b600082601f830112620004fb578081fd5b815160206001600160401b03808311156200051257fe5b620005218283850201620009b9565b838152828101908684016060808702890186018a101562000540578788fd5b875b87811015620005a55781838c0312156200055a578889fd5b6040805183810181811089821117156200057057fe5b82526200057d85620004cd565b8152848901518982015281850151918101919091528552938601939181019160010162000542565b50919998505050505050505050565b600060408284031215620005c6578081fd5b604080519081016001600160401b0381118282101715620005e357fe5b604052825181526020928301519281019290925250919050565b600080600080600085870361014081121562000617578182fd5b6200062287620004cd565b95506080601f198201121562000636578182fd5b50604051608081016001600160401b0380821183831017156200065557fe5b81604052602089015183526200066e60408a01620004cd565b60208401526200068160608a01620004cd565b604084015260808901516060840152829650620006a28a60a08b01620005b4565b9550620006b38a60e08b01620005b4565b9450610120890151925080831115620006ca578384fd5b5050620006da88828901620004ea565b9150509295509295909350565b60208082526025908201527f43726f776473616c653a207a65726f20746f6b656e2073656c6c696e67206164604082015264647265737360d81b606082015260800190565b60208082526025908201527f43726f776473616c653a207a65726f207061796d656e7420746f6b656e206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f43726f776473616c653a20657863656564206d6178207061796d656e7420746f6040820152636b656e7360e01b606082015260800190565b6020808252601d908201527f43726f776473616c653a20646563696d616c7320657863656564203138000000604082015260600190565b60208082526039908201527f54696d656443726f776473616c6548656c7065723a206f70656e696e6720746960408201527f6d65206973206265666f72652063757272656e742074696d6500000000000000606082015260800190565b60208082526018908201527f43726f776473616c653a207a65726f206c6f742073697a650000000000000000604082015260600190565b60208082526018908201527f43726f776473616c653a207a65726f206d6178206c6f74730000000000000000604082015260600190565b6020808252601e908201527f43726f776473616c653a207a65726f207061796d656e7420746f6b656e730000604082015260600190565b60208082526014908201527f43726f776473616c653a207a65726f2072617465000000000000000000000000604082015260600190565b60208082526039908201527f54696d656443726f776473616c6548656c7065723a20636c6f73696e6720746960408201527f6d65206973206265666f7265206f70656e696e672074696d6500000000000000606082015260800190565b6020808252601e908201527f43726f776473616c653a207a65726f2077616c6c657420616464726573730000604082015260600190565b6040518181016001600160401b0381118282101715620009d557fe5b604052919050565b611d3380620009ed6000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80635c975abb1161013b578063b7a8807c116100b8578063dbbd079b1161007c578063dbbd079b14610415578063dd54291b14610428578063f5b65fea14610430578063fe785ba814610443578063ff7e2e6a146104565761023d565b8063b7a8807c146103e2578063b8f6a04a146103ea578063be98ee87146103f2578063c86b42e4146103fa578063d936547e146104025761023d565b80638a5c59fa116100ff5780638a5c59fa146103a4578063930eaddc146103ac578063a27aebbc146103bf578063af35ae27146103d2578063b316bc8d146103da5761023d565b80635c975abb146103715780636251534114610379578063796f2bf01461038c5780638456cb591461039457806384900b041461039c5761023d565b806335914f19116101c95780634b6753bc1161018d5780634b6753bc146103495780634e6fd6c41461035157806350abc06514610359578063518ab2a814610361578063521eb273146103695761023d565b806335914f191461030b5780633f4ba83a1461031e578063423653c114610326578063470176c91461033957806347535d7b146103415761023d565b80631f39a141116102105780631f39a141146102a857806325ef180d146102bb57806327144c05146102d05780632a7cee06146102e557806333ff778e146102f85761023d565b8063073e2bf5146102425780630752881a146102575780630ba9d8ca1461026a5780631515bc2b14610293575b600080fd5b6102556102503660046117a7565b610469565b005b6102556102653660046117fc565b6104eb565b61027d6102783660046117a7565b6104fa565b60405161028a9190611b94565b60405180910390f35b61029b610556565b60405161028a9190611904565b61027d6102b6366004611878565b61055e565b6102c36105b6565b60405161028a91906118b7565b6102d8610618565b60405161028a91906118a3565b61027d6102f33660046117a7565b61062c565b61027d6103063660046117a7565b610637565b61027d610319366004611825565b61066e565b610255610714565b61027d6103343660046117a7565b61074a565b61027d6107ad565b61029b6107b9565b61027d6107d5565b6102d86107db565b61027d6107e1565b61027d6107e6565b6102d86107ec565b61029b6107fb565b61027d6103873660046117a7565b610804565b6102d8610835565b610255610844565b6102d8610877565b61027d610886565b61029b6103ba3660046117a7565b61088c565b6102556103cd366004611860565b6108d3565b61027d610907565b61027d61091d565b61027d610923565b61027d610929565b6102d861092e565b6102d861093d565b61029b6104103660046117a7565b61094c565b61027d6104233660046117a7565b610a12565b61027d610aa6565b61025561043e3660046117a7565b610aac565b61029b610451366004611860565b610b2b565b6102556104643660046117c1565b610b33565b60125461010090046001600160a01b03163381146104a25760405162461bcd60e51b815260040161049990611a5d565b60405180910390fd5b6001600160a01b0382166104c85760405162461bcd60e51b815260040161049990611b5d565b50601380546001600160a01b0319166001600160a01b0392909216919091179055565b6104f6338383610b43565b5050565b60006001600160a01b0382166105225760405162461bcd60e51b815260040161049990611952565b61052b8261088c565b6105475760405162461bcd60e51b815260040161049990611b1a565b61055082610d37565b92915050565b600f54421190565b600080831161057f5760405162461bcd60e51b815260040161049990611997565b6001600160a01b0382166105a55760405162461bcd60e51b81526004016104999061190f565b6105af8383610d52565b9392505050565b6060600580548060200260200160405190810160405280929190818152602001828054801561060e57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116105f0575b5050505050905090565b60125461010090046001600160a01b031681565b600061055082610d67565b60006106428261094c565b61064e57506000610669565b61055061065a83610a12565b61066384610dd0565b90610de7565b919050565b60006001600160a01b0384166106965760405162461bcd60e51b815260040161049990611952565b600083116106b65760405162461bcd60e51b815260040161049990611997565b6001600160a01b0382166106dc5760405162461bcd60e51b81526004016104999061190f565b6106e58461088c565b6107015760405162461bcd60e51b815260040161049990611b1a565b61070c848484610e4e565b949350505050565b6013546001600160a01b031633811461073f5760405162461bcd60e51b815260040161049990611a5d565b610747610e8a565b50565b60006001600160a01b0382166107915760405162461bcd60e51b8152600401808060200182810382526036815260200180611bc26036913960400191505060405180910390fd5b506001600160a01b031660009081526011602052604090205490565b670de0b6b3a764000081565b600e5460009042108015906107d05750600f544211155b905090565b600f5490565b61dead81565b600a81565b60015481565b6008546001600160a01b031690565b60125460ff1690565b60006001600160a01b03821661082c5760405162461bcd60e51b81526004016104999061190f565b61055082610f2a565b600c546001600160a01b031681565b6013546001600160a01b031633811461086f5760405162461bcd60e51b815260040161049990611a5d565b610747610f35565b6010546001600160a01b031681565b60045490565b60006001600160a01b0382166108b45760405162461bcd60e51b815260040161049990611952565b506001600160a01b031660009081526007602052604090205460ff1690565b6013546001600160a01b03163381146108fe5760405162461bcd60e51b815260040161049990611a5d565b6104f682610fb8565b60006107d0600154610917610aa6565b90611042565b600d5481565b600e5490565b601281565b6002546001600160a01b031690565b6013546001600160a01b031681565b60006001600160a01b0382166109935760405162461bcd60e51b815260040180806020018281038252602a815260200180611c1b602a913960400191505060405180910390fd5b60105460408051633af32abf60e01b81526001600160a01b03858116600483015291519190921691633af32abf916024808301926020929190829003018186803b1580156109e057600080fd5b505afa1580156109f4573d6000803e3d6000fd5b505050506040513d6020811015610a0a57600080fd5b505192915050565b60006001600160a01b038216610a595760405162461bcd60e51b8152600401808060200182810382526036815260200180611bc26036913960400191505060405180910390fd5b60105460408051637134267d60e01b81526001600160a01b03858116600483015291519190921691637134267d916024808301926020929190829003018186803b1580156109e057600080fd5b600b5490565b60125461010090046001600160a01b0316338114610adc5760405162461bcd60e51b815260040161049990611a5d565b6001600160a01b038216610b025760405162461bcd60e51b815260040161049990611b5d565b50601280546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600b54111590565b610b3e838383610b43565b505050565b60026000541415610b9b576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556001600160a01b038316610bc65760405162461bcd60e51b81526004016104999061190f565b6001600160a01b038216610bec5760405162461bcd60e51b815260040161049990611952565b60008111610c0c5760405162461bcd60e51b815260040161049990611997565b610c158261088c565b610c315760405162461bcd60e51b815260040161049990611b1a565b6000610c3d8285610d52565b90506000610c4c848487610e4e565b9050610c5a8585838561109f565b6001600160a01b0384166000908152600a6020526040902054610c7d9082611323565b6001600160a01b0385166000908152600a6020526040902055600154610ca39083611323565b600155610cb28585838561137d565b836001600160a01b0316856001600160a01b0316336001600160a01b03167f4f97b0cf52b679eff0ff9e83770d0104d7a7c1c9a1554136d9f99d0778e0ad78868587604051610d0393929190611bab565b60405180910390a4610d158583611399565b610d1f84826113a3565b610d2b85858385611393565b50506001600055505050565b6001600160a01b031660009081526009602052604090205490565b60006105af610d6083610f2a565b849061141b565b60006001600160a01b038216610d8f5760405162461bcd60e51b815260040161049990611952565b610d988261088c565b610db45760405162461bcd60e51b815260040161049990611b1a565b506001600160a01b03166000908152600a602052604090205490565b6000610550610dde8361074a565b61091784610a12565b6000808211610e3d576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610e4657fe5b049392505050565b600080610e5a85610d37565b90506000610e688585610d52565b9050610e80670de0b6b3a7640000610663838561141b565b9695505050505050565b610e926107fb565b610eda576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6012805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610f0d611474565b604080516001600160a01b039092168252519081900360200190a1565b600061055082610a12565b610f3d6107fb565b15610f82576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6012805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f0d611474565b610fc0610556565b15610fdd5760405162461bcd60e51b815260040161049990611a9f565b600f54808211610fff5760405162461bcd60e51b815260040161049990611a0c565b600f8290556040517f46711e222f558a07afd26e5e71b48ecb0a8b2cdcd40faeb1323e05e2c76a2f32906110369083908590611b9d565b60405180910390a15050565b600082821115611099576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6110a76107fb565b156110ec576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6110f46107b9565b6111105760405162461bcd60e51b815260040161049990611ae3565b600154600b5482906111228383611323565b111561115f5760405162461bcd60e51b8152600401808060200182810382526023815260200180611bf86023913960400191505060405180910390fd5b600d54600c54604080516370a0823160e01b81526001600160a01b03808b16600483015291518a949392909216916370a0823191602480820192602092909190829003018186803b1580156111b357600080fd5b505afa1580156111c7573d6000803e3d6000fd5b505050506040513d60208110156111dd57600080fd5b5051101561121c5760405162461bcd60e51b8152600401808060200182810382526039815260200180611c666039913960400191505060405180910390fd5b60105460408051633af32abf60e01b81526001600160a01b03808b16600483015291518a939290921691633af32abf91602480820192602092909190829003018186803b15801561126c57600080fd5b505afa158015611280573d6000803e3d6000fd5b505050506040513d602081101561129657600080fd5b50516112d35760405162461bcd60e51b8152600401808060200182810382526035815260200180611c9f6035913960400191505060405180910390fd5b6112dc88610a12565b6112ef866112e98b61074a565b90611323565b111561130d5760405162461bcd60e51b8152600401610499906119c5565b61131988888888611393565b5050505050505050565b6000828201838110156105af576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b61138984848484611393565b6113938482611478565b50505050565b6104f682826104f6565b6001600160a01b0382166000908152600660205260409020548190601211156113ff576001600160a01b0383166000908152600660205260408120546113eb90601290611042565b90506113fb83600a83900a610de7565b9150505b600854610b3e906001600160a01b0385811691339116846114bb565b60008261142a57506000610550565b8282028284828161143757fe5b04146105af5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c456021913960400191505060405180910390fd5b3390565b6001600160a01b03821660009081526011602052604090205461149b9082611323565b6001600160a01b0390921660009081526011602052604090209190915550565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526113939085906000611565826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115c19092919063ffffffff16565b805190915015610b3e5780806020019051602081101561158457600080fd5b5051610b3e5760405162461bcd60e51b815260040180806020018281038252602a815260200180611cd4602a913960400191505060405180910390fd5b606061070c8484600085856115d5856116e6565b611626576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106116645780518252601f199092019160209182019101611645565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146116c6576040519150601f19603f3d011682016040523d82523d6000602084013e6116cb565b606091505b50915091506116db8282866116ec565b979650505050505050565b3b151590565b606083156116fb5750816105af565b82511561170b5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561175557818101518382015260200161173d565b50505050905090810190601f1680156117825780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b80356001600160a01b038116811461066957600080fd5b6000602082840312156117b8578081fd5b6105af82611790565b6000806000606084860312156117d5578182fd5b6117de84611790565b92506117ec60208501611790565b9150604084013590509250925092565b6000806040838503121561180e578182fd5b61181783611790565b946020939093013593505050565b600080600060608486031215611839578283fd5b61184284611790565b92506020840135915061185760408501611790565b90509250925092565b600060208284031215611871578081fd5b5035919050565b6000806040838503121561188a578182fd5b8235915061189a60208401611790565b90509250929050565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156118f85783516001600160a01b0316835292840192918401916001016118d3565b50909695505050505050565b901515815260200190565b60208082526023908201527f43726f776473616c653a207a65726f2062656e6566696369617279206164647260408201526265737360e81b606082015260800190565b60208082526025908201527f43726f776473616c653a207a65726f207061796d656e7420746f6b656e206164604082015264647265737360d81b606082015260800190565b60208082526014908201527343726f776473616c653a207a65726f206c6f747360601b604082015260600190565b60208082526027908201527f46696e6143726f776473616c653a2062656e65666963696172792063617020656040820152661e18d95959195960ca1b606082015260800190565b60208082526031908201527f54696d656443726f776473616c6548656c7065723a206265666f72652063757260408201527072656e7420636c6f73696e672074696d6560781b606082015260800190565b60208082526022908201527f46696e6143726f776473616c653a2073656e64657220756e617574686f72697a604082015261195960f21b606082015260800190565b60208082526024908201527f54696d656443726f776473616c6548656c7065723a20616c726561647920636c6040820152631bdcd95960e21b606082015260800190565b6020808252601e908201527f54696d656443726f776473616c6548656c7065723a206e6f74206f70656e0000604082015260600190565b60208082526023908201527f43726f776473616c653a207061796d656e7420746f6b656e20756e61636365706040820152621d195960ea1b606082015260800190565b6020808252601b908201527f46696e6143726f776473616c653a207a65726f206163636f756e740000000000604082015260600190565b90815260200190565b918252602082015260400190565b928352602083019190915260408201526060019056fe46696e6157686974656c69737443726f776473616c6548656c7065723a207a65726f2062656e65666963696172792061646472657373436170706564546f6b656e536f6c6448656c7065723a2063617020657863656564656446696e6157686974656c69737443726f776473616c6548656c7065723a207a65726f206163636f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77486f6c644572633230546f6b656e43726f776473616c6548656c7065723a206163636f756e7420686f6c64206c657373207468616e206d696e46696e6157686974656c69737443726f776473616c6548656c7065723a206163636f756e74206e6f742077686974656c69737465645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212200bf4970c0faaf9ec1f18a6b36f238f198d0ad10ac1be0cc09c88b69807ffc20f64736f6c63430007060033486f6c644572633230546f6b656e43726f776473616c6548656c7065723a207a65726f206d696e20746f6b656e20686f6c6420616d6f756e74486f6c644572633230546f6b656e43726f776473616c6548656c7065723a207a65726f20746f6b656e20686f6c64206164647265737346696e6157686974656c69737443726f776473616c6548656c7065723a207a65726f2077686974656c6973742061646472657373000000000000000000000000b9bbb220d5eb660bbb634805dff8cbdacb732cb4000000000000000000000000000000000000000000002022624cc20ab7580000000000000000000000000000b62be470532481c3feeca55508aa099e2a9b392800000000000000000000000096610186f3ab8d73ebee1cf950c750f3b1fb79c20000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000006163ef00000000000000000000000000000000000000000000000000000000006163fd1000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000058d15e176280000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000058d15e176280000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061023d5760003560e01c80635c975abb1161013b578063b7a8807c116100b8578063dbbd079b1161007c578063dbbd079b14610415578063dd54291b14610428578063f5b65fea14610430578063fe785ba814610443578063ff7e2e6a146104565761023d565b8063b7a8807c146103e2578063b8f6a04a146103ea578063be98ee87146103f2578063c86b42e4146103fa578063d936547e146104025761023d565b80638a5c59fa116100ff5780638a5c59fa146103a4578063930eaddc146103ac578063a27aebbc146103bf578063af35ae27146103d2578063b316bc8d146103da5761023d565b80635c975abb146103715780636251534114610379578063796f2bf01461038c5780638456cb591461039457806384900b041461039c5761023d565b806335914f19116101c95780634b6753bc1161018d5780634b6753bc146103495780634e6fd6c41461035157806350abc06514610359578063518ab2a814610361578063521eb273146103695761023d565b806335914f191461030b5780633f4ba83a1461031e578063423653c114610326578063470176c91461033957806347535d7b146103415761023d565b80631f39a141116102105780631f39a141146102a857806325ef180d146102bb57806327144c05146102d05780632a7cee06146102e557806333ff778e146102f85761023d565b8063073e2bf5146102425780630752881a146102575780630ba9d8ca1461026a5780631515bc2b14610293575b600080fd5b6102556102503660046117a7565b610469565b005b6102556102653660046117fc565b6104eb565b61027d6102783660046117a7565b6104fa565b60405161028a9190611b94565b60405180910390f35b61029b610556565b60405161028a9190611904565b61027d6102b6366004611878565b61055e565b6102c36105b6565b60405161028a91906118b7565b6102d8610618565b60405161028a91906118a3565b61027d6102f33660046117a7565b61062c565b61027d6103063660046117a7565b610637565b61027d610319366004611825565b61066e565b610255610714565b61027d6103343660046117a7565b61074a565b61027d6107ad565b61029b6107b9565b61027d6107d5565b6102d86107db565b61027d6107e1565b61027d6107e6565b6102d86107ec565b61029b6107fb565b61027d6103873660046117a7565b610804565b6102d8610835565b610255610844565b6102d8610877565b61027d610886565b61029b6103ba3660046117a7565b61088c565b6102556103cd366004611860565b6108d3565b61027d610907565b61027d61091d565b61027d610923565b61027d610929565b6102d861092e565b6102d861093d565b61029b6104103660046117a7565b61094c565b61027d6104233660046117a7565b610a12565b61027d610aa6565b61025561043e3660046117a7565b610aac565b61029b610451366004611860565b610b2b565b6102556104643660046117c1565b610b33565b60125461010090046001600160a01b03163381146104a25760405162461bcd60e51b815260040161049990611a5d565b60405180910390fd5b6001600160a01b0382166104c85760405162461bcd60e51b815260040161049990611b5d565b50601380546001600160a01b0319166001600160a01b0392909216919091179055565b6104f6338383610b43565b5050565b60006001600160a01b0382166105225760405162461bcd60e51b815260040161049990611952565b61052b8261088c565b6105475760405162461bcd60e51b815260040161049990611b1a565b61055082610d37565b92915050565b600f54421190565b600080831161057f5760405162461bcd60e51b815260040161049990611997565b6001600160a01b0382166105a55760405162461bcd60e51b81526004016104999061190f565b6105af8383610d52565b9392505050565b6060600580548060200260200160405190810160405280929190818152602001828054801561060e57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116105f0575b5050505050905090565b60125461010090046001600160a01b031681565b600061055082610d67565b60006106428261094c565b61064e57506000610669565b61055061065a83610a12565b61066384610dd0565b90610de7565b919050565b60006001600160a01b0384166106965760405162461bcd60e51b815260040161049990611952565b600083116106b65760405162461bcd60e51b815260040161049990611997565b6001600160a01b0382166106dc5760405162461bcd60e51b81526004016104999061190f565b6106e58461088c565b6107015760405162461bcd60e51b815260040161049990611b1a565b61070c848484610e4e565b949350505050565b6013546001600160a01b031633811461073f5760405162461bcd60e51b815260040161049990611a5d565b610747610e8a565b50565b60006001600160a01b0382166107915760405162461bcd60e51b8152600401808060200182810382526036815260200180611bc26036913960400191505060405180910390fd5b506001600160a01b031660009081526011602052604090205490565b670de0b6b3a764000081565b600e5460009042108015906107d05750600f544211155b905090565b600f5490565b61dead81565b600a81565b60015481565b6008546001600160a01b031690565b60125460ff1690565b60006001600160a01b03821661082c5760405162461bcd60e51b81526004016104999061190f565b61055082610f2a565b600c546001600160a01b031681565b6013546001600160a01b031633811461086f5760405162461bcd60e51b815260040161049990611a5d565b610747610f35565b6010546001600160a01b031681565b60045490565b60006001600160a01b0382166108b45760405162461bcd60e51b815260040161049990611952565b506001600160a01b031660009081526007602052604090205460ff1690565b6013546001600160a01b03163381146108fe5760405162461bcd60e51b815260040161049990611a5d565b6104f682610fb8565b60006107d0600154610917610aa6565b90611042565b600d5481565b600e5490565b601281565b6002546001600160a01b031690565b6013546001600160a01b031681565b60006001600160a01b0382166109935760405162461bcd60e51b815260040180806020018281038252602a815260200180611c1b602a913960400191505060405180910390fd5b60105460408051633af32abf60e01b81526001600160a01b03858116600483015291519190921691633af32abf916024808301926020929190829003018186803b1580156109e057600080fd5b505afa1580156109f4573d6000803e3d6000fd5b505050506040513d6020811015610a0a57600080fd5b505192915050565b60006001600160a01b038216610a595760405162461bcd60e51b8152600401808060200182810382526036815260200180611bc26036913960400191505060405180910390fd5b60105460408051637134267d60e01b81526001600160a01b03858116600483015291519190921691637134267d916024808301926020929190829003018186803b1580156109e057600080fd5b600b5490565b60125461010090046001600160a01b0316338114610adc5760405162461bcd60e51b815260040161049990611a5d565b6001600160a01b038216610b025760405162461bcd60e51b815260040161049990611b5d565b50601280546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600b54111590565b610b3e838383610b43565b505050565b60026000541415610b9b576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000556001600160a01b038316610bc65760405162461bcd60e51b81526004016104999061190f565b6001600160a01b038216610bec5760405162461bcd60e51b815260040161049990611952565b60008111610c0c5760405162461bcd60e51b815260040161049990611997565b610c158261088c565b610c315760405162461bcd60e51b815260040161049990611b1a565b6000610c3d8285610d52565b90506000610c4c848487610e4e565b9050610c5a8585838561109f565b6001600160a01b0384166000908152600a6020526040902054610c7d9082611323565b6001600160a01b0385166000908152600a6020526040902055600154610ca39083611323565b600155610cb28585838561137d565b836001600160a01b0316856001600160a01b0316336001600160a01b03167f4f97b0cf52b679eff0ff9e83770d0104d7a7c1c9a1554136d9f99d0778e0ad78868587604051610d0393929190611bab565b60405180910390a4610d158583611399565b610d1f84826113a3565b610d2b85858385611393565b50506001600055505050565b6001600160a01b031660009081526009602052604090205490565b60006105af610d6083610f2a565b849061141b565b60006001600160a01b038216610d8f5760405162461bcd60e51b815260040161049990611952565b610d988261088c565b610db45760405162461bcd60e51b815260040161049990611b1a565b506001600160a01b03166000908152600a602052604090205490565b6000610550610dde8361074a565b61091784610a12565b6000808211610e3d576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610e4657fe5b049392505050565b600080610e5a85610d37565b90506000610e688585610d52565b9050610e80670de0b6b3a7640000610663838561141b565b9695505050505050565b610e926107fb565b610eda576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6012805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610f0d611474565b604080516001600160a01b039092168252519081900360200190a1565b600061055082610a12565b610f3d6107fb565b15610f82576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6012805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f0d611474565b610fc0610556565b15610fdd5760405162461bcd60e51b815260040161049990611a9f565b600f54808211610fff5760405162461bcd60e51b815260040161049990611a0c565b600f8290556040517f46711e222f558a07afd26e5e71b48ecb0a8b2cdcd40faeb1323e05e2c76a2f32906110369083908590611b9d565b60405180910390a15050565b600082821115611099576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6110a76107fb565b156110ec576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6110f46107b9565b6111105760405162461bcd60e51b815260040161049990611ae3565b600154600b5482906111228383611323565b111561115f5760405162461bcd60e51b8152600401808060200182810382526023815260200180611bf86023913960400191505060405180910390fd5b600d54600c54604080516370a0823160e01b81526001600160a01b03808b16600483015291518a949392909216916370a0823191602480820192602092909190829003018186803b1580156111b357600080fd5b505afa1580156111c7573d6000803e3d6000fd5b505050506040513d60208110156111dd57600080fd5b5051101561121c5760405162461bcd60e51b8152600401808060200182810382526039815260200180611c666039913960400191505060405180910390fd5b60105460408051633af32abf60e01b81526001600160a01b03808b16600483015291518a939290921691633af32abf91602480820192602092909190829003018186803b15801561126c57600080fd5b505afa158015611280573d6000803e3d6000fd5b505050506040513d602081101561129657600080fd5b50516112d35760405162461bcd60e51b8152600401808060200182810382526035815260200180611c9f6035913960400191505060405180910390fd5b6112dc88610a12565b6112ef866112e98b61074a565b90611323565b111561130d5760405162461bcd60e51b8152600401610499906119c5565b61131988888888611393565b5050505050505050565b6000828201838110156105af576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b61138984848484611393565b6113938482611478565b50505050565b6104f682826104f6565b6001600160a01b0382166000908152600660205260409020548190601211156113ff576001600160a01b0383166000908152600660205260408120546113eb90601290611042565b90506113fb83600a83900a610de7565b9150505b600854610b3e906001600160a01b0385811691339116846114bb565b60008261142a57506000610550565b8282028284828161143757fe5b04146105af5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c456021913960400191505060405180910390fd5b3390565b6001600160a01b03821660009081526011602052604090205461149b9082611323565b6001600160a01b0390921660009081526011602052604090209190915550565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526113939085906000611565826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115c19092919063ffffffff16565b805190915015610b3e5780806020019051602081101561158457600080fd5b5051610b3e5760405162461bcd60e51b815260040180806020018281038252602a815260200180611cd4602a913960400191505060405180910390fd5b606061070c8484600085856115d5856116e6565b611626576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106116645780518252601f199092019160209182019101611645565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146116c6576040519150601f19603f3d011682016040523d82523d6000602084013e6116cb565b606091505b50915091506116db8282866116ec565b979650505050505050565b3b151590565b606083156116fb5750816105af565b82511561170b5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561175557818101518382015260200161173d565b50505050905090810190601f1680156117825780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b80356001600160a01b038116811461066957600080fd5b6000602082840312156117b8578081fd5b6105af82611790565b6000806000606084860312156117d5578182fd5b6117de84611790565b92506117ec60208501611790565b9150604084013590509250925092565b6000806040838503121561180e578182fd5b61181783611790565b946020939093013593505050565b600080600060608486031215611839578283fd5b61184284611790565b92506020840135915061185760408501611790565b90509250925092565b600060208284031215611871578081fd5b5035919050565b6000806040838503121561188a578182fd5b8235915061189a60208401611790565b90509250929050565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156118f85783516001600160a01b0316835292840192918401916001016118d3565b50909695505050505050565b901515815260200190565b60208082526023908201527f43726f776473616c653a207a65726f2062656e6566696369617279206164647260408201526265737360e81b606082015260800190565b60208082526025908201527f43726f776473616c653a207a65726f207061796d656e7420746f6b656e206164604082015264647265737360d81b606082015260800190565b60208082526014908201527343726f776473616c653a207a65726f206c6f747360601b604082015260600190565b60208082526027908201527f46696e6143726f776473616c653a2062656e65666963696172792063617020656040820152661e18d95959195960ca1b606082015260800190565b60208082526031908201527f54696d656443726f776473616c6548656c7065723a206265666f72652063757260408201527072656e7420636c6f73696e672074696d6560781b606082015260800190565b60208082526022908201527f46696e6143726f776473616c653a2073656e64657220756e617574686f72697a604082015261195960f21b606082015260800190565b60208082526024908201527f54696d656443726f776473616c6548656c7065723a20616c726561647920636c6040820152631bdcd95960e21b606082015260800190565b6020808252601e908201527f54696d656443726f776473616c6548656c7065723a206e6f74206f70656e0000604082015260600190565b60208082526023908201527f43726f776473616c653a207061796d656e7420746f6b656e20756e61636365706040820152621d195960ea1b606082015260800190565b6020808252601b908201527f46696e6143726f776473616c653a207a65726f206163636f756e740000000000604082015260600190565b90815260200190565b918252602082015260400190565b928352602083019190915260408201526060019056fe46696e6157686974656c69737443726f776473616c6548656c7065723a207a65726f2062656e65666963696172792061646472657373436170706564546f6b656e536f6c6448656c7065723a2063617020657863656564656446696e6157686974656c69737443726f776473616c6548656c7065723a207a65726f206163636f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77486f6c644572633230546f6b656e43726f776473616c6548656c7065723a206163636f756e7420686f6c64206c657373207468616e206d696e46696e6157686974656c69737443726f776473616c6548656c7065723a206163636f756e74206e6f742077686974656c69737465645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212200bf4970c0faaf9ec1f18a6b36f238f198d0ad10ac1be0cc09c88b69807ffc20f64736f6c63430007060033

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

000000000000000000000000b9bbb220d5eb660bbb634805dff8cbdacb732cb4000000000000000000000000000000000000000000002022624cc20ab7580000000000000000000000000000b62be470532481c3feeca55508aa099e2a9b392800000000000000000000000096610186f3ab8d73ebee1cf950c750f3b1fb79c20000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000006163ef00000000000000000000000000000000000000000000000000000000006163fd1000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000058d15e176280000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000058d15e176280000

-----Decoded View---------------
Arg [0] : wallet_ (address): 0xB9BbB220D5eB660BBB634805dfF8cBDacb732cB4
Arg [1] : crowdsaleInfo (tuple):
Arg [1] : tokenCap (uint256): 151750000000000000000000
Arg [2] : whitelistContract (address): 0xb62Be470532481C3FeEcA55508aa099e2a9b3928
Arg [3] : tokenHold (address): 0x96610186F3ab8d73EBEe1CF950C750f3B1Fb79C2
Arg [4] : minTokenHoldAmount (uint256): 1000000000000000000

Arg [2] : lotsInfo (tuple):
Arg [1] : lotSize (uint256): 1
Arg [2] : maxLots (uint256): 1

Arg [3] : timeframe (tuple):
Arg [1] : openingTime (uint256): 1633939200
Arg [2] : closingTime (uint256): 1633942800

Arg [4] : paymentTokensInfo (tuple[]):
Arg [1] : paymentToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : paymentDecimal (uint256): 6
Arg [3] : rate (uint256): 400000000000000000

Arg [1] : paymentToken (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7
Arg [2] : paymentDecimal (uint256): 6
Arg [3] : rate (uint256): 400000000000000000


-----Encoded View---------------
17 Constructor Arguments found :
Arg [0] : 000000000000000000000000b9bbb220d5eb660bbb634805dff8cbdacb732cb4
Arg [1] : 000000000000000000000000000000000000000000002022624cc20ab7580000
Arg [2] : 000000000000000000000000b62be470532481c3feeca55508aa099e2a9b3928
Arg [3] : 00000000000000000000000096610186f3ab8d73ebee1cf950c750f3b1fb79c2
Arg [4] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [7] : 000000000000000000000000000000000000000000000000000000006163ef00
Arg [8] : 000000000000000000000000000000000000000000000000000000006163fd10
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [11] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [13] : 000000000000000000000000000000000000000000000000058d15e176280000
Arg [14] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [16] : 000000000000000000000000000000000000000000000000058d15e176280000


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

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