Contract 0xAc3e6058C55CA81C229f25162226f0a0e6581917 6

 
Txn Hash Method
Block
From
To
Value
0x5898790e51112e75314e818710a35a9d30e03bac5cb82ee4ece38367e307dd2fTransfer Ownersh...1061066332023-06-26 20:40:43240 days 11 mins agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000179439590.000000065
0xb19ec7278636b43b6e7c1055f1a29f5d47308f28572a41a1a00c48477bfeeffaTransfer Control1061065872023-06-26 20:39:11240 days 13 mins agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000182648920.000000069
0x603af92333889b827911d58e905f8d23695db507aa240341e303502ff9fa0437Set Whitelist1061064732023-06-26 20:35:23240 days 17 mins agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000211554250.00000007
0x57b8664881892fcf5764b1e7043f06feab00567bac1151d079addff901f3d6e5Set Whitelist1056454872023-06-16 4:29:11250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000252318020.000001064
0xfe73765af1239ba79242a27fbaf1a26b2955f5e4bead4e28c64a0340ca2aa2d5Set Whitelist1056454502023-06-16 4:27:57250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000251830530.00000107
0x6c44ca9999b433d23ff8550d20f1bd61148bc90368732e7e75f9eec9748bb024Set Whitelist1056453332023-06-16 4:24:03250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000288498430.000001064
0x94cdf345b0d6386fcb77717a73f99805ad80d81915b9a3ac7f2ed31f34a9ba1eSet Whitelist1056452882023-06-16 4:22:33250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000257665530.000001066
0xb77213303372bb816cb9a585739a2fa79fd596ad095ea88a0e414a561a405681Set Whitelist1056452292023-06-16 4:20:35250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000280847780.000001064
0x2e2a73062aa8be2d894fd7878d6cbd3436c9ad962d2bcd02b0959224717001b2Set Whitelist1056451802023-06-16 4:18:57250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000312439640.000001069
0x422fcc14c2b6253510d29ae184a40e4b65ab9937580ab8b3cc3acc19abd5eeffSet Whitelist1056450292023-06-16 4:13:55250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000252218180.000001068
0x32a5194752e929d1242632aaa55d183ad7d7eae4f2c1674b45582fa48eaaf331Set Whitelist1056449522023-06-16 4:11:21250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000263020490.000001056
0x93c2a1e56186f2cd60959682abb6ae266b490d43043ff4e8cc4baab58e6b8f1fSet Whitelist1056448752023-06-16 4:08:47250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000264747980.000001055
0xfca7c5b22e26c925c2ea2cb713592d38e63d6cfd7ca94b6885cddd717543ab8eSet Whitelist1056445652023-06-16 3:58:27250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000236244950.000001058
0xc3cb6d681a74d37c529e8c4d17955d2a191317c1cb2c84488e2aabc20df08acaSet Whitelist1056444962023-06-16 3:56:09250 days 16 hrs agoGYSR: Deployer IN  0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH0.0000239433360.000001057
0x70f3a878b35c3692ceacf4feca9e3ceace9bcda96863930bc4d77e1a755e4a280x60c060401056434692023-06-16 3:21:55250 days 17 hrs agoGYSR: Deployer IN  Create: PoolFactory0 ETH0.0018563419330.000000064
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x131821c786dea64e42f1d8ed9698578414db9f7bec0bf28206996ec7f16556731062352832023-06-29 20:09:03237 days 43 mins ago 0x462cc7ea60a364410fef8c621b73a1f1c78de513 0xac3e6058c55ca81c229f25162226f0a0e65819170 ETH
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
PoolFactory

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion
File 1 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

File 2 of 16 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 3 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

File 4 of 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

File 5 of 16 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 6 of 16 : IConfiguration.sol
/*
IConfiguration

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

/**
 * @title Configuration interface
 *
 * @notice this defines the protocol configuration interface
 */
interface IConfiguration {
    // events
    event ParameterUpdated(bytes32 indexed key, address value);
    event ParameterUpdated(bytes32 indexed key, uint256 value);
    event ParameterUpdated(bytes32 indexed key, address value0, uint96 value1);
    event ParameterOverridden(
        address indexed caller,
        bytes32 indexed key,
        address value
    );
    event ParameterOverridden(
        address indexed caller,
        bytes32 indexed key,
        uint256 value
    );
    event ParameterOverridden(
        address indexed caller,
        bytes32 indexed key,
        address value0,
        uint96 value1
    );

    /**
     * @notice set or update uint256 parameter
     * @param key keccak256 hash of parameter key
     * @param value uint256 parameter value
     */
    function setUint256(bytes32 key, uint256 value) external;

    /**
     * @notice set or update address parameter
     * @param key keccak256 hash of parameter key
     * @param value address parameter value
     */
    function setAddress(bytes32 key, address value) external;

    /**
     * @notice set or update packed address + uint96 pair
     * @param key keccak256 hash of parameter key
     * @param value0 address parameter value
     * @param value1 uint96 parameter value
     */
    function setAddressUint96(
        bytes32 key,
        address value0,
        uint96 value1
    ) external;

    /**
     * @notice get uint256 parameter
     * @param key keccak256 hash of parameter key
     * @return uint256 parameter value
     */
    function getUint256(bytes32 key) external view returns (uint256);

    /**
     * @notice get address parameter
     * @param key keccak256 hash of parameter key
     * @return uint256 parameter value
     */
    function getAddress(bytes32 key) external view returns (address);

    /**
     * @notice get packed address + uint96 pair
     * @param key keccak256 hash of parameter key
     * @return address parameter value
     * @return uint96 parameter value
     */
    function getAddressUint96(
        bytes32 key
    ) external view returns (address, uint96);

    /**
     * @notice override uint256 parameter for specific caller
     * @param caller address of caller
     * @param key keccak256 hash of parameter key
     * @param value uint256 parameter value
     */
    function overrideUint256(
        address caller,
        bytes32 key,
        uint256 value
    ) external;

    /**
     * @notice override address parameter for specific caller
     * @param caller address of caller
     * @param key keccak256 hash of parameter key
     * @param value address parameter value
     */
    function overrideAddress(
        address caller,
        bytes32 key,
        address value
    ) external;

    /**
     * @notice override address parameter for specific caller
     * @param caller address of caller
     * @param key keccak256 hash of parameter key
     * @param value0 address parameter value
     * @param value1 uint96 parameter value
     */
    function overrideAddressUint96(
        address caller,
        bytes32 key,
        address value0,
        uint96 value1
    ) external;
}

File 7 of 16 : IEvents.sol
/*
IEvents

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
 */

pragma solidity 0.8.18;

/**
 * @title GYSR event system
 *
 * @notice common interface to define GYSR event system
 */
interface IEvents {
    // staking
    event Staked(
        bytes32 indexed account,
        address indexed user,
        address indexed token,
        uint256 amount,
        uint256 shares
    );
    event Unstaked(
        bytes32 indexed account,
        address indexed user,
        address indexed token,
        uint256 amount,
        uint256 shares
    );
    event Claimed(
        bytes32 indexed account,
        address indexed user,
        address indexed token,
        uint256 amount,
        uint256 shares
    );
    event Updated(bytes32 indexed account, address indexed user);

    // rewards
    event RewardsDistributed(
        address indexed user,
        address indexed token,
        uint256 amount,
        uint256 shares
    );
    event RewardsFunded(
        address indexed token,
        uint256 amount,
        uint256 shares,
        uint256 timestamp
    );
    event RewardsExpired(
        address indexed token,
        uint256 amount,
        uint256 shares,
        uint256 timestamp
    );
    event RewardsWithdrawn(
        address indexed token,
        uint256 amount,
        uint256 shares,
        uint256 timestamp
    );
    event RewardsUpdated(bytes32 indexed account);

    // gysr
    event GysrSpent(address indexed user, uint256 amount);
    event GysrVested(address indexed user, uint256 amount);
    event GysrWithdrawn(uint256 amount);
    event Fee(address indexed receiver, address indexed token, uint256 amount);
}

File 8 of 16 : IModuleFactory.sol
/*
IModuleFactory

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

/**
 * @title Module factory interface
 *
 * @notice this defines the common module factory interface used by the
 * main factory to create the staking and reward modules for a new Pool.
 */
interface IModuleFactory {
    // events
    event ModuleCreated(address indexed user, address module);

    /**
     * @notice create a new Pool module
     * @param config address for configuration contract
     * @param data binary encoded construction parameters
     * @return address of newly created module
     */
    function createModule(address config, bytes calldata data)
        external
        returns (address);
}

File 9 of 16 : IOwnerController.sol
/*
IOwnerController

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

/**
 * @title Owner controller interface
 *
 * @notice this defines the interface for any contracts that use the
 * owner controller access pattern
 */
interface IOwnerController {
    /**
     * @dev Returns the address of the current owner.
     */
    function owner() external view returns (address);

    /**
     * @dev Returns the address of the current controller.
     */
    function controller() external view returns (address);

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`). This can
     * include renouncing ownership by transferring to the zero address.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) external;

    /**
     * @dev Transfers control of the contract to a new account (`newController`).
     * Can only be called by the owner.
     */
    function transferControl(address newController) external;
}

File 10 of 16 : IPool.sol
/*
IPool

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

/**
 * @title Pool interface
 *
 * @notice this defines the core Pool contract interface
 */
interface IPool {
    /**
     * @return staking tokens for Pool
     */
    function stakingTokens() external view returns (address[] memory);

    /**
     * @return reward tokens for Pool
     */
    function rewardTokens() external view returns (address[] memory);

    /**
     * @return staking balances for user
     */
    function stakingBalances(
        address user
    ) external view returns (uint256[] memory);

    /**
     * @return total staking balances for Pool
     */
    function stakingTotals() external view returns (uint256[] memory);

    /**
     * @return reward balances for Pool
     */
    function rewardBalances() external view returns (uint256[] memory);

    /**
     * @return GYSR usage ratio for Pool
     */
    function usage() external view returns (uint256);

    /**
     * @return address of staking module
     */
    function stakingModule() external view returns (address);

    /**
     * @return address of reward module
     */
    function rewardModule() external view returns (address);

    /**
     * @notice stake asset and begin earning rewards
     * @param amount number of tokens to stake
     * @param stakingdata data passed to staking module
     * @param rewarddata data passed to reward module
     */
    function stake(
        uint256 amount,
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external;

    /**
     * @notice unstake asset and claim rewards
     * @param amount number of tokens to unstake
     * @param stakingdata data passed to staking module
     * @param rewarddata data passed to reward module
     */
    function unstake(
        uint256 amount,
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external;

    /**
     * @notice claim rewards without unstaking
     * @param amount number of tokens to claim against
     * @param stakingdata data passed to staking module
     * @param rewarddata data passed to reward module
     */
    function claim(
        uint256 amount,
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external;

    /**
     * @notice method called ad hoc to update user accounting
     * @param stakingdata data passed to staking module
     * @param rewarddata data passed to reward module
     */
    function update(
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external;

    /**
     * @notice method called ad hoc to clean up and perform additional accounting
     * @param stakingdata data passed to staking module
     * @param rewarddata data passed to reward module
     */
    function clean(
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external;

    /**
     * @return gysr balance available for withdrawal
     */
    function gysrBalance() external view returns (uint256);

    /**
     * @notice withdraw GYSR tokens applied during unstaking
     * @param amount number of GYSR to withdraw
     */
    function withdraw(uint256 amount) external;

    /**
     * @notice transfer control of the staking module to another account
     * @param newController address of new controller
     */
    function transferControlStakingModule(address newController) external;

    /**
     * @notice transfer control of the reward module to another account
     * @param newController address of new controller
     */
    function transferControlRewardModule(address newController) external;

    /**
     * @notice execute multiple operations in a single call
     * @param data array of encoded function data
     */
    function multicall(
        bytes[] calldata data
    ) external returns (bytes[] memory results);
}

File 11 of 16 : IPoolFactory.sol
/*
IPoolFactory

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

/**
 * @title Pool factory interface
 *
 * @notice this defines the Pool factory interface, primarily intended for
 * the Pool contract to interact with
 */
interface IPoolFactory {
    /**
     * @notice create a new Pool
     * @param staking address of factory that will be used to create staking module
     * @param reward address of factory that will be used to create reward module
     * @param stakingdata construction data for staking module factory
     * @param rewarddata construction data for reward module factory
     * @return address of newly created Pool
     */
    function create(
        address staking,
        address reward,
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external returns (address);

    /**
     * @return true if address is a pool created by the factory
     */
    function map(address) external view returns (bool);

    /**
     * @return address of the nth pool created by the factory
     */
    function list(uint256) external view returns (address);
}

File 12 of 16 : IRewardModule.sol
/*
IRewardModule

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

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

import "./IEvents.sol";
import "./IOwnerController.sol";

/**
 * @title Reward module interface
 *
 * @notice this contract defines the common interface that any reward module
 * must implement to be compatible with the modular Pool architecture.
 */
interface IRewardModule is IOwnerController, IEvents {
    /**
     * @return array of reward tokens
     */
    function tokens() external view returns (address[] memory);

    /**
     * @return array of reward token balances
     */
    function balances() external view returns (uint256[] memory);

    /**
     * @return GYSR usage ratio for reward module
     */
    function usage() external view returns (uint256);

    /**
     * @return address of module factory
     */
    function factory() external view returns (address);

    /**
     * @notice perform any necessary accounting for new stake
     * @param account bytes32 id of staking account
     * @param sender address of sender
     * @param shares number of new shares minted
     * @param data addtional data
     * @return amount of gysr spent
     * @return amount of gysr vested
     */
    function stake(
        bytes32 account,
        address sender,
        uint256 shares,
        bytes calldata data
    ) external returns (uint256, uint256);

    /**
     * @notice reward user and perform any necessary accounting for unstake
     * @param account bytes32 id of staking account
     * @param sender address of sender
     * @param receiver address of reward receiver
     * @param shares number of shares burned
     * @param data additional data
     * @return amount of gysr spent
     * @return amount of gysr vested
     */
    function unstake(
        bytes32 account,
        address sender,
        address receiver,
        uint256 shares,
        bytes calldata data
    ) external returns (uint256, uint256);

    /**
     * @notice reward user and perform and necessary accounting for existing stake
     * @param account bytes32 id of staking account
     * @param sender address of sender
     * @param receiver address of reward receiver
     * @param shares number of shares being claimed against
     * @param data additional data
     * @return amount of gysr spent
     * @return amount of gysr vested
     */
    function claim(
        bytes32 account,
        address sender,
        address receiver,
        uint256 shares,
        bytes calldata data
    ) external returns (uint256, uint256);

    /**
     * @notice method called by anyone to update accounting
     * @dev will only be called ad hoc and should not contain essential logic
     * @param account bytes32 id of staking account for update
     * @param sender address of sender
     * @param data additional data
     */
    function update(
        bytes32 account,
        address sender,
        bytes calldata data
    ) external;

    /**
     * @notice method called by owner to clean up and perform additional accounting
     * @dev will only be called ad hoc and should not contain any essential logic
     * @param data additional data
     */
    function clean(bytes calldata data) external;
}

File 13 of 16 : IStakingModule.sol
/*
IStakingModule

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

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

import "./IEvents.sol";
import "./IOwnerController.sol";

/**
 * @title Staking module interface
 *
 * @notice this contract defines the common interface that any staking module
 * must implement to be compatible with the modular Pool architecture.
 */
interface IStakingModule is IOwnerController, IEvents {
    /**
     * @return array of staking tokens
     */
    function tokens() external view returns (address[] memory);

    /**
     * @notice get balance of user
     * @param user address of user
     * @return balances of each staking token
     */
    function balances(address user) external view returns (uint256[] memory);

    /**
     * @return address of module factory
     */
    function factory() external view returns (address);

    /**
     * @notice get total staked amount
     * @return totals for each staking token
     */
    function totals() external view returns (uint256[] memory);

    /**
     * @notice stake an amount of tokens for user
     * @param sender address of sender
     * @param amount number of tokens to stake
     * @param data additional data
     * @return bytes32 id of staking account
     * @return number of shares minted for stake
     */
    function stake(
        address sender,
        uint256 amount,
        bytes calldata data
    ) external returns (bytes32, uint256);

    /**
     * @notice unstake an amount of tokens for user
     * @param sender address of sender
     * @param amount number of tokens to unstake
     * @param data additional data
     * @return bytes32 id of staking account
     * @return address of reward receiver
     * @return number of shares burned for unstake
     */
    function unstake(
        address sender,
        uint256 amount,
        bytes calldata data
    ) external returns (bytes32, address, uint256);

    /**
     * @notice quote the share value for an amount of tokens without unstaking
     * @param sender address of sender
     * @param amount number of tokens to claim with
     * @param data additional data
     * @return bytes32 id of staking account
     * @return address of reward receiver
     * @return number of shares that the claim amount is worth
     */
    function claim(
        address sender,
        uint256 amount,
        bytes calldata data
    ) external returns (bytes32, address, uint256);

    /**
     * @notice method called by anyone to update accounting
     * @dev will only be called ad hoc and should not contain essential logic
     * @param sender address of user for update
     * @param data additional data
     * @return bytes32 id of staking account
     */
    function update(
        address sender,
        bytes calldata data
    ) external returns (bytes32);

    /**
     * @notice method called by owner to clean up and perform additional accounting
     * @dev will only be called ad hoc and should not contain any essential logic
     * @param data additional data
     */
    function clean(bytes calldata data) external;
}

File 14 of 16 : OwnerController.sol
/*
OwnerController

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

import "./interfaces/IOwnerController.sol";

/**
 * @title Owner controller
 *
 * @notice this base contract implements an owner-controller access model.
 *
 * @dev the contract is an adapted version of the OpenZeppelin Ownable contract.
 * It allows the owner to designate an additional account as the controller to
 * perform restricted operations.
 *
 * Other changes include supporting role verification with a require method
 * in addition to the modifier option, and removing some unneeded functionality.
 *
 * Original contract here:
 * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
 */
contract OwnerController is IOwnerController {
    address private _owner;
    address private _controller;

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

    event ControlTransferred(
        address indexed previousController,
        address indexed newController
    );

    constructor() {
        _owner = msg.sender;
        _controller = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
        emit ControlTransferred(address(0), _owner);
    }

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

    /**
     * @dev Returns the address of the current controller.
     */
    function controller() public view override returns (address) {
        return _controller;
    }

    /**
     * @dev Modifier that throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == msg.sender, "oc1");
        _;
    }

    /**
     * @dev Modifier that throws if called by any account other than the controller.
     */
    modifier onlyController() {
        require(_controller == msg.sender, "oc2");
        _;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    function requireOwner() internal view {
        require(_owner == msg.sender, "oc1");
    }

    /**
     * @dev Throws if called by any account other than the controller.
     */
    function requireController() internal view {
        require(_controller == msg.sender, "oc2");
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override {
        requireOwner();
        require(newOwner != address(0), "oc3");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }

    /**
     * @dev Transfers control of the contract to a new account (`newController`).
     * Can only be called by the owner.
     */
    function transferControl(address newController) public virtual override {
        requireOwner();
        require(newController != address(0), "oc4");
        emit ControlTransferred(_controller, newController);
        _controller = newController;
    }
}

File 15 of 16 : Pool.sol
/*
Pool

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import "./interfaces/IPool.sol";
import "./interfaces/IConfiguration.sol";
import "./interfaces/IStakingModule.sol";
import "./interfaces/IRewardModule.sol";
import "./interfaces/IEvents.sol";
import "./OwnerController.sol";

/**
 * @title Pool
 *
 * @notice this implements the GYSR core Pool contract. It supports generalized
 * incentive mechanisms through a modular architecture, where
 * staking and reward logic is contained in child contracts.
 */
contract Pool is IPool, IEvents, ReentrancyGuard, OwnerController {
    using SafeERC20 for IERC20;

    // modules
    IStakingModule private immutable _staking;
    IRewardModule private immutable _reward;

    // gysr fields
    IERC20 private immutable _gysr;
    IConfiguration private immutable _config;
    uint256 private _gysrVested;

    /**
     * @param staking_ the staking module address
     * @param reward_ the reward module address
     * @param gysr_ address for GYSR token
     * @param config_ address for configuration contract
     */
    constructor(
        address staking_,
        address reward_,
        address gysr_,
        address config_
    ) {
        _staking = IStakingModule(staking_);
        _reward = IRewardModule(reward_);
        _gysr = IERC20(gysr_);
        _config = IConfiguration(config_);
    }

    // -- IPool --------------------------------------------------------------

    /**
     * @inheritdoc IPool
     */
    function stakingTokens() external view override returns (address[] memory) {
        return _staking.tokens();
    }

    /**
     * @inheritdoc IPool
     */
    function rewardTokens() external view override returns (address[] memory) {
        return _reward.tokens();
    }

    /**
     * @inheritdoc IPool
     */
    function stakingBalances(
        address user
    ) external view override returns (uint256[] memory) {
        return _staking.balances(user);
    }

    /**
     * @inheritdoc IPool
     */
    function stakingTotals() external view override returns (uint256[] memory) {
        return _staking.totals();
    }

    /**
     * @inheritdoc IPool
     */
    function rewardBalances()
        external
        view
        override
        returns (uint256[] memory)
    {
        return _reward.balances();
    }

    /**
     * @inheritdoc IPool
     */
    function usage() external view override returns (uint256) {
        return _reward.usage();
    }

    /**
     * @inheritdoc IPool
     */
    function stakingModule() external view override returns (address) {
        return address(_staking);
    }

    /**
     * @inheritdoc IPool
     */
    function rewardModule() external view override returns (address) {
        return address(_reward);
    }

    /**
     * @inheritdoc IPool
     */
    function stake(
        uint256 amount,
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external override nonReentrant {
        (bytes32 account, uint256 shares) = _staking.stake(
            msg.sender,
            amount,
            stakingdata
        );
        (uint256 spent, uint256 vested) = _reward.stake(
            account,
            msg.sender,
            shares,
            rewarddata
        );
        _processGysr(spent, vested);
    }

    /**
     * @inheritdoc IPool
     */
    function unstake(
        uint256 amount,
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external override nonReentrant {
        (bytes32 account, address receiver, uint256 shares) = _staking.unstake(
            msg.sender,
            amount,
            stakingdata
        );
        (uint256 spent, uint256 vested) = _reward.unstake(
            account,
            msg.sender,
            receiver,
            shares,
            rewarddata
        );
        _processGysr(spent, vested);
    }

    /**
     * @inheritdoc IPool
     */
    function claim(
        uint256 amount,
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external override nonReentrant {
        (bytes32 account, address receiver, uint256 shares) = _staking.claim(
            msg.sender,
            amount,
            stakingdata
        );
        (uint256 spent, uint256 vested) = _reward.claim(
            account,
            msg.sender,
            receiver,
            shares,
            rewarddata
        );
        _processGysr(spent, vested);
    }

    /**
     * @inheritdoc IPool
     */
    function update(
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external override nonReentrant {
        bytes32 account = _staking.update(msg.sender, stakingdata);
        _reward.update(account, msg.sender, rewarddata);
    }

    /**
     * @inheritdoc IPool
     */
    function clean(
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external override nonReentrant {
        requireController();
        _staking.clean(stakingdata);
        _reward.clean(rewarddata);
    }

    /**
     * @inheritdoc IPool
     */
    function gysrBalance() external view override returns (uint256) {
        return _gysrVested;
    }

    /**
     * @inheritdoc IPool
     */
    function withdraw(uint256 amount) external override {
        requireController();
        require(amount > 0, "p1");
        require(amount <= _gysrVested, "p2");

        // do transfer
        _gysr.safeTransfer(msg.sender, amount);

        _gysrVested = _gysrVested - amount;

        emit GysrWithdrawn(amount);
    }

    /**
     * @inheritdoc IPool
     */
    function transferControlStakingModule(
        address newController
    ) external override {
        requireOwner();
        _staking.transferControl(newController);
    }

    /**
     * @inheritdoc IPool
     */
    function transferControlRewardModule(
        address newController
    ) external override {
        requireOwner();
        _reward.transferControl(newController);
    }

    /**
     * @inheritdoc IPool
     */
    function multicall(
        bytes[] calldata data
    ) external override returns (bytes[] memory results) {
        // h/t https://github.com/Uniswap/v3-periphery/blob/main/contracts/base/Multicall.sol
        results = new bytes[](data.length);
        for (uint256 i; i < data.length; ++i) {
            (bool success, bytes memory result) = address(this).delegatecall(
                data[i]
            );
            if (!success) {
                // h/t https://ethereum.stackexchange.com/a/83577
                if (result.length < 68) revert();
                assembly {
                    result := add(result, 0x04)
                }
                revert(abi.decode(result, (string)));
            }
            results[i] = result;
        }
    }

    // -- Pool internal -----------------------------------------------------

    /**
     * @dev private method to process GYSR spending and vesting
     * @param spent number of tokens spent by user
     * @param vested number of tokens vested
     */
    function _processGysr(uint256 spent, uint256 vested) private {
        // spending
        if (spent > 0) {
            _gysr.safeTransferFrom(msg.sender, address(this), spent);
        }

        // vesting
        if (vested > 0) {
            (address receiver, uint256 rate) = _config.getAddressUint96(
                keccak256("gysr.core.pool.spend.fee")
            );

            // fallback to zero fee on bad configuration
            uint256 fee;
            if (rate > 0 && rate <= 1e18 && receiver != address(0)) {
                fee = (vested * rate) / 1e18;
                _gysr.safeTransfer(receiver, fee);
                emit Fee(receiver, address(_gysr), fee);
            }
            _gysrVested = _gysrVested + vested - fee;
        }
    }
}

File 16 of 16 : PoolFactory.sol
/*
PoolFactory

https://github.com/gysr-io/core

SPDX-License-Identifier: MIT
*/

pragma solidity 0.8.18;

import "./interfaces/IPoolFactory.sol";
import "./interfaces/IModuleFactory.sol";
import "./interfaces/IStakingModule.sol";
import "./interfaces/IRewardModule.sol";
import "./OwnerController.sol";
import "./Pool.sol";

/**
 * @title Pool factory
 *
 * @notice this implements the Pool factory contract which allows any user to
 * easily configure and deploy their own Pool
 *
 * @dev it relies on a system of sub-factories which are responsible for the
 * creation of underlying staking and reward modules. This primary factory
 * calls each module factory and assembles the overall Pool contract.
 *
 * this contract also manages the module factory whitelist.
 */
contract PoolFactory is IPoolFactory, OwnerController {
    // events
    event PoolCreated(address indexed user, address pool);
    event WhitelistUpdated(
        address indexed factory,
        uint256 previous,
        uint256 updated
    );

    // types
    enum ModuleFactoryType {
        Unknown,
        Staking,
        Reward
    }

    // fields
    mapping(address => bool) public override map;
    address[] public override list;
    address private immutable _gysr;
    address private immutable _config;
    mapping(address => ModuleFactoryType) public whitelist;

    /**
     * @param gysr_ address of GYSR token
     * @param config_ address of configuration contract
     */
    constructor(address gysr_, address config_) {
        _gysr = gysr_;
        _config = config_;
    }

    /**
     * @inheritdoc IPoolFactory
     */
    function create(
        address staking,
        address reward,
        bytes calldata stakingdata,
        bytes calldata rewarddata
    ) external override returns (address) {
        // validate
        require(whitelist[staking] == ModuleFactoryType.Staking, "f1");
        require(whitelist[reward] == ModuleFactoryType.Reward, "f2");

        // create modules
        address stakingModule = IModuleFactory(staking).createModule(
            _config,
            stakingdata
        );
        address rewardModule = IModuleFactory(reward).createModule(
            _config,
            rewarddata
        );

        // create pool
        Pool pool = new Pool(stakingModule, rewardModule, _gysr, _config);

        // set access
        IStakingModule(stakingModule).transferOwnership(address(pool));
        IRewardModule(rewardModule).transferOwnership(address(pool));
        pool.transferControl(msg.sender);
        pool.transferControlStakingModule(msg.sender);
        pool.transferControlRewardModule(msg.sender);
        pool.transferOwnership(msg.sender);

        // bookkeeping
        map[address(pool)] = true;
        list.push(address(pool));

        // output
        emit PoolCreated(msg.sender, address(pool));
        return address(pool);
    }

    /**
     * @notice set the whitelist status of a module factory
     * @param factory_ address of module factory
     * @param type_ updated whitelist status for module
     */
    function setWhitelist(address factory_, uint256 type_) external {
        requireController();
        require(type_ <= uint256(ModuleFactoryType.Reward), "f4");
        require(factory_ != address(0), "f5");
        emit WhitelistUpdated(factory_, uint256(whitelist[factory_]), type_);
        whitelist[factory_] = ModuleFactoryType(type_);
    }

    /**
     * @return total number of Pools created by the factory
     */
    function count() public view returns (uint256) {
        return list.length;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"gysr_","type":"address"},{"internalType":"address","name":"config_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousController","type":"address"},{"indexed":true,"internalType":"address","name":"newController","type":"address"}],"name":"ControlTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"factory","type":"address"},{"indexed":false,"internalType":"uint256","name":"previous","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"updated","type":"uint256"}],"name":"WhitelistUpdated","type":"event"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staking","type":"address"},{"internalType":"address","name":"reward","type":"address"},{"internalType":"bytes","name":"stakingdata","type":"bytes"},{"internalType":"bytes","name":"rewarddata","type":"bytes"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"list","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"map","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory_","type":"address"},{"internalType":"uint256","name":"type_","type":"uint256"}],"name":"setWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newController","type":"address"}],"name":"transferControl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"enum PoolFactory.ModuleFactoryType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]

60c060405234801561001057600080fd5b506040516136e23803806136e283398101604081905261002f916100e7565b60008054336001600160a01b0319918216811783556001805490921681179091556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600080546040516001600160a01b0390911691907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a36001600160a01b039182166080521660a05261011a565b80516001600160a01b03811681146100e257600080fd5b919050565b600080604083850312156100fa57600080fd5b610103836100cb565b9150610111602084016100cb565b90509250929050565b60805160a05161359561014d600039600081816106bd0152818161074e01526107f9015260006107d801526135956000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80639b19251a11610076578063bf14752a1161005b578063bf14752a146101ba578063f2fde38b146101cd578063f77c4791146101e057600080fd5b80639b19251a14610157578063b721ef6e1461018757600080fd5b80636d16fa41116100a75780636d16fa41146100ee57806380c9419e146101015780638da5cb5b1461013957600080fd5b806306661abd146100c35780631302d03a146100d9575b600080fd5b6003546040519081526020015b60405180910390f35b6100ec6100e7366004610eab565b6101fe565b005b6100ec6100fc366004610ed7565b6103de565b61011461010f366004610efb565b6104f1565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100d0565b60005473ffffffffffffffffffffffffffffffffffffffff16610114565b61017a610165366004610ed7565b60046020526000908152604090205460ff1681565b6040516100d09190610f43565b6101aa610195366004610ed7565b60026020526000908152604090205460ff1681565b60405190151581526020016100d0565b6101146101c8366004610fcd565b610528565b6100ec6101db366004610ed7565b610c63565b60015473ffffffffffffffffffffffffffffffffffffffff16610114565b610206610d75565b6002811115610276576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f663400000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166102f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f6635000000000000000000000000000000000000000000000000000000000000604482015260640161026d565b73ffffffffffffffffffffffffffffffffffffffff82166000818152600460205260409020547f1f9a093b2e93f445118693693f1e05c8435a7c6081c00b7086c5aaf5ddbf95979060ff16600281111561034f5761034f610f14565b60408051918252602082018590520160405180910390a280600281111561037857610378610f14565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360028111156103d5576103d5610f14565b02179055505050565b6103e6610df8565b73ffffffffffffffffffffffffffffffffffffffff8116610463576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f6f63340000000000000000000000000000000000000000000000000000000000604482015260640161026d565b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6003818154811061050157600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000600173ffffffffffffffffffffffffffffffffffffffff881660009081526004602052604090205460ff16600281111561056657610566610f14565b146105cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f6631000000000000000000000000000000000000000000000000000000000000604482015260640161026d565b600273ffffffffffffffffffffffffffffffffffffffff871660009081526004602052604090205460ff16600281111561060957610609610f14565b14610670576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f6632000000000000000000000000000000000000000000000000000000000000604482015260640161026d565b6040517f20868d1800000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8916906320868d18906106e9907f0000000000000000000000000000000000000000000000000000000000000000908a908a90600401611062565b6020604051808303816000875af1158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c91906110cc565b905060008773ffffffffffffffffffffffffffffffffffffffff166320868d187f000000000000000000000000000000000000000000000000000000000000000087876040518463ffffffff1660e01b815260040161078d93929190611062565b6020604051808303816000875af11580156107ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d091906110cc565b9050600082827f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000060405161082490610e79565b73ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015290831660408301529091166060820152608001604051809103906000f080158015610875573d6000803e3d6000fd5b506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156108e357600080fd5b505af11580156108f7573d6000803e3d6000fd5b50506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528516925063f2fde38b9150602401600060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b50506040517f6d16fa4100000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff84169250636d16fa419150602401600060405180830381600087803b1580156109e357600080fd5b505af11580156109f7573d6000803e3d6000fd5b50506040517f0b2ab78800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff84169250630b2ab7889150602401600060405180830381600087803b158015610a6257600080fd5b505af1158015610a76573d6000803e3d6000fd5b50506040517f39f95f8100000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff841692506339f95f819150602401600060405180830381600087803b158015610ae157600080fd5b505af1158015610af5573d6000803e3d6000fd5b50506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8416925063f2fde38b9150602401600060405180830381600087803b158015610b6057600080fd5b505af1158015610b74573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff8116600081815260026020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091556003805491820181559093527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055905191825233917f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d4896910160405180910390a29998505050505050505050565b610c6b610df8565b73ffffffffffffffffffffffffffffffffffffffff8116610ce8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f6f63330000000000000000000000000000000000000000000000000000000000604482015260640161026d565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f6f63320000000000000000000000000000000000000000000000000000000000604482015260640161026d565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f6f63310000000000000000000000000000000000000000000000000000000000604482015260640161026d565b612476806110ea83390190565b73ffffffffffffffffffffffffffffffffffffffff81168114610ea857600080fd5b50565b60008060408385031215610ebe57600080fd5b8235610ec981610e86565b946020939093013593505050565b600060208284031215610ee957600080fd5b8135610ef481610e86565b9392505050565b600060208284031215610f0d57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160038310610f7e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b60008083601f840112610f9657600080fd5b50813567ffffffffffffffff811115610fae57600080fd5b602083019150836020828501011115610fc657600080fd5b9250929050565b60008060008060008060808789031215610fe657600080fd5b8635610ff181610e86565b9550602087013561100181610e86565b9450604087013567ffffffffffffffff8082111561101e57600080fd5b61102a8a838b01610f84565b9096509450606089013591508082111561104357600080fd5b5061105089828a01610f84565b979a9699509497509295939492505050565b73ffffffffffffffffffffffffffffffffffffffff8416815260406020820152816040820152818360608301376000818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b6000602082840312156110de57600080fd5b8151610ef481610e8656fe6101006040523480156200001257600080fd5b5060405162002476380380620024768339810160408190526200003591620000fd565b600160008181558154336001600160a01b0319918216811790935560028054909116831790556040517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36001546040516001600160a01b03909116906000907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a36001600160a01b0393841660805291831660a052821660c0521660e0526200015a565b80516001600160a01b0381168114620000f857600080fd5b919050565b600080600080608085870312156200011457600080fd5b6200011f85620000e0565b93506200012f60208601620000e0565b92506200013f60408601620000e0565b91506200014f60608601620000e0565b905092959194509250565b60805160a05160c05160e05161224f6200022760003960006112f50152600081816106110152818161126c015281816113cf01526113f801526000818161030d01528181610402015281816106bf015281816107d801528181610a6b01528181610b9301528181610d9d01528181610dfd01528181610fb801526110da01526000818161020101528181610364015281816104fc01528181610729015281816108910152818161090c01528181610af801528181610e8501528181610f21015261103c015261224f6000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c80638da5cb5b116100d8578063d12e56b41161008c578063e70c20d911610066578063e70c20d91461030b578063f2fde38b14610331578063f77c47911461034457600080fd5b8063d12e56b4146102dd578063da04db67146102e5578063e0667165146102f857600080fd5b8063ac9650d8116100bd578063ac9650d8146102a0578063b2e4a7e5146102c0578063c2b18aa0146102c857600080fd5b80638da5cb5b1461027c57806396ce3f0b1461028d57600080fd5b80633f37dce21161013a57806368ba5a421161011457806368ba5a42146102595780636d16fa41146102615780636d811e711461027457600080fd5b80633f37dce2146101ec578063504b82bf146101ff57806361b8b5dc1461023957600080fd5b80632971c33e1161016b5780632971c33e146101af5780632e1a7d4d146101c657806339f95f81146101d957600080fd5b806308aa325f146101875780630b2ab7881461019c575b600080fd5b61019a610195366004611912565b610355565b005b61019a6101aa3660046119a4565b6104bc565b6003545b6040519081526020015b60405180910390f35b61019a6101d43660046119c8565b610555565b61019a6101e73660046119a4565b61067f565b61019a6101fa3660046119e1565b6106ee565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016101bd565b61024c6102473660046119a4565b610856565b6040516101bd9190611a4d565b61024c610908565b61019a61026f3660046119a4565b610995565b6101b3610a67565b6001546001600160a01b0316610221565b61019a61029b366004611912565b610aeb565b6102b36102ae366004611a91565b610c43565b6040516101bd9190611b56565b61024c610d99565b6102d0610df9565b6040516101bd9190611bd6565b6102d0610e81565b61019a6102f33660046119e1565b610ee1565b61019a610306366004611912565b61102d565b7f0000000000000000000000000000000000000000000000000000000000000000610221565b61019a61033f3660046119a4565b61112e565b6002546001600160a01b0316610221565b61035d611200565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638f0bc152338a8a8a6040518563ffffffff1660e01b81526004016103b49493929190611c42565b6060604051808303816000875af11580156103d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f79190611c75565b9250925092506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166397c83844863387878c8c6040518763ffffffff1660e01b815260040161045696959493929190611cae565b60408051808303816000875af1158015610474573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104989190611cf3565b915091506104a68282611259565b50505050506104b56001600055565b5050505050565b6104c4611488565b6040517f6d16fa410000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f00000000000000000000000000000000000000000000000000000000000000001690636d16fa41906024015b600060405180830381600087803b15801561054157600080fd5b505af11580156104b5573d6000803e3d6000fd5b61055d6114e4565b600081116105b25760405162461bcd60e51b815260206004820152600260248201527f703100000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6003548111156106045760405162461bcd60e51b815260206004820152600260248201527f703200000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b6106386001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016338361153e565b806003546106469190611d46565b6003556040518181527f9893b6ecc024ca2ea684c8b98d392ba3e47fd995e6f6ddddc1b0c7acf5b9dd2b9060200160405180910390a150565b610687611488565b6040517f6d16fa410000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f00000000000000000000000000000000000000000000000000000000000000001690636d16fa4190602401610527565b6106f6611200565b6040517f02a688ed0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302a688ed9061076290339089908990600401611d59565b6020604051808303816000875af1158015610781573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a59190611d85565b6040517fb31f41700000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b31f417090610813908490339088908890600401611d9e565b600060405180830381600087803b15801561082d57600080fd5b505af1158015610841573d6000803e3d6000fd5b50505050506108506001600055565b50505050565b6040517f27e235e30000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526060917f0000000000000000000000000000000000000000000000000000000000000000909116906327e235e390602401600060405180830381865afa1580156108da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109029190810190611e4b565b92915050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c038a38e6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610968573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109909190810190611e4b565b905090565b61099d611488565b6001600160a01b0381166109f35760405162461bcd60e51b815260206004820152600360248201527f6f6334000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b6002546040516001600160a01b038084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636d811e716040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ac7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109909190611d85565b610af3611200565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633e12170f338989896040518563ffffffff1660e01b8152600401610b489493929190611c42565b60408051808303816000875af1158015610b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8a9190611cf3565b915091506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663837115538533868a8a6040518663ffffffff1660e01b8152600401610be5959493929190611ed6565b60408051808303816000875af1158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c279190611cf3565b91509150610c358282611259565b505050506104b56001600055565b60608167ffffffffffffffff811115610c5e57610c5e611dc7565b604051908082528060200260200182016040528015610c9157816020015b6060815260200190600190039081610c7c5790505b50905060005b82811015610d925760008030868685818110610cb557610cb5611f05565b9050602002810190610cc79190611f34565b604051610cd5929190611f99565b600060405180830381855af49150503d8060008114610d10576040519150601f19603f3d011682016040523d82523d6000602084013e610d15565b606091505b509150915081610d6157604481511015610d2e57600080fd5b60048101905080806020019051810190610d489190611fa9565b60405162461bcd60e51b81526004016105a9919061203d565b80848481518110610d7457610d74611f05565b6020026020010181905250505080610d8b90612050565b9050610c97565b5092915050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637bb98a686040518163ffffffff1660e01b8152600401600060405180830381865afa158015610968573d6000803e3d6000fd5b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639d63848a6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610e59573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109909190810190612088565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639d63848a6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610e59573d6000803e3d6000fd5b610ee9611200565b610ef16114e4565b6040517f6fd366b80000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636fd366b890610f589087908790600401612117565b600060405180830381600087803b158015610f7257600080fd5b505af1158015610f86573d6000803e3d6000fd5b50506040517f6fd366b80000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250636fd366b89150610ff19085908590600401612117565b600060405180830381600087803b15801561100b57600080fd5b505af115801561101f573d6000803e3d6000fd5b505050506108506001600055565b611035611200565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c4113b88338a8a8a6040518563ffffffff1660e01b815260040161108c9493929190611c42565b6060604051808303816000875af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190611c75565b9250925092506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663185bad3f863387878c8c6040518763ffffffff1660e01b815260040161045696959493929190611cae565b611136611488565b6001600160a01b03811661118c5760405162461bcd60e51b815260206004820152600360248201527f6f6333000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6002600054036112525760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105a9565b6002600055565b8115611294576112946001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330856115ec565b8015611484576040517f575313cd0000000000000000000000000000000000000000000000000000000081527f25f616b7f06464df406f2c22888182f2cadcd3737206047201a423a011a27532600482015260009081906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063575313cd906024016040805180830381865afa15801561133b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135f919061212b565b6bffffffffffffffffffffffff16915091506000808211801561138a5750670de0b6b3a76400008211155b801561139e57506001600160a01b03831615155b1561146457670de0b6b3a76400006113b68386612176565b6113c0919061218d565b90506113f66001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016848361153e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03167f6ded982279c8387ad8a63e73385031a3807c1862e633f06e09d11bcb6e282f608360405161145b91815260200190565b60405180910390a35b808460035461147391906121c8565b61147d9190611d46565b6003555050505b5050565b6001546001600160a01b031633146114e25760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b565b6002546001600160a01b031633146114e25760405162461bcd60e51b815260206004820152600360248201527f6f6332000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b6040516001600160a01b0383166024820152604481018290526115e79084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261163d565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108509085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611583565b6000611692826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117229092919063ffffffff16565b8051909150156115e757808060200190518101906116b091906121db565b6115e75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105a9565b60606117318484600085611739565b949350505050565b6060824710156117b15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105a9565b600080866001600160a01b031685876040516117cd91906121fd565b60006040518083038185875af1925050503d806000811461180a576040519150601f19603f3d011682016040523d82523d6000602084013e61180f565b606091505b50915091506118208783838761182b565b979650505050505050565b6060831561189a578251600003611893576001600160a01b0385163b6118935760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105a9565b5081611731565b61173183838151156118af5781518083602001fd5b8060405162461bcd60e51b81526004016105a9919061203d565b60008083601f8401126118db57600080fd5b50813567ffffffffffffffff8111156118f357600080fd5b60208301915083602082850101111561190b57600080fd5b9250929050565b60008060008060006060868803121561192a57600080fd5b85359450602086013567ffffffffffffffff8082111561194957600080fd5b61195589838a016118c9565b9096509450604088013591508082111561196e57600080fd5b5061197b888289016118c9565b969995985093965092949392505050565b6001600160a01b03811681146119a157600080fd5b50565b6000602082840312156119b657600080fd5b81356119c18161198c565b9392505050565b6000602082840312156119da57600080fd5b5035919050565b600080600080604085870312156119f757600080fd5b843567ffffffffffffffff80821115611a0f57600080fd5b611a1b888389016118c9565b90965094506020870135915080821115611a3457600080fd5b50611a41878288016118c9565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b81811015611a8557835183529284019291840191600101611a69565b50909695505050505050565b60008060208385031215611aa457600080fd5b823567ffffffffffffffff80821115611abc57600080fd5b818501915085601f830112611ad057600080fd5b813581811115611adf57600080fd5b8660208260051b8501011115611af457600080fd5b60209290920196919550909350505050565b60005b83811015611b21578181015183820152602001611b09565b50506000910152565b60008151808452611b42816020860160208601611b06565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611bc9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452611bb7858351611b2a565b94509285019290850190600101611b7d565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611a855783516001600160a01b031683529284019291840191600101611bf2565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6001600160a01b0385168152836020820152606060408201526000611c6b606083018486611c17565b9695505050505050565b600080600060608486031215611c8a57600080fd5b835192506020840151611c9c8161198c565b80925050604084015190509250925092565b86815260006001600160a01b03808816602084015280871660408401525084606083015260a06080830152611ce760a083018486611c17565b98975050505050505050565b60008060408385031215611d0657600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561090257610902611d17565b6001600160a01b0384168152604060208201526000611d7c604083018486611c17565b95945050505050565b600060208284031215611d9757600080fd5b5051919050565b8481526001600160a01b0384166020820152606060408201526000611c6b606083018486611c17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611e1f57611e1f611dc7565b604052919050565b600067ffffffffffffffff821115611e4157611e41611dc7565b5060051b60200190565b60006020808385031215611e5e57600080fd5b825167ffffffffffffffff811115611e7557600080fd5b8301601f81018513611e8657600080fd5b8051611e99611e9482611e27565b611df6565b81815260059190911b82018301908381019087831115611eb857600080fd5b928401925b8284101561182057835182529284019290840190611ebd565b8581526001600160a01b0385166020820152836040820152608060608201526000611820608083018486611c17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611f6957600080fd5b83018035915067ffffffffffffffff821115611f8457600080fd5b60200191503681900382131561190b57600080fd5b8183823760009101908152919050565b600060208284031215611fbb57600080fd5b815167ffffffffffffffff80821115611fd357600080fd5b818401915084601f830112611fe757600080fd5b815181811115611ff957611ff9611dc7565b61200c6020601f19601f84011601611df6565b915080825285602082850101111561202357600080fd5b612034816020840160208601611b06565b50949350505050565b6020815260006119c16020830184611b2a565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361208157612081611d17565b5060010190565b6000602080838503121561209b57600080fd5b825167ffffffffffffffff8111156120b257600080fd5b8301601f810185136120c357600080fd5b80516120d1611e9482611e27565b81815260059190911b820183019083810190878311156120f057600080fd5b928401925b828410156118205783516121088161198c565b825292840192908401906120f5565b602081526000611731602083018486611c17565b6000806040838503121561213e57600080fd5b82516121498161198c565b60208401519092506bffffffffffffffffffffffff8116811461216b57600080fd5b809150509250929050565b808202811582820484141761090257610902611d17565b6000826121c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561090257610902611d17565b6000602082840312156121ed57600080fd5b815180151581146119c157600080fd5b6000825161220f818460208701611b06565b919091019291505056fea2646970667358221220524d477f08244fa17e79d752345c7e1fa018636500fe2757b8626edec801b5ac64736f6c63430008120033a2646970667358221220882a15de6bea4b5396aae6f5ba05374e467b949b789a2e67ef7213d04a463dbd64736f6c63430008120033000000000000000000000000117cfd9060525452db4a34d51c0b3b7599087f050000000000000000000000002098aea80611b51ca26586e122b3c629a2f263e9

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100be5760003560e01c80639b19251a11610076578063bf14752a1161005b578063bf14752a146101ba578063f2fde38b146101cd578063f77c4791146101e057600080fd5b80639b19251a14610157578063b721ef6e1461018757600080fd5b80636d16fa41116100a75780636d16fa41146100ee57806380c9419e146101015780638da5cb5b1461013957600080fd5b806306661abd146100c35780631302d03a146100d9575b600080fd5b6003546040519081526020015b60405180910390f35b6100ec6100e7366004610eab565b6101fe565b005b6100ec6100fc366004610ed7565b6103de565b61011461010f366004610efb565b6104f1565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100d0565b60005473ffffffffffffffffffffffffffffffffffffffff16610114565b61017a610165366004610ed7565b60046020526000908152604090205460ff1681565b6040516100d09190610f43565b6101aa610195366004610ed7565b60026020526000908152604090205460ff1681565b60405190151581526020016100d0565b6101146101c8366004610fcd565b610528565b6100ec6101db366004610ed7565b610c63565b60015473ffffffffffffffffffffffffffffffffffffffff16610114565b610206610d75565b6002811115610276576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f663400000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166102f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f6635000000000000000000000000000000000000000000000000000000000000604482015260640161026d565b73ffffffffffffffffffffffffffffffffffffffff82166000818152600460205260409020547f1f9a093b2e93f445118693693f1e05c8435a7c6081c00b7086c5aaf5ddbf95979060ff16600281111561034f5761034f610f14565b60408051918252602082018590520160405180910390a280600281111561037857610378610f14565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360028111156103d5576103d5610f14565b02179055505050565b6103e6610df8565b73ffffffffffffffffffffffffffffffffffffffff8116610463576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f6f63340000000000000000000000000000000000000000000000000000000000604482015260640161026d565b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6003818154811061050157600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000600173ffffffffffffffffffffffffffffffffffffffff881660009081526004602052604090205460ff16600281111561056657610566610f14565b146105cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f6631000000000000000000000000000000000000000000000000000000000000604482015260640161026d565b600273ffffffffffffffffffffffffffffffffffffffff871660009081526004602052604090205460ff16600281111561060957610609610f14565b14610670576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f6632000000000000000000000000000000000000000000000000000000000000604482015260640161026d565b6040517f20868d1800000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8916906320868d18906106e9907f0000000000000000000000002098aea80611b51ca26586e122b3c629a2f263e9908a908a90600401611062565b6020604051808303816000875af1158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c91906110cc565b905060008773ffffffffffffffffffffffffffffffffffffffff166320868d187f0000000000000000000000002098aea80611b51ca26586e122b3c629a2f263e987876040518463ffffffff1660e01b815260040161078d93929190611062565b6020604051808303816000875af11580156107ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d091906110cc565b9050600082827f000000000000000000000000117cfd9060525452db4a34d51c0b3b7599087f057f0000000000000000000000002098aea80611b51ca26586e122b3c629a2f263e960405161082490610e79565b73ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015290831660408301529091166060820152608001604051809103906000f080158015610875573d6000803e3d6000fd5b506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156108e357600080fd5b505af11580156108f7573d6000803e3d6000fd5b50506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528516925063f2fde38b9150602401600060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b50506040517f6d16fa4100000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff84169250636d16fa419150602401600060405180830381600087803b1580156109e357600080fd5b505af11580156109f7573d6000803e3d6000fd5b50506040517f0b2ab78800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff84169250630b2ab7889150602401600060405180830381600087803b158015610a6257600080fd5b505af1158015610a76573d6000803e3d6000fd5b50506040517f39f95f8100000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff841692506339f95f819150602401600060405180830381600087803b158015610ae157600080fd5b505af1158015610af5573d6000803e3d6000fd5b50506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8416925063f2fde38b9150602401600060405180830381600087803b158015610b6057600080fd5b505af1158015610b74573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff8116600081815260026020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091556003805491820181559093527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055905191825233917f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d4896910160405180910390a29998505050505050505050565b610c6b610df8565b73ffffffffffffffffffffffffffffffffffffffff8116610ce8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f6f63330000000000000000000000000000000000000000000000000000000000604482015260640161026d565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f6f63320000000000000000000000000000000000000000000000000000000000604482015260640161026d565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f6f63310000000000000000000000000000000000000000000000000000000000604482015260640161026d565b612476806110ea83390190565b73ffffffffffffffffffffffffffffffffffffffff81168114610ea857600080fd5b50565b60008060408385031215610ebe57600080fd5b8235610ec981610e86565b946020939093013593505050565b600060208284031215610ee957600080fd5b8135610ef481610e86565b9392505050565b600060208284031215610f0d57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160038310610f7e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b60008083601f840112610f9657600080fd5b50813567ffffffffffffffff811115610fae57600080fd5b602083019150836020828501011115610fc657600080fd5b9250929050565b60008060008060008060808789031215610fe657600080fd5b8635610ff181610e86565b9550602087013561100181610e86565b9450604087013567ffffffffffffffff8082111561101e57600080fd5b61102a8a838b01610f84565b9096509450606089013591508082111561104357600080fd5b5061105089828a01610f84565b979a9699509497509295939492505050565b73ffffffffffffffffffffffffffffffffffffffff8416815260406020820152816040820152818360608301376000818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b6000602082840312156110de57600080fd5b8151610ef481610e8656fe6101006040523480156200001257600080fd5b5060405162002476380380620024768339810160408190526200003591620000fd565b600160008181558154336001600160a01b0319918216811790935560028054909116831790556040517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36001546040516001600160a01b03909116906000907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a36001600160a01b0393841660805291831660a052821660c0521660e0526200015a565b80516001600160a01b0381168114620000f857600080fd5b919050565b600080600080608085870312156200011457600080fd5b6200011f85620000e0565b93506200012f60208601620000e0565b92506200013f60408601620000e0565b91506200014f60608601620000e0565b905092959194509250565b60805160a05160c05160e05161224f6200022760003960006112f50152600081816106110152818161126c015281816113cf01526113f801526000818161030d01528181610402015281816106bf015281816107d801528181610a6b01528181610b9301528181610d9d01528181610dfd01528181610fb801526110da01526000818161020101528181610364015281816104fc01528181610729015281816108910152818161090c01528181610af801528181610e8501528181610f21015261103c015261224f6000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c80638da5cb5b116100d8578063d12e56b41161008c578063e70c20d911610066578063e70c20d91461030b578063f2fde38b14610331578063f77c47911461034457600080fd5b8063d12e56b4146102dd578063da04db67146102e5578063e0667165146102f857600080fd5b8063ac9650d8116100bd578063ac9650d8146102a0578063b2e4a7e5146102c0578063c2b18aa0146102c857600080fd5b80638da5cb5b1461027c57806396ce3f0b1461028d57600080fd5b80633f37dce21161013a57806368ba5a421161011457806368ba5a42146102595780636d16fa41146102615780636d811e711461027457600080fd5b80633f37dce2146101ec578063504b82bf146101ff57806361b8b5dc1461023957600080fd5b80632971c33e1161016b5780632971c33e146101af5780632e1a7d4d146101c657806339f95f81146101d957600080fd5b806308aa325f146101875780630b2ab7881461019c575b600080fd5b61019a610195366004611912565b610355565b005b61019a6101aa3660046119a4565b6104bc565b6003545b6040519081526020015b60405180910390f35b61019a6101d43660046119c8565b610555565b61019a6101e73660046119a4565b61067f565b61019a6101fa3660046119e1565b6106ee565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016101bd565b61024c6102473660046119a4565b610856565b6040516101bd9190611a4d565b61024c610908565b61019a61026f3660046119a4565b610995565b6101b3610a67565b6001546001600160a01b0316610221565b61019a61029b366004611912565b610aeb565b6102b36102ae366004611a91565b610c43565b6040516101bd9190611b56565b61024c610d99565b6102d0610df9565b6040516101bd9190611bd6565b6102d0610e81565b61019a6102f33660046119e1565b610ee1565b61019a610306366004611912565b61102d565b7f0000000000000000000000000000000000000000000000000000000000000000610221565b61019a61033f3660046119a4565b61112e565b6002546001600160a01b0316610221565b61035d611200565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638f0bc152338a8a8a6040518563ffffffff1660e01b81526004016103b49493929190611c42565b6060604051808303816000875af11580156103d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f79190611c75565b9250925092506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166397c83844863387878c8c6040518763ffffffff1660e01b815260040161045696959493929190611cae565b60408051808303816000875af1158015610474573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104989190611cf3565b915091506104a68282611259565b50505050506104b56001600055565b5050505050565b6104c4611488565b6040517f6d16fa410000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f00000000000000000000000000000000000000000000000000000000000000001690636d16fa41906024015b600060405180830381600087803b15801561054157600080fd5b505af11580156104b5573d6000803e3d6000fd5b61055d6114e4565b600081116105b25760405162461bcd60e51b815260206004820152600260248201527f703100000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6003548111156106045760405162461bcd60e51b815260206004820152600260248201527f703200000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b6106386001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016338361153e565b806003546106469190611d46565b6003556040518181527f9893b6ecc024ca2ea684c8b98d392ba3e47fd995e6f6ddddc1b0c7acf5b9dd2b9060200160405180910390a150565b610687611488565b6040517f6d16fa410000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f00000000000000000000000000000000000000000000000000000000000000001690636d16fa4190602401610527565b6106f6611200565b6040517f02a688ed0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302a688ed9061076290339089908990600401611d59565b6020604051808303816000875af1158015610781573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a59190611d85565b6040517fb31f41700000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b31f417090610813908490339088908890600401611d9e565b600060405180830381600087803b15801561082d57600080fd5b505af1158015610841573d6000803e3d6000fd5b50505050506108506001600055565b50505050565b6040517f27e235e30000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526060917f0000000000000000000000000000000000000000000000000000000000000000909116906327e235e390602401600060405180830381865afa1580156108da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109029190810190611e4b565b92915050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c038a38e6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610968573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109909190810190611e4b565b905090565b61099d611488565b6001600160a01b0381166109f35760405162461bcd60e51b815260206004820152600360248201527f6f6334000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b6002546040516001600160a01b038084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636d811e716040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ac7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109909190611d85565b610af3611200565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633e12170f338989896040518563ffffffff1660e01b8152600401610b489493929190611c42565b60408051808303816000875af1158015610b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8a9190611cf3565b915091506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663837115538533868a8a6040518663ffffffff1660e01b8152600401610be5959493929190611ed6565b60408051808303816000875af1158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c279190611cf3565b91509150610c358282611259565b505050506104b56001600055565b60608167ffffffffffffffff811115610c5e57610c5e611dc7565b604051908082528060200260200182016040528015610c9157816020015b6060815260200190600190039081610c7c5790505b50905060005b82811015610d925760008030868685818110610cb557610cb5611f05565b9050602002810190610cc79190611f34565b604051610cd5929190611f99565b600060405180830381855af49150503d8060008114610d10576040519150601f19603f3d011682016040523d82523d6000602084013e610d15565b606091505b509150915081610d6157604481511015610d2e57600080fd5b60048101905080806020019051810190610d489190611fa9565b60405162461bcd60e51b81526004016105a9919061203d565b80848481518110610d7457610d74611f05565b6020026020010181905250505080610d8b90612050565b9050610c97565b5092915050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637bb98a686040518163ffffffff1660e01b8152600401600060405180830381865afa158015610968573d6000803e3d6000fd5b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639d63848a6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610e59573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109909190810190612088565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639d63848a6040518163ffffffff1660e01b8152600401600060405180830381865afa158015610e59573d6000803e3d6000fd5b610ee9611200565b610ef16114e4565b6040517f6fd366b80000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636fd366b890610f589087908790600401612117565b600060405180830381600087803b158015610f7257600080fd5b505af1158015610f86573d6000803e3d6000fd5b50506040517f6fd366b80000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250636fd366b89150610ff19085908590600401612117565b600060405180830381600087803b15801561100b57600080fd5b505af115801561101f573d6000803e3d6000fd5b505050506108506001600055565b611035611200565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c4113b88338a8a8a6040518563ffffffff1660e01b815260040161108c9493929190611c42565b6060604051808303816000875af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190611c75565b9250925092506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663185bad3f863387878c8c6040518763ffffffff1660e01b815260040161045696959493929190611cae565b611136611488565b6001600160a01b03811661118c5760405162461bcd60e51b815260206004820152600360248201527f6f6333000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6002600054036112525760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105a9565b6002600055565b8115611294576112946001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330856115ec565b8015611484576040517f575313cd0000000000000000000000000000000000000000000000000000000081527f25f616b7f06464df406f2c22888182f2cadcd3737206047201a423a011a27532600482015260009081906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063575313cd906024016040805180830381865afa15801561133b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135f919061212b565b6bffffffffffffffffffffffff16915091506000808211801561138a5750670de0b6b3a76400008211155b801561139e57506001600160a01b03831615155b1561146457670de0b6b3a76400006113b68386612176565b6113c0919061218d565b90506113f66001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016848361153e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03167f6ded982279c8387ad8a63e73385031a3807c1862e633f06e09d11bcb6e282f608360405161145b91815260200190565b60405180910390a35b808460035461147391906121c8565b61147d9190611d46565b6003555050505b5050565b6001546001600160a01b031633146114e25760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b565b6002546001600160a01b031633146114e25760405162461bcd60e51b815260206004820152600360248201527f6f6332000000000000000000000000000000000000000000000000000000000060448201526064016105a9565b6040516001600160a01b0383166024820152604481018290526115e79084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261163d565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108509085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611583565b6000611692826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117229092919063ffffffff16565b8051909150156115e757808060200190518101906116b091906121db565b6115e75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105a9565b60606117318484600085611739565b949350505050565b6060824710156117b15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105a9565b600080866001600160a01b031685876040516117cd91906121fd565b60006040518083038185875af1925050503d806000811461180a576040519150601f19603f3d011682016040523d82523d6000602084013e61180f565b606091505b50915091506118208783838761182b565b979650505050505050565b6060831561189a578251600003611893576001600160a01b0385163b6118935760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105a9565b5081611731565b61173183838151156118af5781518083602001fd5b8060405162461bcd60e51b81526004016105a9919061203d565b60008083601f8401126118db57600080fd5b50813567ffffffffffffffff8111156118f357600080fd5b60208301915083602082850101111561190b57600080fd5b9250929050565b60008060008060006060868803121561192a57600080fd5b85359450602086013567ffffffffffffffff8082111561194957600080fd5b61195589838a016118c9565b9096509450604088013591508082111561196e57600080fd5b5061197b888289016118c9565b969995985093965092949392505050565b6001600160a01b03811681146119a157600080fd5b50565b6000602082840312156119b657600080fd5b81356119c18161198c565b9392505050565b6000602082840312156119da57600080fd5b5035919050565b600080600080604085870312156119f757600080fd5b843567ffffffffffffffff80821115611a0f57600080fd5b611a1b888389016118c9565b90965094506020870135915080821115611a3457600080fd5b50611a41878288016118c9565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b81811015611a8557835183529284019291840191600101611a69565b50909695505050505050565b60008060208385031215611aa457600080fd5b823567ffffffffffffffff80821115611abc57600080fd5b818501915085601f830112611ad057600080fd5b813581811115611adf57600080fd5b8660208260051b8501011115611af457600080fd5b60209290920196919550909350505050565b60005b83811015611b21578181015183820152602001611b09565b50506000910152565b60008151808452611b42816020860160208601611b06565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611bc9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452611bb7858351611b2a565b94509285019290850190600101611b7d565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611a855783516001600160a01b031683529284019291840191600101611bf2565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6001600160a01b0385168152836020820152606060408201526000611c6b606083018486611c17565b9695505050505050565b600080600060608486031215611c8a57600080fd5b835192506020840151611c9c8161198c565b80925050604084015190509250925092565b86815260006001600160a01b03808816602084015280871660408401525084606083015260a06080830152611ce760a083018486611c17565b98975050505050505050565b60008060408385031215611d0657600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561090257610902611d17565b6001600160a01b0384168152604060208201526000611d7c604083018486611c17565b95945050505050565b600060208284031215611d9757600080fd5b5051919050565b8481526001600160a01b0384166020820152606060408201526000611c6b606083018486611c17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611e1f57611e1f611dc7565b604052919050565b600067ffffffffffffffff821115611e4157611e41611dc7565b5060051b60200190565b60006020808385031215611e5e57600080fd5b825167ffffffffffffffff811115611e7557600080fd5b8301601f81018513611e8657600080fd5b8051611e99611e9482611e27565b611df6565b81815260059190911b82018301908381019087831115611eb857600080fd5b928401925b8284101561182057835182529284019290840190611ebd565b8581526001600160a01b0385166020820152836040820152608060608201526000611820608083018486611c17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611f6957600080fd5b83018035915067ffffffffffffffff821115611f8457600080fd5b60200191503681900382131561190b57600080fd5b8183823760009101908152919050565b600060208284031215611fbb57600080fd5b815167ffffffffffffffff80821115611fd357600080fd5b818401915084601f830112611fe757600080fd5b815181811115611ff957611ff9611dc7565b61200c6020601f19601f84011601611df6565b915080825285602082850101111561202357600080fd5b612034816020840160208601611b06565b50949350505050565b6020815260006119c16020830184611b2a565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361208157612081611d17565b5060010190565b6000602080838503121561209b57600080fd5b825167ffffffffffffffff8111156120b257600080fd5b8301601f810185136120c357600080fd5b80516120d1611e9482611e27565b81815260059190911b820183019083810190878311156120f057600080fd5b928401925b828410156118205783516121088161198c565b825292840192908401906120f5565b602081526000611731602083018486611c17565b6000806040838503121561213e57600080fd5b82516121498161198c565b60208401519092506bffffffffffffffffffffffff8116811461216b57600080fd5b809150509250929050565b808202811582820484141761090257610902611d17565b6000826121c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561090257610902611d17565b6000602082840312156121ed57600080fd5b815180151581146119c157600080fd5b6000825161220f818460208701611b06565b919091019291505056fea2646970667358221220524d477f08244fa17e79d752345c7e1fa018636500fe2757b8626edec801b5ac64736f6c63430008120033a2646970667358221220882a15de6bea4b5396aae6f5ba05374e467b949b789a2e67ef7213d04a463dbd64736f6c63430008120033

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

000000000000000000000000117cfd9060525452db4a34d51c0b3b7599087f050000000000000000000000002098aea80611b51ca26586e122b3c629a2f263e9

-----Decoded View---------------
Arg [0] : gysr_ (address): 0x117cFd9060525452db4A34d51c0b3b7599087f05
Arg [1] : config_ (address): 0x2098aEA80611B51ca26586E122b3c629a2F263e9

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000117cfd9060525452db4a34d51c0b3b7599087f05
Arg [1] : 0000000000000000000000002098aea80611b51ca26586e122b3c629a2f263e9


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.