Contract 0x4c858df3bebba1cdb73f49b002f095bb15df4542

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x223a2d18e0464dcab59b507d866dd766cf0529b7855f8c10e2bec36d29483632Deploy Sale95154622022-01-13 13:16:254 days 11 hrs ago0xd0cae2309f322e24fbbc7e9d5f4995b02ef901e4 IN  0x4c858df3bebba1cdb73f49b002f095bb15df45420 AVAX0.1891873550
0xd57978871b5a785e570c275e09ab02768e35d02c899ce12590e07fbad5f3980fDeploy Sale90280982022-01-02 6:33:3815 days 18 hrs ago0xd0cae2309f322e24fbbc7e9d5f4995b02ef901e4 IN  0x4c858df3bebba1cdb73f49b002f095bb15df45420 AVAX0.1891873550
0x831c89e1d7e829a53e80e8b4815c7d2c20dba223117e83da1e42c4da017947f8Deploy Sale83074782021-12-16 9:26:1132 days 15 hrs ago0xd0cae2309f322e24fbbc7e9d5f4995b02ef901e4 IN  0x4c858df3bebba1cdb73f49b002f095bb15df45420 AVAX1.32431145350
0x9853c27d10765e734bfaf04bd2f1afe901359c3531edf86d48da32a6c8c03cccDeploy Sale80095222021-12-09 11:17:0039 days 13 hrs ago0xd0cae2309f322e24fbbc7e9d5f4995b02ef901e4 IN  0x4c858df3bebba1cdb73f49b002f095bb15df45420 AVAX1.32431145350
0x0e38e4e9989de4a4b144c848460e36a7a19a3a3603337b417a27364c4acaa700Deploy Sale76412412021-11-30 22:14:3648 days 2 hrs ago0xd0cae2309f322e24fbbc7e9d5f4995b02ef901e4 IN  0x4c858df3bebba1cdb73f49b002f095bb15df45420 AVAX1.32431145350
0xb41cc50a58a2440160f0dfb629d59b9f346da6e676c4c63d8c74c2280f4d54caDeploy Sale76412242021-11-30 22:13:5948 days 2 hrs ago0xd0cae2309f322e24fbbc7e9d5f4995b02ef901e4 IN  0x4c858df3bebba1cdb73f49b002f095bb15df45420 AVAX1.32431145350
0x3d7ba4b6ace65e7b746f32f547c85aa90ccfe321b34780f3bfcddfc28938d7eaDeploy Sale70655642021-11-17 12:55:1161 days 11 hrs ago0xd0cae2309f322e24fbbc7e9d5f4995b02ef901e4 IN  0x4c858df3bebba1cdb73f49b002f095bb15df45420 AVAX0.855190575225
0xcab560846d28e094410e49b235d2d4c7892f189e86a7f4a09d4eaee0fab63a300x6080604070653962021-11-17 12:49:3361 days 12 hrs ago0xd0cae2309f322e24fbbc7e9d5f4995b02ef901e4 IN  Create: SalesFactory0 AVAX0.9920538225
[ Download CSV Export 
Latest 7 internal transactions
Parent Txn Hash Block From To Value
0x223a2d18e0464dcab59b507d866dd766cf0529b7855f8c10e2bec36d2948363295154622022-01-13 13:16:254 days 11 hrs ago 0x4c858df3bebba1cdb73f49b002f095bb15df4542  Contract Creation0 AVAX
0xd57978871b5a785e570c275e09ab02768e35d02c899ce12590e07fbad5f3980f90280982022-01-02 6:33:3815 days 18 hrs ago 0x4c858df3bebba1cdb73f49b002f095bb15df4542  Contract Creation0 AVAX
0x831c89e1d7e829a53e80e8b4815c7d2c20dba223117e83da1e42c4da017947f883074782021-12-16 9:26:1132 days 15 hrs ago 0x4c858df3bebba1cdb73f49b002f095bb15df4542  Contract Creation0 AVAX
0x9853c27d10765e734bfaf04bd2f1afe901359c3531edf86d48da32a6c8c03ccc80095222021-12-09 11:17:0039 days 13 hrs ago 0x4c858df3bebba1cdb73f49b002f095bb15df4542  Contract Creation0 AVAX
0x0e38e4e9989de4a4b144c848460e36a7a19a3a3603337b417a27364c4acaa70076412412021-11-30 22:14:3648 days 2 hrs ago 0x4c858df3bebba1cdb73f49b002f095bb15df4542  Contract Creation0 AVAX
0xb41cc50a58a2440160f0dfb629d59b9f346da6e676c4c63d8c74c2280f4d54ca76412242021-11-30 22:13:5948 days 2 hrs ago 0x4c858df3bebba1cdb73f49b002f095bb15df4542  Contract Creation0 AVAX
0x3d7ba4b6ace65e7b746f32f547c85aa90ccfe321b34780f3bfcddfc28938d7ea70655642021-11-17 12:55:1161 days 11 hrs ago 0x4c858df3bebba1cdb73f49b002f095bb15df4542  Contract Creation0 AVAX
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SalesFactory

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at snowtrace.io on 2021-11-17
*/

// Sources flattened with hardhat v2.5.0 https://hardhat.org

// File contracts/interfaces/IAdmin.sol

pragma solidity 0.6.12;

interface IAdmin {
    function isAdmin(address user) external view returns (bool);
}


// File @openzeppelin/contracts/token/ERC20/[email protected]


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);
}


// File @openzeppelin/contracts/cryptography/[email protected]


pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Check the signature length
        if (signature.length != 65) {
            revert("ECDSA: invalid signature length");
        }

        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        return recover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * replicates the behavior of the
     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
     * JSON-RPC method.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }
}


// File @openzeppelin/contracts/math/[email protected]


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;
    }
}


// File @openzeppelin/contracts/utils/[email protected]


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);
            }
        }
    }
}


// File @openzeppelin/contracts/token/ERC20/[email protected]


pragma solidity >=0.6.0 <0.8.0;



/**
 * @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");
        }
    }
}


// File contracts/interfaces/ISalesFactory.sol

pragma solidity 0.6.12;

interface ISalesFactory {
    function setSaleOwnerAndToken(address saleOwner, address saleToken) external;
    function isSaleCreatedThroughFactory(address sale) external view returns (bool);
}


// File contracts/interfaces/IAllocationStaking.sol


pragma solidity 0.6.12;

interface IAllocationStaking {
    function redistributeXava(uint256 _pid, address _user, uint256 _amountToBurn) external;
    function deposited(uint256 _pid, address _user) external view returns (uint256);
    function setTokensUnlockTime(uint256 _pid, address _user, uint256 _tokensUnlockTime) external;
}


// File contracts/sales/AvalaunchSale.sol


pragma solidity 0.6.12;






contract AvalaunchSale {
    using ECDSA for bytes32;
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    // Pointer to Allocation staking contract, where burnXavaFromUser will be called.
    IAllocationStaking public allocationStakingContract;
    // Pointer to sales factory contract
    ISalesFactory public factory;
    // Admin contract
    IAdmin public admin;

    struct Sale {
        // Token being sold
        IERC20 token;
        // Is sale created
        bool isCreated;
        // Are earnings withdrawn
        bool earningsWithdrawn;
        // Is leftover withdrawn
        bool leftoverWithdrawn;
        // Have tokens been deposited
        bool tokensDeposited;
        // Address of sale owner
        address saleOwner;
        // Price of the token quoted in AVAX
        uint256 tokenPriceInAVAX;
        // Amount of tokens to sell
        uint256 amountOfTokensToSell;
        // Total tokens being sold
        uint256 totalTokensSold;
        // Total AVAX Raised
        uint256 totalAVAXRaised;
        // Sale end time
        uint256 saleEnd;
        // When tokens can be withdrawn
        uint256 tokensUnlockTime;
    }

    // Participation structure
    struct Participation {
        uint256 amountBought;
        uint256 amountAVAXPaid;
        uint256 timeParticipated;
        uint256 roundId;
        bool[] isPortionWithdrawn;
    }

    // Round structure
    struct Round {
        uint256 startTime;
        uint256 maxParticipation;
    }

    struct Registration {
        uint256 registrationTimeStarts;
        uint256 registrationTimeEnds;
        uint256 numberOfRegistrants;
    }

    // Sale
    Sale public sale;
    // Registration
    Registration public registration;
    // Number of users participated in the sale.
    uint256 public numberOfParticipants;
    // Array storing IDS of rounds (IDs start from 1, so they can't be mapped as array indexes
    uint256[] public roundIds;
    // Mapping round Id to round
    mapping(uint256 => Round) public roundIdToRound;
    // Mapping user to his participation
    mapping(address => Participation) public userToParticipation;
    // User to round for which he registered
    mapping(address => uint256) public addressToRoundRegisteredFor;
    // mapping if user is participated or not
    mapping(address => bool) public isParticipated;
    // wei precision
    uint256 public constant one = 10**18;
    // Times when portions are getting unlocked
    uint256[] public vestingPortionsUnlockTime;
    // Percent of the participation user can withdraw
    uint256[] public vestingPercentPerPortion;
    //Precision for percent for portion vesting
    uint256 public portionVestingPrecision;
    // Added configurable round ID for staking round
    uint256 public stakingRoundId;
    // Max vesting time shift
    uint256 public maxVestingTimeShift;
    // Registration deposit AVAX, which will be paid during the registration, and returned back during the participation.
    uint256 public registrationDepositAVAX;
    // Accounting total AVAX collected, after sale admin can withdraw this
    uint256 public registrationFees;

    // Restricting calls only to sale owner
    modifier onlySaleOwner() {
        require(msg.sender == sale.saleOwner, "OnlySaleOwner:: Restricted");
        _;
    }

    modifier onlyAdmin() {
        require(
            admin.isAdmin(msg.sender),
            "Only admin can call this function."
        );
        _;
    }

    // EVENTS

    event TokensSold(address user, uint256 amount);
    event UserRegistered(address user, uint256 roundId);
    event TokenPriceSet(uint256 newPrice);
    event MaxParticipationSet(uint256 roundId, uint256 maxParticipation);
    event TokensWithdrawn(address user, uint256 amount);
    event SaleCreated(
        address saleOwner,
        uint256 tokenPriceInAVAX,
        uint256 amountOfTokensToSell,
        uint256 saleEnd,
        uint256 tokensUnlockTime
    );
    event RegistrationTimeSet(
        uint256 registrationTimeStarts,
        uint256 registrationTimeEnds
    );
    event RoundAdded(
        uint256 roundId,
        uint256 startTime,
        uint256 maxParticipation
    );
    event RegistrationAVAXRefunded(address user, uint256 amountRefunded);

    // Constructor, always initialized through SalesFactory
    constructor(address _admin, address _allocationStaking) public {
        require(_admin != address(0));
        require(_allocationStaking != address(0));
        admin = IAdmin(_admin);
        factory = ISalesFactory(msg.sender);
        allocationStakingContract = IAllocationStaking(_allocationStaking);
    }

    /// @notice         Function to set vesting params
    function setVestingParams(
        uint256[] memory _unlockingTimes,
        uint256[] memory _percents,
        uint256 _maxVestingTimeShift
    ) external onlyAdmin {
        require(
            vestingPercentPerPortion.length == 0 &&
            vestingPortionsUnlockTime.length == 0
        );
        require(_unlockingTimes.length == _percents.length);
        require(portionVestingPrecision > 0, "Safeguard for making sure setSaleParams get first called.");
        require(_maxVestingTimeShift <= 30 days, "Maximal shift is 30 days.");

        // Set max vesting time shift
        maxVestingTimeShift = _maxVestingTimeShift;

        uint256 sum;

        for (uint256 i = 0; i < _unlockingTimes.length; i++) {
            vestingPortionsUnlockTime.push(_unlockingTimes[i]);
            vestingPercentPerPortion.push(_percents[i]);
            sum += _percents[i];
        }

        require(sum == portionVestingPrecision, "Percent distribution issue.");
    }

    function shiftVestingUnlockingTimes(uint256 timeToShift)
        external
        onlyAdmin
    {
        require(
            timeToShift > 0 && timeToShift < maxVestingTimeShift,
            "Shift must be nonzero and smaller than maxVestingTimeShift."
        );

        // Time can be shifted only once.
        maxVestingTimeShift = 0;

        for (uint256 i = 0; i < vestingPortionsUnlockTime.length; i++) {
            vestingPortionsUnlockTime[i] = vestingPortionsUnlockTime[i].add(
                timeToShift
            );
        }
    }

    /// @notice     Admin function to set sale parameters
    function setSaleParams(
        address _token,
        address _saleOwner,
        uint256 _tokenPriceInAVAX,
        uint256 _amountOfTokensToSell,
        uint256 _saleEnd,
        uint256 _tokensUnlockTime,
        uint256 _portionVestingPrecision,
        uint256 _stakingRoundId,
        uint256 _registrationDepositAVAX
    ) external onlyAdmin {
        require(!sale.isCreated, "setSaleParams: Sale is already created.");
        require(
            _saleOwner != address(0),
            "setSaleParams: Sale owner address can not be 0."
        );
        require(
            _tokenPriceInAVAX != 0 &&
                _amountOfTokensToSell != 0 &&
                _saleEnd > block.timestamp &&
                _tokensUnlockTime > block.timestamp,
            "setSaleParams: Bad input"
        );
        require(_portionVestingPrecision >= 100, "Should be at least 100");
        require(_stakingRoundId > 0, "Staking round ID can not be 0.");

        // Set params
        sale.token = IERC20(_token);
        sale.isCreated = true;
        sale.saleOwner = _saleOwner;
        sale.tokenPriceInAVAX = _tokenPriceInAVAX;
        sale.amountOfTokensToSell = _amountOfTokensToSell;
        sale.saleEnd = _saleEnd;
        sale.tokensUnlockTime = _tokensUnlockTime;

        // Deposit in AVAX, sent during the registration
        registrationDepositAVAX = _registrationDepositAVAX;
        // Set portion vesting precision
        portionVestingPrecision = _portionVestingPrecision;
        // Set staking round id
        stakingRoundId = _stakingRoundId;
        // Emit event
        emit SaleCreated(
            sale.saleOwner,
            sale.tokenPriceInAVAX,
            sale.amountOfTokensToSell,
            sale.saleEnd,
            sale.tokensUnlockTime
        );
    }

    // @notice     Function to retroactively set sale token address, can be called only once,
    //             after initial contract creation has passed. Added as an options for teams which
    //             are not having token at the moment of sale launch.
    function setSaleToken(
        address saleToken
    )
    external
    onlyAdmin
    {
        require(address(sale.token) == address(0));
        sale.token = IERC20(saleToken);
    }


    /// @notice     Function to set registration period parameters
    function setRegistrationTime(
        uint256 _registrationTimeStarts,
        uint256 _registrationTimeEnds
    ) external onlyAdmin {
        require(sale.isCreated);
        require(registration.registrationTimeStarts == 0);
        require(
            _registrationTimeStarts >= block.timestamp &&
                _registrationTimeEnds > _registrationTimeStarts
        );
        require(_registrationTimeEnds < sale.saleEnd);

        if (roundIds.length > 0) {
            require(
                _registrationTimeEnds < roundIdToRound[roundIds[0]].startTime
            );
        }

        registration.registrationTimeStarts = _registrationTimeStarts;
        registration.registrationTimeEnds = _registrationTimeEnds;

        emit RegistrationTimeSet(
            registration.registrationTimeStarts,
            registration.registrationTimeEnds
        );
    }

    function setRounds(
        uint256[] calldata startTimes,
        uint256[] calldata maxParticipations
    ) external onlyAdmin {
        require(sale.isCreated);
        require(
            startTimes.length == maxParticipations.length,
            "setRounds: Bad input."
        );
        require(roundIds.length == 0, "setRounds: Rounds are set already.");
        require(startTimes.length > 0);

        uint256 lastTimestamp = 0;
        for (uint256 i = 0; i < startTimes.length; i++) {
            require(startTimes[i] > registration.registrationTimeEnds);
            require(startTimes[i] < sale.saleEnd);
            require(startTimes[i] >= block.timestamp);
            require(maxParticipations[i] > 0);
            require(startTimes[i] > lastTimestamp);
            lastTimestamp = startTimes[i];

            // Compute round Id
            uint256 roundId = i + 1;

            // Push id to array of ids
            roundIds.push(roundId);

            // Create round
            Round memory round = Round(startTimes[i], maxParticipations[i]);

            // Map round id to round
            roundIdToRound[roundId] = round;

            // Fire event
            emit RoundAdded(roundId, round.startTime, round.maxParticipation);
        }
    }

    /// @notice     Registration for sale.
    /// @param      signature is the message signed by the backend
    /// @param      roundId is the round for which user expressed interest to participate
    function registerForSale(bytes memory signature, uint256 roundId)
        external
        payable
    {
        require(
            msg.value == registrationDepositAVAX,
            "Registration deposit does not match."
        );
        require(roundId != 0, "Round ID can not be 0.");
        require(roundId <= roundIds.length, "Invalid round id");
        require(
            block.timestamp >= registration.registrationTimeStarts &&
                block.timestamp <= registration.registrationTimeEnds,
            "Registration gate is closed."
        );
        require(
            checkRegistrationSignature(signature, msg.sender, roundId),
            "Invalid signature"
        );
        require(
            addressToRoundRegisteredFor[msg.sender] == 0,
            "User can not register twice."
        );

        // Rounds are 1,2,3
        addressToRoundRegisteredFor[msg.sender] = roundId;
        // Special cases for staking round
        if (roundId == stakingRoundId) {
            // Lock users stake
            allocationStakingContract.setTokensUnlockTime(
                0,
                msg.sender,
                sale.saleEnd
            );
        }
        // Increment number of registered users
        registration.numberOfRegistrants++;
        // Increase earnings from registration fees
        registrationFees = registrationFees.add(msg.value);
        // Emit Registration event
        emit UserRegistered(msg.sender, roundId);
    }

    /// @notice     Admin function, to update token price before sale to match the closest $ desired rate.
    /// @dev        This will be updated with an oracle during the sale every N minutes, so the users will always
    ///             pay initialy set $ value of the token. This is to reduce reliance on the AVAX volatility.
    function updateTokenPriceInAVAX(uint256 price) external onlyAdmin {
        require(price > 0, "Price can not be 0.");
        // Allowing oracle to run and change the sale value
        sale.tokenPriceInAVAX = price;
        emit TokenPriceSet(price);
    }

    /// @notice     Admin function to postpone the sale
    function postponeSale(uint256 timeToShift) external onlyAdmin {
        require(
            block.timestamp < roundIdToRound[roundIds[0]].startTime,
            "1st round already started."
        );
        // Iterate through all registered rounds and postpone them
        for (uint256 i = 0; i < roundIds.length; i++) {
            Round storage round = roundIdToRound[roundIds[i]];
            // Postpone sale
            round.startTime = round.startTime.add(timeToShift);
            require(
                round.startTime + timeToShift < sale.saleEnd,
                "Start time can not be greater than end time."
            );
        }
    }

    /// @notice     Function to extend registration period
    function extendRegistrationPeriod(uint256 timeToAdd) external onlyAdmin {
        require(
            registration.registrationTimeEnds.add(timeToAdd) <
                roundIdToRound[roundIds[0]].startTime,
            "Registration period overflows sale start."
        );

        registration.registrationTimeEnds = registration
            .registrationTimeEnds
            .add(timeToAdd);
    }

    /// @notice     Admin function to set max participation cap per round
    function setCapPerRound(uint256[] calldata rounds, uint256[] calldata caps)
        external
        onlyAdmin
    {
        require(
            block.timestamp < roundIdToRound[roundIds[0]].startTime,
            "1st round already started."
        );
        require(rounds.length == caps.length, "Arrays length is different.");

        for (uint256 i = 0; i < rounds.length; i++) {
            require(caps[i] > 0, "Can't set max participation to 0");

            Round storage round = roundIdToRound[rounds[i]];
            round.maxParticipation = caps[i];

            emit MaxParticipationSet(rounds[i], round.maxParticipation);
        }
    }

    // Function for owner to deposit tokens, can be called only once.
    function depositTokens() external onlySaleOwner {
        require(
            !sale.tokensDeposited, "Deposit can be done only once"
        );

        sale.tokensDeposited = true;

        sale.token.safeTransferFrom(
            msg.sender,
            address(this),
            sale.amountOfTokensToSell
        );
    }

    // Function to participate in the sales
    function participate(
        bytes memory signature,
        uint256 amount,
        uint256 amountXavaToBurn,
        uint256 roundId
    ) external payable {

        require(roundId != 0, "Round can not be 0.");

        require(
            amount <= roundIdToRound[roundId].maxParticipation,
            "Overflowing maximal participation for this round."
        );

        // User must have registered for the round in advance
        require(
            addressToRoundRegisteredFor[msg.sender] == roundId,
            "Not registered for this round"
        );

        // Verify the signature
        require(
            checkParticipationSignature(
                signature,
                msg.sender,
                amount,
                amountXavaToBurn,
                roundId
            ),
            "Invalid signature. Verification failed"
        );

        // Check user haven't participated before
        require(!isParticipated[msg.sender], "User can participate only once.");

        // Disallow contract calls.
        require(msg.sender == tx.origin, "Only direct contract calls.");

        // Get current active round
        uint256 currentRound = getCurrentRound();

        // Assert that
        require(
            roundId == currentRound,
            "You can not participate in this round."
        );

        // Compute the amount of tokens user is buying
        uint256 amountOfTokensBuying = (msg.value).mul(one).div(
            sale.tokenPriceInAVAX
        );

        // Must buy more than 0 tokens
        require(amountOfTokensBuying > 0, "Can't buy 0 tokens");

        // Check in terms of user allo
        require(
            amountOfTokensBuying <= amount,
            "Trying to buy more than allowed."
        );

        // Increase amount of sold tokens
        sale.totalTokensSold = sale.totalTokensSold.add(amountOfTokensBuying);

        // Increase amount of AVAX raised
        sale.totalAVAXRaised = sale.totalAVAXRaised.add(msg.value);

        bool[] memory _isPortionWithdrawn = new bool[](
            vestingPortionsUnlockTime.length
        );

        // Create participation object
        Participation memory p = Participation({
            amountBought: amountOfTokensBuying,
            amountAVAXPaid: msg.value,
            timeParticipated: block.timestamp,
            roundId: roundId,
            isPortionWithdrawn: _isPortionWithdrawn
        });

        // Staking round only.
        if (roundId == stakingRoundId) {
            // Burn XAVA from this user.
            allocationStakingContract.redistributeXava(
                0,
                msg.sender,
                amountXavaToBurn
            );
        }

        // Add participation for user.
        userToParticipation[msg.sender] = p;
        // Mark user is participated
        isParticipated[msg.sender] = true;
        // Increment number of participants in the Sale.
        numberOfParticipants++;
        // Decrease of available registration fees
        registrationFees = registrationFees.sub(registrationDepositAVAX);
        // Transfer registration deposit amount in AVAX back to the users.
        safeTransferAVAX(msg.sender, registrationDepositAVAX);

        emit RegistrationAVAXRefunded(msg.sender, registrationDepositAVAX);
        emit TokensSold(msg.sender, amountOfTokensBuying);
    }

    /// Users can claim their participation
    function withdrawTokens(uint256 portionId) external {
        require(
            block.timestamp >= sale.tokensUnlockTime,
            "Tokens can not be withdrawn yet."
        );
        require(portionId < vestingPercentPerPortion.length);

        Participation storage p = userToParticipation[msg.sender];

        if (
            !p.isPortionWithdrawn[portionId] &&
            vestingPortionsUnlockTime[portionId] <= block.timestamp
        ) {
            p.isPortionWithdrawn[portionId] = true;
            uint256 amountWithdrawing = p
                .amountBought
                .mul(vestingPercentPerPortion[portionId])
                .div(portionVestingPrecision);

            // Withdraw percent which is unlocked at that portion
            if(amountWithdrawing > 0) {
                sale.token.safeTransfer(msg.sender, amountWithdrawing);
                emit TokensWithdrawn(msg.sender, amountWithdrawing);
            }
        } else {
            revert("Tokens already withdrawn or portion not unlocked yet.");
        }
    }

    // Expose function where user can withdraw multiple unlocked portions at once.
    function withdrawMultiplePortions(uint256 [] calldata portionIds) external {
        uint256 totalToWithdraw = 0;

        Participation storage p = userToParticipation[msg.sender];

        for(uint i=0; i < portionIds.length; i++) {
            uint256 portionId = portionIds[i];
            require(portionId < vestingPercentPerPortion.length);

            if (
                !p.isPortionWithdrawn[portionId] &&
                vestingPortionsUnlockTime[portionId] <= block.timestamp
            ) {
                p.isPortionWithdrawn[portionId] = true;
                uint256 amountWithdrawing = p
                .amountBought
                .mul(vestingPercentPerPortion[portionId])
                .div(portionVestingPrecision);
                // Withdraw percent which is unlocked at that portion
                totalToWithdraw = totalToWithdraw.add(amountWithdrawing);
            }
        }

        if(totalToWithdraw > 0) {
            sale.token.safeTransfer(msg.sender, totalToWithdraw);
            emit TokensWithdrawn(msg.sender, totalToWithdraw);
        }
    }

    // Internal function to handle safe transfer
    function safeTransferAVAX(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success);
    }

    /// Function to withdraw all the earnings and the leftover of the sale contract.
    function withdrawEarningsAndLeftover() external onlySaleOwner {
        withdrawEarningsInternal();
        withdrawLeftoverInternal();
    }

    // Function to withdraw only earnings
    function withdrawEarnings() external onlySaleOwner {
        withdrawEarningsInternal();
    }

    // Function to withdraw only leftover
    function withdrawLeftover() external onlySaleOwner {
        withdrawLeftoverInternal();
    }


    // function to withdraw earnings
    function withdrawEarningsInternal() internal  {
        // Make sure sale ended
        require(block.timestamp >= sale.saleEnd);

        // Make sure owner can't withdraw twice
        require(!sale.earningsWithdrawn);
        sale.earningsWithdrawn = true;
        // Earnings amount of the owner in AVAX
        uint256 totalProfit = sale.totalAVAXRaised;

        safeTransferAVAX(msg.sender, totalProfit);
    }

    // Function to withdraw leftover
    function withdrawLeftoverInternal() internal {
        // Make sure sale ended
        require(block.timestamp >= sale.saleEnd);

        // Make sure owner can't withdraw twice
        require(!sale.leftoverWithdrawn);
        sale.leftoverWithdrawn = true;

        // Amount of tokens which are not sold
        uint256 leftover = sale.amountOfTokensToSell.sub(sale.totalTokensSold);

        if (leftover > 0) {
            sale.token.safeTransfer(msg.sender, leftover);
        }
    }

    // Function after sale for admin to withdraw registration fees if there are any left.
    function withdrawRegistrationFees() external onlyAdmin {
        require(block.timestamp >= sale.saleEnd, "Require that sale has ended.");
        require(registrationFees > 0, "No earnings from registration fees.");

        // Transfer AVAX to the admin wallet.
        safeTransferAVAX(msg.sender, registrationFees);
        // Set registration fees to be 0
        registrationFees = 0;
    }

    // Function where admin can withdraw all unused funds.
    function withdrawUnusedFunds() external onlyAdmin {
        uint256 balanceAVAX = address(this).balance;

        uint256 totalReservedForRaise = sale.earningsWithdrawn ? 0 : sale.totalAVAXRaised;

        safeTransferAVAX(
            msg.sender,
            balanceAVAX.sub(totalReservedForRaise.add(registrationFees))
        );
    }

    // Function to act as a fallback and handle receiving AVAX.
    receive() external payable {

    }

    /// @notice     Get current round in progress.
    ///             If 0 is returned, means sale didn't start or it's ended.
    function getCurrentRound() public view returns (uint256) {
        uint256 i = 0;
        if (block.timestamp < roundIdToRound[roundIds[0]].startTime) {
            return 0; // Sale didn't start yet.
        }

        while (
            (i + 1) < roundIds.length &&
            block.timestamp > roundIdToRound[roundIds[i + 1]].startTime
        ) {
            i++;
        }

        if (block.timestamp >= sale.saleEnd) {
            return 0; // Means sale is ended
        }

        return roundIds[i];
    }

    /// @notice     Check signature user submits for registration.
    /// @param      signature is the message signed by the trusted entity (backend)
    /// @param      user is the address of user which is registering for sale
    /// @param      roundId is the round for which user is submitting registration
    function checkRegistrationSignature(
        bytes memory signature,
        address user,
        uint256 roundId
    ) public view returns (bool) {
        bytes32 hash = keccak256(
            abi.encodePacked(user, roundId, address(this))
        );
        bytes32 messageHash = hash.toEthSignedMessageHash();
        return admin.isAdmin(messageHash.recover(signature));
    }

    // Function to check if admin was the message signer
    function checkParticipationSignature(
        bytes memory signature,
        address user,
        uint256 amount,
        uint256 amountXavaToBurn,
        uint256 round
    ) public view returns (bool) {
        return
            admin.isAdmin(
                getParticipationSigner(
                    signature,
                    user,
                    amount,
                    amountXavaToBurn,
                    round
                )
            );
    }

    /// @notice     Check who signed the message
    /// @param      signature is the message allowing user to participate in sale
    /// @param      user is the address of user for which we're signing the message
    /// @param      amount is the maximal amount of tokens user can buy
    /// @param      roundId is the Id of the round user is participating.
    function getParticipationSigner(
        bytes memory signature,
        address user,
        uint256 amount,
        uint256 amountXavaToBurn,
        uint256 roundId
    ) public view returns (address) {
        bytes32 hash = keccak256(
            abi.encodePacked(
                user,
                amount,
                amountXavaToBurn,
                roundId,
                address(this)
            )
        );
        bytes32 messageHash = hash.toEthSignedMessageHash();
        return messageHash.recover(signature);
    }

    /// @notice     Function to get participation for passed user address
    function getParticipation(address _user)
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            uint256,
            bool[] memory
        )
    {
        Participation memory p = userToParticipation[_user];
        return (
            p.amountBought,
            p.amountAVAXPaid,
            p.timeParticipated,
            p.roundId,
            p.isPortionWithdrawn
        );
    }

    /// @notice     Function to get number of registered users for sale
    function getNumberOfRegisteredUsers() external view returns (uint256) {
        return registration.numberOfRegistrants;
    }

    /// @notice     Function to get all info about vesting.
    function getVestingInfo()
        external
        view
        returns (uint256[] memory, uint256[] memory)
    {
        return (vestingPortionsUnlockTime, vestingPercentPerPortion);
    }
}


// File contracts/sales/SalesFactory.sol


pragma solidity 0.6.12;


contract SalesFactory {

    IAdmin public admin;
    address public allocationStaking;

    mapping (address => bool) public isSaleCreatedThroughFactory;

    mapping(address => address) public saleOwnerToSale;
    mapping(address => address) public tokenToSale;

    // Expose so query can be possible only by position as well
    address [] public allSales;

    event SaleDeployed(address saleContract);
    event SaleOwnerAndTokenSetInFactory(address sale, address saleOwner, address saleToken);

    modifier onlyAdmin {
        require(admin.isAdmin(msg.sender), "Only Admin can deploy sales");
        _;
    }

    constructor (address _adminContract, address _allocationStaking) public {
        admin = IAdmin(_adminContract);
        allocationStaking = _allocationStaking;
    }

    // Set allocation staking contract address.
    function setAllocationStaking(address _allocationStaking) public onlyAdmin {
        require(_allocationStaking != address(0));
        allocationStaking = _allocationStaking;
    }


    function deploySale()
    external
    onlyAdmin
    {
        AvalaunchSale sale = new AvalaunchSale(address(admin), allocationStaking);

        isSaleCreatedThroughFactory[address(sale)] = true;
        allSales.push(address(sale));

        emit SaleDeployed(address(sale));
    }

    // Function to return number of pools deployed
    function getNumberOfSalesDeployed() external view returns (uint) {
        return allSales.length;
    }

    // Function
    function getLastDeployedSale() external view returns (address) {
        //
        if(allSales.length > 0) {
            return allSales[allSales.length - 1];
        }
        return address(0);
    }


    // Function to get all sales
    function getAllSales(uint startIndex, uint endIndex) external view returns (address[] memory) {
        require(endIndex > startIndex, "Bad input");

        address[] memory sales = new address[](endIndex - startIndex);
        uint index = 0;

        for(uint i = startIndex; i < endIndex; i++) {
            sales[index] = allSales[i];
            index++;
        }

        return sales;
    }

}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_adminContract","type":"address"},{"internalType":"address","name":"_allocationStaking","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"saleContract","type":"address"}],"name":"SaleDeployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sale","type":"address"},{"indexed":false,"internalType":"address","name":"saleOwner","type":"address"},{"indexed":false,"internalType":"address","name":"saleToken","type":"address"}],"name":"SaleOwnerAndTokenSetInFactory","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"contract IAdmin","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allSales","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allocationStaking","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deploySale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startIndex","type":"uint256"},{"internalType":"uint256","name":"endIndex","type":"uint256"}],"name":"getAllSales","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastDeployedSale","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumberOfSalesDeployed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isSaleCreatedThroughFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"saleOwnerToSale","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_allocationStaking","type":"address"}],"name":"setAllocationStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenToSale","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50604051614e72380380614e728339818101604052604081101561003357600080fd5b508051602090910151600080546001600160a01b039384166001600160a01b03199182161790915560018054939092169216919091179055614df88061007a6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80639c0ad5ed116100715780639c0ad5ed146101575780639e75cf451461017d578063a00249e8146101f0578063b033342b1461022a578063c050f3d414610232578063f851a4401461023a576100a9565b8063135fb504146100ae578063209a9f41146100d257806324be4a50146100ec5780635b30b428146101125780639af2c4811461012f575b600080fd5b6100b6610242565b604080516001600160a01b039092168252519081900360200190f35b6100da610251565b60408051918252519081900360200190f35b6100b66004803603602081101561010257600080fd5b50356001600160a01b0316610258565b6100b66004803603602081101561012857600080fd5b5035610273565b6101556004803603602081101561014557600080fd5b50356001600160a01b031661029a565b005b6100b66004803603602081101561016d57600080fd5b50356001600160a01b0316610397565b6101a06004803603604081101561019357600080fd5b50803590602001356103b2565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101dc5781810151838201526020016101c4565b505050509050019250505060405180910390f35b6102166004803603602081101561020657600080fd5b50356001600160a01b03166104ad565b604080519115158252519081900360200190f35b6100b66104c2565b610155610501565b6100b66106bf565b6001546001600160a01b031681565b6005545b90565b6003602052600090815260409020546001600160a01b031681565b6005818154811061028057fe5b6000918252602090912001546001600160a01b0316905081565b60005460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b1580156102e557600080fd5b505afa1580156102f9573d6000803e3d6000fd5b505050506040513d602081101561030f57600080fd5b5051610362576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792041646d696e2063616e206465706c6f792073616c65730000000000604482015290519081900360640190fd5b6001600160a01b03811661037557600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004602052600090815260409020546001600160a01b031681565b60608282116103f4576040805162461bcd60e51b8152602060048201526009602482015268109859081a5b9c1d5d60ba1b604482015290519081900360640190fd5b606083830367ffffffffffffffff8111801561040f57600080fd5b50604051908082528060200260200182016040528015610439578160200160208202803683370190505b5090506000845b848110156104a3576005818154811061045557fe5b9060005260206000200160009054906101000a90046001600160a01b031683838151811061047f57fe5b6001600160a01b039092166020928302919091019091015260019182019101610440565b5090949350505050565b60026020526000908152604090205460ff1681565b600554600090156104fb576005805460001981019081106104df57fe5b6000918252602090912001546001600160a01b03169050610255565b50600090565b60005460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b15801561054c57600080fd5b505afa158015610560573d6000803e3d6000fd5b505050506040513d602081101561057657600080fd5b50516105c9576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792041646d696e2063616e206465706c6f792073616c65730000000000604482015290519081900360640190fd5b600080546001546040516001600160a01b0392831692909116906105ec906106ce565b6001600160a01b03928316815291166020820152604080519182900301906000f08015801561061f573d6000803e3d6000fd5b506001600160a01b0381166000818152600260209081526040808320805460ff191660019081179091556005805491820181559093527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db090920180546001600160a01b03191684179055815192835290519293507f65c0ac3f6aa97317ad1e9f6c73af709aad47dc12a97239e1b08a43a73195f7e092918290030190a150565b6000546001600160a01b031681565b6146e7806106dc8339019056fe60806040523480156200001157600080fd5b50604051620046e7380380620046e7833981810160405260408110156200003757600080fd5b5080516020909101516001600160a01b0382166200005457600080fd5b6001600160a01b0381166200006857600080fd5b600280546001600160a01b039384166001600160a01b031991821617909155600180548216331790556000805492909316911617905561463980620000ae6000396000f3fe6080604052600436106102815760003560e01c8063a525d2371161014f578063cf5b8d4b116100c1578063e7b1d75e1161007a578063e7b1d75e14610e77578063e9d8479e14610ea1578063efac32bd14610f47578063f1ef7ff214610f5c578063f1f001e014610f86578063f851a4401461105157610288565b8063cf5b8d4b14610c0a578063d937d45614610c3d578063da4d4fbf14610d6f578063dc25a30014610d84578063e099cf6414610e32578063e6dd299f14610e6257610288565b8063c45a015511610113578063c45a0155146109ae578063c53ced89146109c3578063c6e54f5b146109d8578063c758174d14610a87578063cad925ef14610b52578063ccc171f514610bf557610288565b8063a525d23714610930578063ab7589b514610945578063abee69271461095a578063b73c6ce914610984578063c1c5c6141461099957610288565b80635c997961116101f35780637c4b414d116101ac5780637c4b414d1461086a578063901717d11461087f57806390a4cb9b14610894578063927f6aee146108be578063a29f481c146108e8578063a32bf5971461091b57610288565b80635c997961146106775780635e7464f61461068c5780636ad1fe02146106e5578063718af7e6146107715780637417040e146107ec57806376750f2c1461080157610288565b8063315a095d11610245578063315a095d1461040f578063399ed97c146104395780633dad431114610504578063443bd1d0146105475780635164d8711461057a57806358c26cc9146105a457610288565b8063059ea1721461028d5780630c927f95146102be578063110b9c75146103895780631f11cb1e146103ce5780632a7c35de146103fa57610288565b3661028857005b600080fd5b34801561029957600080fd5b506102a2611066565b604080516001600160a01b039092168252519081900360200190f35b3480156102ca57600080fd5b506102a2600480360360a08110156102e157600080fd5b810190602081018135600160201b8111156102fb57600080fd5b82018360208201111561030d57600080fd5b803590602001918460018302840111600160201b8311171561032e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550506001600160a01b038335169350505060208101359060408101359060600135611075565b34801561039557600080fd5b506103bc600480360360208110156103ac57600080fd5b50356001600160a01b03166110f0565b60408051918252519081900360200190f35b3480156103da57600080fd5b506103f8600480360360208110156103f157600080fd5b5035611102565b005b34801561040657600080fd5b506103bc6112da565b34801561041b57600080fd5b506103f86004803603602081101561043257600080fd5b50356112e0565b34801561044557600080fd5b506103f86004803603604081101561045c57600080fd5b810190602081018135600160201b81111561047657600080fd5b82018360208201111561048857600080fd5b803590602001918460208302840111600160201b831117156104a957600080fd5b919390929091602081019035600160201b8111156104c657600080fd5b8201836020820111156104d857600080fd5b803590602001918460208302840111600160201b831117156104f957600080fd5b5090925090506114b1565b34801561051057600080fd5b5061052e6004803603602081101561052757600080fd5b50356117be565b6040805192835260208301919091528051918290030190f35b34801561055357600080fd5b5061055c6117d7565b60408051938452602084019290925282820152519081900360600190f35b34801561058657600080fd5b506103f86004803603602081101561059d57600080fd5b50356117e3565b3480156105b057600080fd5b50610663600480360360608110156105c757600080fd5b810190602081018135600160201b8111156105e157600080fd5b8201836020820111156105f357600080fd5b803590602001918460018302840111600160201b8311171561061457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550506001600160a01b03833516935050506020013561191f565b604080519115158252519081900360200190f35b34801561068357600080fd5b506103bc611a07565b34801561069857600080fd5b506106bf600480360360208110156106af57600080fd5b50356001600160a01b0316611a0d565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156106f157600080fd5b506106fa611a34565b604080516001600160a01b039d8e1681529b151560208d01529915158b8b015297151560608b015295151560808a01529390981660a088015260c087019190915260e08601526101008501959095526101208401949094526101408301939093526101608201929092529051908190036101800190f35b34801561077d57600080fd5b506103f86004803603602081101561079457600080fd5b810190602081018135600160201b8111156107ae57600080fd5b8201836020820111156107c057600080fd5b803590602001918460208302840111600160201b831117156107e157600080fd5b509092509050611a91565b3480156107f857600080fd5b506103bc611c09565b34801561080d57600080fd5b506103f8600480360361012081101561082557600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060c08101359060e0810135906101000135611c0f565b34801561087657600080fd5b506103f8611f27565b34801561088b57600080fd5b506103bc612013565b3480156108a057600080fd5b506103bc600480360360208110156108b757600080fd5b503561201f565b3480156108ca57600080fd5b506103bc600480360360208110156108e157600080fd5b503561203d565b3480156108f457600080fd5b506103f86004803603602081101561090b57600080fd5b50356001600160a01b031661204a565b34801561092757600080fd5b506103bc612134565b34801561093c57600080fd5b506103f86121fd565b34801561095157600080fd5b506103bc612261565b34801561096657600080fd5b506103f86004803603602081101561097d57600080fd5b5035612267565b34801561099057600080fd5b506103f86123c2565b3480156109a557600080fd5b506103bc612426565b3480156109ba57600080fd5b506102a261242c565b3480156109cf57600080fd5b506103bc61243b565b6103f8600480360360808110156109ee57600080fd5b810190602081018135600160201b811115610a0857600080fd5b820183602082011115610a1a57600080fd5b803590602001918460018302840111600160201b83111715610a3b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505082359350505060208101359060400135612441565b348015610a9357600080fd5b506103f860048036036040811015610aaa57600080fd5b810190602081018135600160201b811115610ac457600080fd5b820183602082011115610ad657600080fd5b803590602001918460208302840111600160201b83111715610af757600080fd5b919390929091602081019035600160201b811115610b1457600080fd5b820183602082011115610b2657600080fd5b803590602001918460208302840111600160201b83111715610b4757600080fd5b509092509050612970565b348015610b5e57600080fd5b50610b8560048036036020811015610b7557600080fd5b50356001600160a01b0316612c0e565b6040518086815260200185815260200184815260200183815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015610bdd578181015183820152602001610bc5565b50505050905001965050505050505060405180910390f35b348015610c0157600080fd5b506103bc612d05565b348015610c1657600080fd5b5061066360048036036020811015610c2d57600080fd5b50356001600160a01b0316612d0b565b348015610c4957600080fd5b506103f860048036036060811015610c6057600080fd5b810190602081018135600160201b811115610c7a57600080fd5b820183602082011115610c8c57600080fd5b803590602001918460208302840111600160201b83111715610cad57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610cfc57600080fd5b820183602082011115610d0e57600080fd5b803590602001918460208302840111600160201b83111715610d2f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250612d20915050565b348015610d7b57600080fd5b506103f8612f7f565b348015610d9057600080fd5b50610d99612fe3565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610ddd578181015183820152602001610dc5565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610e1c578181015183820152602001610e04565b5050505090500194505050505060405180910390f35b348015610e3e57600080fd5b506103f860048036036040811015610e5557600080fd5b5080359060200135613096565b348015610e6e57600080fd5b506103f861321c565b348015610e8357600080fd5b506103f860048036036020811015610e9a57600080fd5b5035613319565b6103f860048036036040811015610eb757600080fd5b810190602081018135600160201b811115610ed157600080fd5b820183602082011115610ee357600080fd5b803590602001918460018302840111600160201b83111715610f0457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250613451915050565b348015610f5357600080fd5b506103f8613722565b348015610f6857600080fd5b506103bc60048036036020811015610f7f57600080fd5b503561387f565b348015610f9257600080fd5b50610663600480360360a0811015610fa957600080fd5b810190602081018135600160201b811115610fc357600080fd5b820183602082011115610fd557600080fd5b803590602001918460018302840111600160201b83111715610ff657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550506001600160a01b03833516935050506020810135906040810135906060013561388c565b34801561105d57600080fd5b506102a2613920565b6000546001600160a01b031681565b60408051606086811b6bffffffffffffffffffffffff19166020808401919091526034830187905260548301869052607483018590523090911b60948301528251808303608801815260a89092019092528051910120600090816110d88261392f565b90506110e48189613980565b98975050505050505050565b60126020526000908152604090205481565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b15801561114d57600080fd5b505afa158015611161573d6000803e3d6000fd5b505050506040513d602081101561117757600080fd5b50516111b45760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b60106000600f6000815481106111c657fe5b90600052602060002001548152602001908152602001600020600001544210611236576040805162461bcd60e51b815260206004820152601a60248201527f31737420726f756e6420616c726561647920737461727465642e000000000000604482015290519081900360640190fd5b60005b600f548110156112d657600060106000600f848154811061125657fe5b906000526020600020015481526020019081526020016000209050611288838260000154613a0290919063ffffffff16565b808255600954908401106112cd5760405162461bcd60e51b815260040180806020018281038252602c8152602001806143e2602c913960400191505060405180910390fd5b50600101611239565b5050565b60165481565b600a54421015611337576040805162461bcd60e51b815260206004820181905260248201527f546f6b656e732063616e206e6f742062652077697468647261776e207965742e604482015290519081900360640190fd5b601554811061134557600080fd5b3360009081526011602052604090206004810180548390811061136457fe5b90600052602060002090602091828204019190069054906101000a900460ff161580156113a85750426014838154811061139a57fe5b906000526020600020015411155b1561147a5760018160040183815481106113be57fe5b90600052602060002090602091828204019190066101000a81548160ff0219169083151502179055506000611419601654611413601586815481106113ff57fe5b600091825260209091200154855490613a5c565b90613ab5565b9050801561147457600354611438906001600160a01b03163383613b1c565b604080513381526020810183905281517f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b929181900390910190a15b506112d6565b60405162461bcd60e51b81526004018080602001828103825260358152602001806144536035913960400191505060405180910390fd5b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b1580156114fc57600080fd5b505afa158015611510573d6000803e3d6000fd5b505050506040513d602081101561152657600080fd5b50516115635760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b600354600160a01b900460ff1661157957600080fd5b8281146115c5576040805162461bcd60e51b815260206004820152601560248201527439b2ba2937bab732399d102130b21034b7383aba1760591b604482015290519081900360640190fd5b600f54156116045760405162461bcd60e51b81526004018080602001828103825260228152602001806143786022913960400191505060405180910390fd5b8261160e57600080fd5b6000805b848110156117b657600c5486868381811061162957fe5b905060200201351161163a57600080fd5b60095486868381811061164957fe5b905060200201351061165a57600080fd5b4286868381811061166757fe5b90506020020135101561167957600080fd5b600084848381811061168757fe5b905060200201351161169857600080fd5b818686838181106116a557fe5b90506020020135116116b657600080fd5b8585828181106116c257fe5b600f8054600181810183556000929092529085017f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290910181905560209091029290920135935061171390506141eb565b604051806040016040528089898681811061172a57fe5b90506020020135815260200187878681811061174257fe5b60209081029290920135909252600085815260108252604090819020845180825585840151600190920182905582518881529384015282820152519293507f527ad3db8f604c215553922f1f63e784584f9129564774aef6c410bee0eef64792908190036060019150a15050600101611612565b505050505050565b6010602052600090815260409020805460019091015482565b600b54600c54600d5483565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b15801561182e57600080fd5b505afa158015611842573d6000803e3d6000fd5b505050506040513d602081101561185857600080fd5b50516118955760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b60106000600f6000815481106118a757fe5b60009182526020808320909101548352820192909252604001902054600c546118d09083613a02565b1061190c5760405162461bcd60e51b81526004018080602001828103825260298152602001806144cb6029913960400191505060405180910390fd5b600c546119199082613a02565b600c5550565b60408051606084811b6bffffffffffffffffffffffff1916602080840191909152603483018590523090911b60548301528251808303604801815260689092019092528051910120600090816119748261392f565b6002549091506001600160a01b03166324d7806c6119928389613980565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156119cf57600080fd5b505afa1580156119e3573d6000803e3d6000fd5b505050506040513d60208110156119f957600080fd5b5051925050505b9392505050565b601a5481565b60116020526000908152604090208054600182015460028301546003909301549192909184565b600354600454600554600654600754600854600954600a546001600160a01b038089169860ff600160a01b8204811699600160a81b8304821699600160b01b8404831699600160b81b90940490921697931695909491939091908c565b336000908152601160205260408120815b83811015611ba9576000858583818110611ab857fe5b9050602002013590506015805490508110611ad257600080fd5b826004018181548110611ae157fe5b90600052602060002090602091828204019190069054906101000a900460ff16158015611b2557504260148281548110611b1757fe5b906000526020600020015411155b15611ba0576001836004018281548110611b3b57fe5b90600052602060002090602091828204019190066101000a81548160ff0219169083151502179055506000611b9060165461141360158581548110611b7c57fe5b600091825260209091200154875490613a5c565b9050611b9c8582613a02565b9450505b50600101611aa2565b508115611c0357600354611bc7906001600160a01b03163384613b1c565b604080513381526020810184905281517f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b929181900390910190a15b50505050565b600e5481565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b158015611c5a57600080fd5b505afa158015611c6e573d6000803e3d6000fd5b505050506040513d6020811015611c8457600080fd5b5051611cc15760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b600354600160a01b900460ff1615611d0a5760405162461bcd60e51b81526004018080602001828103825260278152602001806144f46027913960400191505060405180910390fd5b6001600160a01b038816611d4f5760405162461bcd60e51b815260040180806020018281038252602f81526020018061459a602f913960400191505060405180910390fd5b8615801590611d5d57508515155b8015611d6857504285115b8015611d7357504284115b611dc4576040805162461bcd60e51b815260206004820152601860248201527f73657453616c65506172616d733a2042616420696e7075740000000000000000604482015290519081900360640190fd5b6064831015611e13576040805162461bcd60e51b8152602060048201526016602482015275053686f756c64206265206174206c65617374203130360541b604482015290519081900360640190fd5b60008211611e68576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e6720726f756e642049442063616e206e6f7420626520302e0000604482015290519081900360640190fd5b6003805460ff60a01b196001600160a01b03808d166001600160a01b03199384161791909116600160a01b17909255600480548b841692169190911790819055600589905560068890556009879055600a8690556019839055601685905560178490556040805191909216815260208101899052808201889052606081018790526080810186905290517f04015af06f31ecd628a4f9fd400d312fc7ae48fdfa0d1a26b3b9ade20971a86e9181900360a00190a1505050505050505050565b6004546001600160a01b03163314611f83576040805162461bcd60e51b815260206004820152601a60248201527913db9b1e54d85b1953dddb995c8e8e8814995cdd1c9a58dd195960321b604482015290519081900360640190fd5b600354600160b81b900460ff1615611fe2576040805162461bcd60e51b815260206004820152601d60248201527f4465706f7369742063616e20626520646f6e65206f6e6c79206f6e6365000000604482015290519081900360640190fd5b6003805460ff60b81b1916600160b81b1790819055600654612011916001600160a01b03169033903090613b73565b565b670de0b6b3a764000081565b600f818154811061202c57fe5b600091825260209091200154905081565b6015818154811061202c57fe5b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b15801561209557600080fd5b505afa1580156120a9573d6000803e3d6000fd5b505050506040513d60208110156120bf57600080fd5b50516120fc5760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b6003546001600160a01b03161561211257600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000905060106000600f60008154811061214d57fe5b906000526020600020015481526020019081526020016000206000015442101561217b5760009150506121fa565b600f54600182011080156121be575060106000600f836001018154811061219e57fe5b906000526020600020015481526020019081526020016000206000015442115b156121cb5760010161217b565b60095442106121de5760009150506121fa565b600f81815481106121eb57fe5b90600052602060002001549150505b90565b6004546001600160a01b03163314612259576040805162461bcd60e51b815260206004820152601a60248201527913db9b1e54d85b1953dddb995c8e8e8814995cdd1c9a58dd195960321b604482015290519081900360640190fd5b612011613bcd565b600d5490565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b1580156122b257600080fd5b505afa1580156122c6573d6000803e3d6000fd5b505050506040513d60208110156122dc57600080fd5b50516123195760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b60008111801561232a575060185481105b6123655760405162461bcd60e51b815260040180806020018281038252603b8152602001806145c9603b913960400191505060405180910390fd5b600060188190555b6014548110156112d6576123a1826014838154811061238857fe5b9060005260206000200154613a0290919063ffffffff16565b601482815481106123ae57fe5b60009182526020909120015560010161236d565b6004546001600160a01b0316331461241e576040805162461bcd60e51b815260206004820152601a60248201527913db9b1e54d85b1953dddb995c8e8e8814995cdd1c9a58dd195960321b604482015290519081900360640190fd5b612011613c3b565b60195481565b6001546001600160a01b031681565b60175481565b80612489576040805162461bcd60e51b81526020600482015260136024820152722937bab7321031b0b7103737ba10313290181760691b604482015290519081900360640190fd5b6000818152601060205260409020600101548311156124d95760405162461bcd60e51b815260040180806020018281038252603181526020018061451b6031913960400191505060405180910390fd5b33600090815260126020526040902054811461253c576040805162461bcd60e51b815260206004820152601d60248201527f4e6f74207265676973746572656420666f72207468697320726f756e64000000604482015290519081900360640190fd5b612549843385858561388c565b6125845760405162461bcd60e51b81526004018080602001828103825260268152602001806143526026913960400191505060405180910390fd5b3360009081526013602052604090205460ff16156125e9576040805162461bcd60e51b815260206004820152601f60248201527f557365722063616e207061727469636970617465206f6e6c79206f6e63652e00604482015290519081900360640190fd5b33321461263d576040805162461bcd60e51b815260206004820152601b60248201527f4f6e6c792064697265637420636f6e74726163742063616c6c732e0000000000604482015290519081900360640190fd5b6000612647612134565b90508082146126875760405162461bcd60e51b815260040180806020018281038252602681526020018061432c6026913960400191505060405180910390fd5b6005546000906126a39061141334670de0b6b3a7640000613a5c565b9050600081116126ef576040805162461bcd60e51b815260206004820152601260248201527143616e277420627579203020746f6b656e7360701b604482015290519081900360640190fd5b84811115612744576040805162461bcd60e51b815260206004820181905260248201527f547279696e6720746f20627579206d6f7265207468616e20616c6c6f7765642e604482015290519081900360640190fd5b6007546127519082613a02565b6007556008546127619034613a02565b60085560145460609067ffffffffffffffff8111801561278057600080fd5b506040519080825280602002602001820160405280156127aa578160200160208202803683370190505b5090506127b5614205565b6040518060a0016040528084815260200134815260200142815260200186815260200183815250905060175485141561285657600080546040805163ee5dfcf160e01b815260048101849052336024820152604481018a905290516001600160a01b039092169263ee5dfcf19260648084019382900301818387803b15801561283d57600080fd5b505af1158015612851573d6000803e3d6000fd5b505050505b336000908152601160209081526040918290208351815581840151600182015591830151600283015560608301516003830155608083015180518493926128a4926004850192910190614234565b5050336000908152601360205260409020805460ff19166001908117909155600e8054909101905550601954601a546128dc91613c81565b601a556019546128ed903390613cde565b60195460408051338152602081019290925280517f3745f7822014d22354d32c0f4437d13412c14e8207178c5e901f2c8a80069ea59281900390910190a1604080513381526020810185905281517f57d61f3ccd4ccd25ec5d234d6049553a586fac134c85c98d0b0d9d5724f4e43e929181900390910190a15050505050505050565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b1580156129bb57600080fd5b505afa1580156129cf573d6000803e3d6000fd5b505050506040513d60208110156129e557600080fd5b5051612a225760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b60106000600f600081548110612a3457fe5b90600052602060002001548152602001908152602001600020600001544210612aa4576040805162461bcd60e51b815260206004820152601a60248201527f31737420726f756e6420616c726561647920737461727465642e000000000000604482015290519081900360640190fd5b828114612af8576040805162461bcd60e51b815260206004820152601b60248201527f417272617973206c656e67746820697320646966666572656e742e0000000000604482015290519081900360640190fd5b60005b83811015612c07576000838383818110612b1157fe5b9050602002013511612b6a576040805162461bcd60e51b815260206004820181905260248201527f43616e277420736574206d61782070617274696369706174696f6e20746f2030604482015290519081900360640190fd5b600060106000878785818110612b7c57fe5b9050602002013581526020019081526020016000209050838383818110612b9f57fe5b60200291909101356001830155507f240c1dedad1ae51b69a581eb35e4f2e543307e4feffb5f52261f7c9e20baac8b868684818110612bda57fe5b6001850154604080516020938402959095013585529184015280519283900301919050a150600101612afb565b5050505050565b6000806000806060612c1e614205565b6001600160a01b038716600090815260116020908152604091829020825160a08101845281548152600182015481840152600282015481850152600382015460608201526004820180548551818602810186019096528086529194929360808601939290830182828015612cd157602002820191906000526020600020906000905b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411612ca05790505b5050509190925250508151602083015160408401516060850151608090950151929c919b5099509297509550909350505050565b60185481565b60136020526000908152604090205460ff1681565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b158015612d6b57600080fd5b505afa158015612d7f573d6000803e3d6000fd5b505050506040513d6020811015612d9557600080fd5b5051612dd25760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b601554158015612de25750601454155b612deb57600080fd5b8151835114612df957600080fd5b600060165411612e3a5760405162461bcd60e51b81526004018080602001828103825260398152602001806142f36039913960400191505060405180910390fd5b62278d00811115612e92576040805162461bcd60e51b815260206004820152601960248201527f4d6178696d616c20736869667420697320333020646179732e00000000000000604482015290519081900360640190fd5b60188190556000805b8451811015612f28576014858281518110612eb257fe5b602090810291909101810151825460018101845560009384529190922001558351601590859083908110612ee257fe5b602090810291909101810151825460018101845560009384529190922001558351849082908110612f0f57fe5b6020026020010151820191508080600101915050612e9b565b506016548114611c03576040805162461bcd60e51b815260206004820152601b60248201527f50657263656e7420646973747269627574696f6e2069737375652e0000000000604482015290519081900360640190fd5b6004546001600160a01b03163314612fdb576040805162461bcd60e51b815260206004820152601a60248201527913db9b1e54d85b1953dddb995c8e8e8814995cdd1c9a58dd195960321b604482015290519081900360640190fd5b612259613c3b565b606080601460158180548060200260200160405190810160405280929190818152602001828054801561303557602002820191906000526020600020905b815481526020019060010190808311613021575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561308757602002820191906000526020600020905b815481526020019060010190808311613073575b50505050509050915091509091565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b1580156130e157600080fd5b505afa1580156130f5573d6000803e3d6000fd5b505050506040513d602081101561310b57600080fd5b50516131485760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b600354600160a01b900460ff1661315e57600080fd5b600b541561316b57600080fd5b42821015801561317a57508181115b61318357600080fd5b600954811061319157600080fd5b600f54156131d35760106000600f6000815481106131ab57fe5b906000526020600020015481526020019081526020016000206000015481106131d357600080fd5b600b829055600c819055604080518381526020810183905281517faf6e91c17885891414abbe7fa95074976b3e429980b0d8790034468e69650dd9929181900390910190a15050565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b15801561326757600080fd5b505afa15801561327b573d6000803e3d6000fd5b505050506040513d602081101561329157600080fd5b50516132ce5760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b6003544790600090600160a81b900460ff166132ec576008546132ef565b60005b90506112d63361331461330d601a5485613a0290919063ffffffff16565b8590613c81565b613cde565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b15801561336457600080fd5b505afa158015613378573d6000803e3d6000fd5b505050506040513d602081101561338e57600080fd5b50516133cb5760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b60008111613416576040805162461bcd60e51b8152602060048201526013602482015272283934b1b29031b0b7103737ba10313290181760691b604482015290519081900360640190fd5b60058190556040805182815290517f4b59d61d9ffdc3db926d0ce7e06ebabb6bd1bf9dcdae262667e48be3682272169181900360200190a150565b60195434146134915760405162461bcd60e51b815260040180806020018281038252602481526020018061454c6024913960400191505060405180910390fd5b806134dc576040805162461bcd60e51b81526020600482015260166024820152752937bab7321024a21031b0b7103737ba10313290181760511b604482015290519081900360640190fd5b600f54811115613526576040805162461bcd60e51b815260206004820152601060248201526f125b9d985b1a59081c9bdd5b99081a5960821b604482015290519081900360640190fd5b600b54421080159061353a5750600c544211155b61358b576040805162461bcd60e51b815260206004820152601c60248201527f526567697374726174696f6e206761746520697320636c6f7365642e00000000604482015290519081900360640190fd5b61359682338361191f565b6135db576040805162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015290519081900360640190fd5b336000908152601260205260409020541561363d576040805162461bcd60e51b815260206004820152601c60248201527f557365722063616e206e6f742072656769737465722074776963652e00000000604482015290519081900360640190fd5b3360009081526012602052604090208190556017548114156136ca5760008054600954604080516339bc12b360e21b8152600481018590523360248201526044810192909252516001600160a01b039092169263e6f04acc9260648084019382900301818387803b1580156136b157600080fd5b505af11580156136c5573d6000803e3d6000fd5b505050505b600d80546001019055601a546136e09034613a02565b601a55604080513381526020810183905281517fe29d35093005f4d575e1003753426b57a7f64378ba73332eef9c6ccc2b8decd6929181900390910190a15050565b60025460408051630935e01b60e21b815233600482015290516001600160a01b03909216916324d7806c91602480820192602092909190829003018186803b15801561376d57600080fd5b505afa158015613781573d6000803e3d6000fd5b505050506040513d602081101561379757600080fd5b50516137d45760405162461bcd60e51b81526004018080602001828103825260228152602001806144a96022913960400191505060405180910390fd5b60095442101561382b576040805162461bcd60e51b815260206004820152601c60248201527f5265717569726520746861742073616c652068617320656e6465642e00000000604482015290519081900360640190fd5b6000601a541161386c5760405162461bcd60e51b815260040180806020018281038252602381526020018061440e6023913960400191505060405180910390fd5b61387833601a54613cde565b6000601a55565b6014818154811061202c57fe5b6002546000906001600160a01b03166324d7806c6138ad8888888888611075565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156138ea57600080fd5b505afa1580156138fe573d6000803e3d6000fd5b505050506040513d602081101561391457600080fd5b50519695505050505050565b6002546001600160a01b031681565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146139d8576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a6139f686828585613d9f565b93505050505b92915050565b600082820183811015611a00576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082613a6b575060006139fc565b82820282848281613a7857fe5b0414611a005760405162461bcd60e51b81526004018080602001828103825260218152602001806144886021913960400191505060405180910390fd5b6000808211613b0b576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381613b1457fe5b049392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052613b6e908490613f1d565b505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611c03908590613f1d565b600954421015613bdc57600080fd5b600354600160b01b900460ff1615613bf357600080fd5b6003805460ff60b01b1916600160b01b179055600754600654600091613c199190613c81565b90508015613c3857600354613c38906001600160a01b03163383613b1c565b50565b600954421015613c4a57600080fd5b600354600160a81b900460ff1615613c6157600080fd5b6003805460ff60a81b1916600160a81b179055600854613c383382613cde565b600082821115613cd8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b60208310613d2a5780518252601f199092019160209182019101613d0b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613d8c576040519150601f19603f3d011682016040523d82523d6000602084013e613d91565b606091505b5050905080613b6e57600080fd5b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613e005760405162461bcd60e51b815260040180806020018281038252602281526020018061439a6022913960400191505060405180910390fd5b8360ff16601b1480613e1557508360ff16601c145b613e505760405162461bcd60e51b81526004018080602001828103825260228152602001806144316022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015613eac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613f14576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b6060613f72826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613fce9092919063ffffffff16565b805190915015613b6e57808060200190516020811015613f9157600080fd5b5051613b6e5760405162461bcd60e51b815260040180806020018281038252602a815260200180614570602a913960400191505060405180910390fd5b6060613fdd8484600085613fe5565b949350505050565b6060824710156140265760405162461bcd60e51b81526004018080602001828103825260268152602001806143bc6026913960400191505060405180910390fd5b61402f85614141565b614080576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106140bf5780518252601f1990920191602091820191016140a0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114614121576040519150601f19603f3d011682016040523d82523d6000602084013e614126565b606091505b5091509150614136828286614147565b979650505050505050565b3b151590565b60608315614156575081611a00565b8251156141665782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156141b0578181015183820152602001614198565b50505050905090810190601f1680156141dd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b604051806040016040528060008152602001600081525090565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001606081525090565b82805482825590600052602060002090601f016020900481019282156142c95791602002820160005b8382111561429a57835183826101000a81548160ff021916908315150217905550926020019260010160208160000104928301926001030261425d565b80156142c75782816101000a81549060ff021916905560010160208160000104928301926001030261429a565b505b506142d59291506142d9565b5090565b5b808211156142d557805460ff191681556001016142da56fe53616665677561726420666f72206d616b696e6720737572652073657453616c65506172616d73206765742066697273742063616c6c65642e596f752063616e206e6f7420706172746963697061746520696e207468697320726f756e642e496e76616c6964207369676e61747572652e20566572696669636174696f6e206661696c6564736574526f756e64733a20526f756e6473206172652073657420616c72656164792e45434453413a20696e76616c6964207369676e6174757265202773272076616c7565416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c53746172742074696d652063616e206e6f742062652067726561746572207468616e20656e642074696d652e4e6f206561726e696e67732066726f6d20726567697374726174696f6e20666565732e45434453413a20696e76616c6964207369676e6174757265202776272076616c7565546f6b656e7320616c72656164792077697468647261776e206f7220706f7274696f6e206e6f7420756e6c6f636b6564207965742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f6e6c792061646d696e2063616e2063616c6c20746869732066756e6374696f6e2e526567697374726174696f6e20706572696f64206f766572666c6f77732073616c652073746172742e73657453616c65506172616d733a2053616c6520697320616c726561647920637265617465642e4f766572666c6f77696e67206d6178696d616c2070617274696369706174696f6e20666f72207468697320726f756e642e526567697374726174696f6e206465706f73697420646f6573206e6f74206d617463682e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656473657453616c65506172616d733a2053616c65206f776e657220616464726573732063616e206e6f7420626520302e5368696674206d757374206265206e6f6e7a65726f20616e6420736d616c6c6572207468616e206d617856657374696e6754696d6553686966742ea2646970667358221220551fc34b0fb9af730d66c6df1c5b9121d6055786bb8fbf597085b8865f9e624a64736f6c634300060c0033a26469706673582212207024d2cdfec54cd7057db37289620790cea732c7500c764c05c2d40d242f49f664736f6c634300060c003300000000000000000000000068c58e1107bce9be240af941151d42101086af56000000000000000000000000a6a01f4b494243d84cf8030d982d7eeb2aecd329

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

00000000000000000000000068c58e1107bce9be240af941151d42101086af56000000000000000000000000a6a01f4b494243d84cf8030d982d7eeb2aecd329

-----Decoded View---------------
Arg [0] : _adminContract (address): 0x68c58e1107bce9be240af941151d42101086af56
Arg [1] : _allocationStaking (address): 0xa6a01f4b494243d84cf8030d982d7eeb2aecd329

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000068c58e1107bce9be240af941151d42101086af56
Arg [1] : 000000000000000000000000a6a01f4b494243d84cf8030d982d7eeb2aecd329


Deployed ByteCode Sourcemap

55614:2219:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55671:32;;;:::i;:::-;;;;-1:-1:-1;;;;;55671:32:0;;;;;;;;;;;;;;57034:106;;;:::i;:::-;;;;;;;;;;;;;;;;55781:50;;;;;;;;;;;;;;;;-1:-1:-1;55781:50:0;-1:-1:-1;;;;;55781:50:0;;:::i;55958:26::-;;;;;;;;;;;;;;;;-1:-1:-1;55958:26:0;;:::i;56486:184::-;;;;;;;;;;;;;;;;-1:-1:-1;56486:184:0;-1:-1:-1;;;;;56486:184:0;;:::i;:::-;;55838:46;;;;;;;;;;;;;;;;-1:-1:-1;55838:46:0;-1:-1:-1;;;;;55838:46:0;;:::i;57417:411::-;;;;;;;;;;;;;;;;-1:-1:-1;57417:411:0;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55712:60;;;;;;;;;;;;;;;;-1:-1:-1;55712:60:0;-1:-1:-1;;;;;55712:60:0;;:::i;:::-;;;;;;;;;;;;;;;;;;57165:208;;;:::i;56680:294::-;;;:::i;55645:19::-;;;:::i;55671:32::-;;;-1:-1:-1;;;;;55671:32:0;;:::o;57034:106::-;57117:8;:15;57034:106;;:::o;55781:50::-;;;;;;;;;;;;-1:-1:-1;;;;;55781:50:0;;:::o;55958:26::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;55958:26:0;;-1:-1:-1;55958:26:0;:::o;56486:184::-;56174:5;;:25;;;-1:-1:-1;;;56174:25:0;;56188:10;56174:25;;;;;;-1:-1:-1;;;;;56174:5:0;;;;:13;;:25;;;;;;;;;;;;;;;:5;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;56174:25:0;56166:65;;;;;-1:-1:-1;;;56166:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;56580:32:0;::::1;56572:41;;;::::0;::::1;;56624:17;:38:::0;;-1:-1:-1;;;;;;56624:38:0::1;-1:-1:-1::0;;;;;56624:38:0;;;::::1;::::0;;;::::1;::::0;;56486:184::o;55838:46::-;;;;;;;;;;;;-1:-1:-1;;;;;55838:46:0;;:::o;57417:411::-;57493:16;57541:10;57530:8;:21;57522:43;;;;;-1:-1:-1;;;57522:43:0;;;;;;;;;;;;-1:-1:-1;;;57522:43:0;;;;;;;;;;;;;;;57578:22;57628:10;57617:8;:21;57603:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;57603:36:0;-1:-1:-1;57578:61:0;-1:-1:-1;57650:10:0;57690;57677:119;57706:8;57702:1;:12;57677:119;;;57751:8;57760:1;57751:11;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;57751:11:0;57736:5;57742;57736:12;;;;;;;;-1:-1:-1;;;;;57736:26:0;;;:12;;;;;;;;;;;:26;57777:7;;;;;57716:3;57677:119;;;-1:-1:-1;57815:5:0;;57417:411;-1:-1:-1;;;;57417:411:0:o;55712:60::-;;;;;;;;;;;;;;;:::o;57165:208::-;57254:8;:15;57219:7;;57254:19;57251:87;;57297:8;57306:15;;-1:-1:-1;;57306:19:0;;;57297:29;;;;;;;;;;;;;;;;-1:-1:-1;;;;;57297:29:0;;-1:-1:-1;57290:36:0;;57251:87;-1:-1:-1;57363:1:0;57165:208;:::o;56680:294::-;56174:5;;:25;;;-1:-1:-1;;;56174:25:0;;56188:10;56174:25;;;;;;-1:-1:-1;;;;;56174:5:0;;;;:13;;:25;;;;;;;;;;;;;;;:5;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;56174:25:0;56166:65;;;;;-1:-1:-1;;;56166:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;56747:18:::1;56794:5:::0;;;56802:17;56768:52:::1;::::0;-1:-1:-1;;;;;56794:5:0;;::::1;::::0;56802:17;;::::1;::::0;56768:52:::1;::::0;::::1;:::i;:::-;-1:-1:-1::0;;;;;56768:52:0;;::::1;::::0;;;::::1;;::::0;::::1;::::0;;;;;;;;;;-1:-1:-1;56768:52:0::1;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;;;;;56833:42:0;::::1;;::::0;;;:27:::1;:42;::::0;;;;;;;:49;;-1:-1:-1;;56833:49:0::1;56878:4;56833:49:::0;;::::1;::::0;;;56893:8:::1;:28:::0;;;;::::1;::::0;;;;;;;;::::1;::::0;;-1:-1:-1;;;;;;56893:28:0::1;::::0;::::1;::::0;;56939:27;;;;;;;56747:73;;-1:-1:-1;56939:27:0::1;::::0;;;;;;;::::1;56242:1;56680:294::o:0;55645:19::-;;;-1:-1:-1;;;;;55645:19:0;;:::o;-1:-1:-1:-;;;;;;;;:::o

Swarm Source

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