ETH Price: $2,267.76 (+2.29%)
Gas: 1.48 Gwei

Contract

0xfae470A311f61944346BbB8709CDc2398506Be46
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...180167232023-08-29 0:29:59375 days ago1693268999IN
0xfae470A3...98506Be46
0 ETH0.0005256618.33516273
Set ACL Admin180167222023-08-29 0:29:47375 days ago1693268987IN
0xfae470A3...98506Be46
0 ETH0.0005540618.15352359
Update Pool Impl179850572023-08-24 14:08:23380 days ago1692886103IN
0xfae470A3...98506Be46
0 ETH0.0045987429.21171145
Update Pool Impl179752942023-08-23 5:22:59381 days ago1692768179IN
0xfae470A3...98506Be46
0 ETH0.0049600515.1490063
Set Marketplace179751692023-08-23 4:57:59381 days ago1692766679IN
0xfae470A3...98506Be46
0 ETH0.0013639214.40064051
Set Marketplace179751662023-08-23 4:57:23381 days ago1692766643IN
0xfae470A3...98506Be46
0 ETH0.0014476615.2577101
Set Protocol Dat...179749282023-08-23 4:09:23381 days ago1692763763IN
0xfae470A3...98506Be46
0 ETH0.0008629418.07937794
Set Price Oracle179749262023-08-23 4:08:59381 days ago1692763739IN
0xfae470A3...98506Be46
0 ETH0.0008512917.84305027
Set Pool Configu...179749082023-08-23 4:05:23381 days ago1692763523IN
0xfae470A3...98506Be46
0 ETH0.011354419.73924001
Update Pool Impl179749032023-08-23 4:04:23381 days ago1692763463IN
0xfae470A3...98506Be46
0 ETH0.0052026219.39214545
Update Pool Impl179749022023-08-23 4:04:11381 days ago1692763451IN
0xfae470A3...98506Be46
0 ETH0.0236408319.97896993
Update Pool Impl179749012023-08-23 4:03:59381 days ago1692763439IN
0xfae470A3...98506Be46
0 ETH0.0084432320.3257081
Update Pool Impl179749002023-08-23 4:03:47381 days ago1692763427IN
0xfae470A3...98506Be46
0 ETH0.0041426618.98736507
Update Pool Impl179709822023-08-22 14:55:23382 days ago1692716123IN
0xfae470A3...98506Be46
0 ETH0.02432375100.00185749
Update Pool Impl179709812023-08-22 14:55:11382 days ago1692716111IN
0xfae470A3...98506Be46
0 ETH0.178247598.90868929
Set ACL Manager179709532023-08-22 14:49:35382 days ago1692715775IN
0xfae470A3...98506Be46
0 ETH0.0043128790.44139577
Set WETH179709502023-08-22 14:48:59382 days ago1692715739IN
0xfae470A3...98506Be46
0 ETH0.0043495591.29273337
Set ACL Admin179709492023-08-22 14:48:47382 days ago1692715727IN
0xfae470A3...98506Be46
0 ETH0.0044057992.51797103
0x60806040179709472023-08-22 14:48:23382 days ago1692715703IN
 Create: PoolAddressesProvider
0 ETH0.3178813489.74202992

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
179749082023-08-23 4:05:23381 days ago1692763523
0xfae470A3...98506Be46
 Contract Creation0 ETH
179709812023-08-22 14:55:11382 days ago1692716111
0xfae470A3...98506Be46
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PoolAddressesProvider

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
File 1 of 18 : PoolAddressesProvider.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import {Ownable} from "../../dependencies/openzeppelin/contracts/Ownable.sol";
import {IPoolAddressesProvider} from "../../interfaces/IPoolAddressesProvider.sol";
import {IParaProxy} from "../../interfaces/IParaProxy.sol";
import {InitializableImmutableAdminUpgradeabilityProxy} from "../libraries/paraspace-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol";
import {ParaProxy} from "../libraries/paraspace-upgradeability/ParaProxy.sol";
import {DataTypes} from "../../protocol/libraries/types/DataTypes.sol";
import {Address} from "../../dependencies/openzeppelin/contracts/Address.sol";
import {Errors} from "../../protocol/libraries/helpers/Errors.sol";

/**
 * @title PoolAddressesProvider
 *
 * @notice Main registry of addresses part of or connected to the protocol, including permissioned roles
 * @dev Acts as factory of proxies and admin of those, so with right to change its implementations
 * @dev Owned by the ParaSpace Governance
 **/
contract PoolAddressesProvider is Ownable, IPoolAddressesProvider {
    // Identifier of the ParaSpace Market
    string private _marketId;

    // Map of registered addresses (identifier => registeredAddress)
    mapping(bytes32 => address) private _addresses;

    // Map of marketplace contracts (id => address)
    mapping(bytes32 => DataTypes.Marketplace) internal _marketplaces;

    // Main identifiers
    bytes32 private constant POOL = "POOL";
    bytes32 private constant POOL_CONFIGURATOR = "POOL_CONFIGURATOR";
    bytes32 private constant PRICE_ORACLE = "PRICE_ORACLE";
    bytes32 private constant ACL_MANAGER = "ACL_MANAGER";
    bytes32 private constant ACL_ADMIN = "ACL_ADMIN";
    bytes32 private constant PRICE_ORACLE_SENTINEL = "PRICE_ORACLE_SENTINEL";
    bytes32 private constant DATA_PROVIDER = "DATA_PROVIDER";
    bytes32 private constant WETH = "WETH";

    /**
     * @dev Constructor.
     * @param marketId The identifier of the market.
     * @param owner The owner address of this contract.
     */
    constructor(string memory marketId, address owner) {
        _setMarketId(marketId);
        transferOwnership(owner);
    }

    /// @inheritdoc IPoolAddressesProvider
    function getMarketId() external view override returns (string memory) {
        return _marketId;
    }

    /// @inheritdoc IPoolAddressesProvider
    function setMarketId(string memory newMarketId)
        external
        override
        onlyOwner
    {
        _setMarketId(newMarketId);
    }

    /// @inheritdoc IPoolAddressesProvider
    function getAddress(bytes32 id) public view override returns (address) {
        return _addresses[id];
    }

    /// @inheritdoc IPoolAddressesProvider
    function setAddress(bytes32 id, address newAddress)
        external
        override
        onlyOwner
    {
        address oldAddress = _addresses[id];
        _addresses[id] = newAddress;
        emit AddressSet(id, oldAddress, newAddress);
    }

    /// @inheritdoc IPoolAddressesProvider
    function setAddressAsProxy(bytes32 id, address newImplementationAddress)
        external
        override
        onlyOwner
    {
        require(id != POOL, Errors.INVALID_ADDRESSES_PROVIDER_ID);

        address proxyAddress = _addresses[id];
        address oldImplementationAddress = _getProxyImplementation(id);
        _updateImpl(id, newImplementationAddress);
        emit AddressSetAsProxy(
            id,
            proxyAddress,
            oldImplementationAddress,
            newImplementationAddress
        );
    }

    /// @inheritdoc IPoolAddressesProvider
    function getPool() external view override returns (address) {
        return getAddress(POOL);
    }

    /// @inheritdoc IPoolAddressesProvider
    function updatePoolImpl(
        IParaProxy.ProxyImplementation[] calldata implementationParams,
        address _init,
        bytes calldata _calldata
    ) external override onlyOwner {
        _updateParaProxyImpl(POOL, implementationParams, _init, _calldata);

        emit PoolUpdated(implementationParams, _init, _calldata);
    }

    /// @inheritdoc IPoolAddressesProvider
    function getPoolConfigurator() external view override returns (address) {
        return getAddress(POOL_CONFIGURATOR);
    }

    /// @inheritdoc IPoolAddressesProvider
    function setPoolConfiguratorImpl(address newPoolConfiguratorImpl)
        external
        override
        onlyOwner
    {
        address oldPoolConfiguratorImpl = _getProxyImplementation(
            POOL_CONFIGURATOR
        );
        _updateImpl(POOL_CONFIGURATOR, newPoolConfiguratorImpl);
        emit PoolConfiguratorUpdated(
            oldPoolConfiguratorImpl,
            newPoolConfiguratorImpl
        );
    }

    /// @inheritdoc IPoolAddressesProvider
    function getPriceOracle() external view override returns (address) {
        return getAddress(PRICE_ORACLE);
    }

    /// @inheritdoc IPoolAddressesProvider
    function setPriceOracle(address newPriceOracle)
        external
        override
        onlyOwner
    {
        address oldPriceOracle = _addresses[PRICE_ORACLE];
        _addresses[PRICE_ORACLE] = newPriceOracle;
        emit PriceOracleUpdated(oldPriceOracle, newPriceOracle);
    }

    /// @inheritdoc IPoolAddressesProvider
    function getACLManager() external view override returns (address) {
        return getAddress(ACL_MANAGER);
    }

    /// @inheritdoc IPoolAddressesProvider
    function setACLManager(address newAclManager) external override onlyOwner {
        address oldAclManager = _addresses[ACL_MANAGER];
        _addresses[ACL_MANAGER] = newAclManager;
        emit ACLManagerUpdated(oldAclManager, newAclManager);
    }

    /// @inheritdoc IPoolAddressesProvider
    function getACLAdmin() external view override returns (address) {
        return getAddress(ACL_ADMIN);
    }

    /// @inheritdoc IPoolAddressesProvider
    function setACLAdmin(address newAclAdmin) external override onlyOwner {
        address oldAclAdmin = _addresses[ACL_ADMIN];
        _addresses[ACL_ADMIN] = newAclAdmin;
        emit ACLAdminUpdated(oldAclAdmin, newAclAdmin);
    }

    /// @inheritdoc IPoolAddressesProvider
    function getPriceOracleSentinel() external view override returns (address) {
        return getAddress(PRICE_ORACLE_SENTINEL);
    }

    /// @inheritdoc IPoolAddressesProvider
    function setPriceOracleSentinel(address newPriceOracleSentinel)
        external
        override
        onlyOwner
    {
        address oldPriceOracleSentinel = _addresses[PRICE_ORACLE_SENTINEL];
        _addresses[PRICE_ORACLE_SENTINEL] = newPriceOracleSentinel;
        emit PriceOracleSentinelUpdated(
            oldPriceOracleSentinel,
            newPriceOracleSentinel
        );
    }

    /// @inheritdoc IPoolAddressesProvider
    function getPoolDataProvider() external view override returns (address) {
        return getAddress(DATA_PROVIDER);
    }

    /// @inheritdoc IPoolAddressesProvider
    function getWETH() external view override returns (address) {
        return getAddress(WETH);
    }

    /// @inheritdoc IPoolAddressesProvider
    function getMarketplace(bytes32 id)
        external
        view
        override
        returns (DataTypes.Marketplace memory)
    {
        DataTypes.Marketplace memory marketplace = _marketplaces[id];
        if (
            marketplace.marketplace != address(0) &&
            Address.isContract(marketplace.marketplace)
        ) {
            return marketplace;
        } else {
            revert(Errors.INVALID_MARKETPLACE_ID);
        }
    }

    /// @inheritdoc IPoolAddressesProvider
    function setProtocolDataProvider(address newDataProvider)
        external
        override
        onlyOwner
    {
        address oldDataProvider = _addresses[DATA_PROVIDER];
        _addresses[DATA_PROVIDER] = newDataProvider;
        emit ProtocolDataProviderUpdated(oldDataProvider, newDataProvider);
    }

    /// @inheritdoc IPoolAddressesProvider
    function setWETH(address newWETH) external override onlyOwner {
        address oldWETH = _addresses[WETH];
        _addresses[WETH] = newWETH;
        emit WETHUpdated(oldWETH, newWETH);
    }

    /// @inheritdoc IPoolAddressesProvider
    function setMarketplace(
        bytes32 id,
        address marketplace,
        address adapter,
        address operator,
        bool paused
    ) external override onlyOwner {
        _marketplaces[id] = DataTypes.Marketplace(
            marketplace,
            adapter,
            operator,
            paused
        );
        emit MarketplaceUpdated(id, marketplace, adapter, operator, paused);
    }

    /**
     * @notice Internal function to update the implementation of a specific proxied component of the protocol.
     * @dev If there is no proxy registered with the given identifier, it creates the proxy setting `newAddress`
     *   as implementation and calls the initialize() function on the proxy
     * @dev If there is already a proxy registered, it just updates the implementation to `newAddress` and
     *   calls the initialize() function via upgradeToAndCall() in the proxy
     * @param id The id of the proxy to be updated
     * @param newAddress The address of the new implementation
     **/
    function _updateImpl(bytes32 id, address newAddress) internal {
        require(newAddress != address(0), Errors.ZERO_ADDRESS_NOT_VALID);
        address proxyAddress = _addresses[id];
        InitializableImmutableAdminUpgradeabilityProxy proxy;
        bytes memory params = abi.encodeWithSignature(
            "initialize(address)",
            address(this)
        );

        if (proxyAddress == address(0)) {
            proxy = new InitializableImmutableAdminUpgradeabilityProxy(
                address(this)
            );
            proxy.initialize(newAddress, params);
            _addresses[id] = proxyAddress = address(proxy);
            emit ProxyCreated(id, proxyAddress, newAddress);
        } else {
            proxy = InitializableImmutableAdminUpgradeabilityProxy(
                payable(proxyAddress)
            );
            proxy.upgradeToAndCall(newAddress, params);
        }
    }

    /**
     * @notice Internal function to update the implementation of a specific proxied component of the protocol that uses ParaProxy.
     * @dev If there is no proxy registered with the given identifier, it creates the proxy setting `newAddress`
     *   as implementation and calls the calldata on the _init
     * @dev If there is already a proxy registered, it just updates the implementation using the implementationParams
     * @param id The id of the proxy to be updated
     * @param implementationParams Contains the implementation addresses and function selectors
     * @param _init The address of the contract or implementation to execute _calldata
     * @param _calldata A function call, including function selector and arguments
     *                  _calldata is executed with delegatecall on _init
     **/
    function _updateParaProxyImpl(
        bytes32 id,
        IParaProxy.ProxyImplementation[] calldata implementationParams,
        address _init,
        bytes calldata _calldata
    ) internal {
        address proxyAddress = _addresses[id];

        IParaProxy proxy;

        if (proxyAddress == address(0)) {
            proxy = IParaProxy(address(new ParaProxy(address(this))));
            proxy.updateImplementation(implementationParams, _init, _calldata);
            _addresses[id] = proxyAddress = address(proxy);
            emit ParaProxyCreated(id, proxyAddress, implementationParams);
        } else {
            proxy = IParaProxy(payable(proxyAddress));

            proxy.updateImplementation(implementationParams, _init, _calldata);
            emit ParaProxyUpdated(id, proxyAddress, implementationParams);
        }
    }

    /**
     * @notice Updates the identifier of the ParaSpace market.
     * @param newMarketId The new id of the market
     **/
    function _setMarketId(string memory newMarketId) internal {
        string memory oldMarketId = _marketId;
        _marketId = newMarketId;
        emit MarketIdSet(oldMarketId, newMarketId);
    }

    /**
     * @notice Returns the the implementation contract of the proxy contract by its identifier.
     * @dev It returns ZERO if there is no registered address with the given id
     * @dev It reverts if the registered address with the given id is not `InitializableImmutableAdminUpgradeabilityProxy`
     * @param id The id
     * @return The address of the implementation contract
     */
    function _getProxyImplementation(bytes32 id) internal returns (address) {
        address proxyAddress = _addresses[id];
        if (proxyAddress == address(0)) {
            return address(0);
        } else {
            address payable payableProxyAddress = payable(proxyAddress);
            return
                InitializableImmutableAdminUpgradeabilityProxy(
                    payableProxyAddress
                ).implementation();
        }
    }
}

File 2 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [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 functionCall(target, data, "Address: low-level call failed");
    }

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

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

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

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

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

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

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

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

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

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

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

File 3 of 18 : Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

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

File 4 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

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

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

File 5 of 18 : BaseUpgradeabilityProxy.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;

import "./Proxy.sol";
import "../contracts/Address.sol";

/**
 * @title BaseUpgradeabilityProxy
 * @dev This contract implements a proxy that allows to change the
 * implementation address to which it will delegate.
 * Such a change is called an implementation upgrade.
 */
contract BaseUpgradeabilityProxy is Proxy {
    /**
     * @dev Emitted when the implementation is upgraded.
     * @param implementation Address of the new implementation.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant IMPLEMENTATION_SLOT =
        0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Returns the current implementation.
     * @return impl Address of the current implementation
     */
    function _implementation() internal view override returns (address impl) {
        bytes32 slot = IMPLEMENTATION_SLOT;
        //solium-disable-next-line
        assembly {
            impl := sload(slot)
        }
    }

    /**
     * @dev Upgrades the proxy to a new implementation.
     * @param newImplementation Address of the new implementation.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Sets the implementation address of the proxy.
     * @param newImplementation Address of the new implementation.
     */
    function _setImplementation(address newImplementation) internal {
        require(
            Address.isContract(newImplementation),
            "Cannot set a proxy implementation to a non-contract address"
        );

        bytes32 slot = IMPLEMENTATION_SLOT;

        //solium-disable-next-line
        assembly {
            sstore(slot, newImplementation)
        }
    }
}

File 6 of 18 : InitializableUpgradeabilityProxy.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;

import "./BaseUpgradeabilityProxy.sol";

/**
 * @title InitializableUpgradeabilityProxy
 * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing
 * implementation and init data.
 */
contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy {
    /**
     * @dev Contract initializer.
     * @param _logic Address of the initial implementation.
     * @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
     * It should include the signature and the parameters of the function to be called, as described in
     * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
     * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
     */
    function initialize(address _logic, bytes memory _data) public payable {
        require(_implementation() == address(0));
        assert(
            IMPLEMENTATION_SLOT ==
                bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)
        );
        _setImplementation(_logic);
        if (_data.length > 0) {
            (bool success, ) = _logic.delegatecall(_data);
            require(success);
        }
    }
}

File 7 of 18 : Proxy.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;

/**
 * @title Proxy
 * @dev Implements delegation of calls to other contracts, with proper
 * forwarding of return values and bubbling of failures.
 * It defines a fallback function that delegates all calls to the address
 * returned by the abstract _implementation() internal function.
 */
abstract contract Proxy {
    /**
     * @dev Fallback function.
     * Will run if no other function in the contract matches the call data.
     * Implemented entirely in `_fallback`.
     */
    fallback() external payable {
        _fallback();
    }

    /**
     * @return The Address of the implementation.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates execution to an implementation contract.
     * This is a low level function that doesn't return to its internal call site.
     * It will return to the external caller whatever the implementation returns.
     * @param implementation Address to delegate.
     */
    function _delegate(address implementation) internal {
        //solium-disable-next-line
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(
                gas(),
                implementation,
                0,
                calldatasize(),
                0,
                0
            )

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev Function that is run as the first thing in the fallback function.
     * Can be redefined in derived contracts to add functionality.
     * Redefinitions must call super._willFallback().
     */
    function _willFallback() internal virtual {}

    /**
     * @dev fallback implementation.
     * Extracted to enable manual triggering.
     */
    function _fallback() internal {
        _willFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive() external payable virtual {
        _fallback();
    }
}

File 8 of 18 : ConsiderationEnums.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// prettier-ignore
enum OrderType {
    // 0: no partial fills, anyone can execute
    FULL_OPEN,

    // 1: partial fills supported, anyone can execute
    PARTIAL_OPEN,

    // 2: no partial fills, only offerer or zone can execute
    FULL_RESTRICTED,

    // 3: partial fills supported, only offerer or zone can execute
    PARTIAL_RESTRICTED
}

// prettier-ignore
enum BasicOrderType {
    // 0: no partial fills, anyone can execute
    ETH_TO_ERC721_FULL_OPEN,

    // 1: partial fills supported, anyone can execute
    ETH_TO_ERC721_PARTIAL_OPEN,

    // 2: no partial fills, only offerer or zone can execute
    ETH_TO_ERC721_FULL_RESTRICTED,

    // 3: partial fills supported, only offerer or zone can execute
    ETH_TO_ERC721_PARTIAL_RESTRICTED,

    // 4: no partial fills, anyone can execute
    ETH_TO_ERC1155_FULL_OPEN,

    // 5: partial fills supported, anyone can execute
    ETH_TO_ERC1155_PARTIAL_OPEN,

    // 6: no partial fills, only offerer or zone can execute
    ETH_TO_ERC1155_FULL_RESTRICTED,

    // 7: partial fills supported, only offerer or zone can execute
    ETH_TO_ERC1155_PARTIAL_RESTRICTED,

    // 8: no partial fills, anyone can execute
    ERC20_TO_ERC721_FULL_OPEN,

    // 9: partial fills supported, anyone can execute
    ERC20_TO_ERC721_PARTIAL_OPEN,

    // 10: no partial fills, only offerer or zone can execute
    ERC20_TO_ERC721_FULL_RESTRICTED,

    // 11: partial fills supported, only offerer or zone can execute
    ERC20_TO_ERC721_PARTIAL_RESTRICTED,

    // 12: no partial fills, anyone can execute
    ERC20_TO_ERC1155_FULL_OPEN,

    // 13: partial fills supported, anyone can execute
    ERC20_TO_ERC1155_PARTIAL_OPEN,

    // 14: no partial fills, only offerer or zone can execute
    ERC20_TO_ERC1155_FULL_RESTRICTED,

    // 15: partial fills supported, only offerer or zone can execute
    ERC20_TO_ERC1155_PARTIAL_RESTRICTED,

    // 16: no partial fills, anyone can execute
    ERC721_TO_ERC20_FULL_OPEN,

    // 17: partial fills supported, anyone can execute
    ERC721_TO_ERC20_PARTIAL_OPEN,

    // 18: no partial fills, only offerer or zone can execute
    ERC721_TO_ERC20_FULL_RESTRICTED,

    // 19: partial fills supported, only offerer or zone can execute
    ERC721_TO_ERC20_PARTIAL_RESTRICTED,

    // 20: no partial fills, anyone can execute
    ERC1155_TO_ERC20_FULL_OPEN,

    // 21: partial fills supported, anyone can execute
    ERC1155_TO_ERC20_PARTIAL_OPEN,

    // 22: no partial fills, only offerer or zone can execute
    ERC1155_TO_ERC20_FULL_RESTRICTED,

    // 23: partial fills supported, only offerer or zone can execute
    ERC1155_TO_ERC20_PARTIAL_RESTRICTED
}

// prettier-ignore
enum BasicOrderRouteType {
    // 0: provide Ether (or other native token) to receive offered ERC721 item.
    ETH_TO_ERC721,

    // 1: provide Ether (or other native token) to receive offered ERC1155 item.
    ETH_TO_ERC1155,

    // 2: provide ERC20 item to receive offered ERC721 item.
    ERC20_TO_ERC721,

    // 3: provide ERC20 item to receive offered ERC1155 item.
    ERC20_TO_ERC1155,

    // 4: provide ERC721 item to receive offered ERC20 item.
    ERC721_TO_ERC20,

    // 5: provide ERC1155 item to receive offered ERC20 item.
    ERC1155_TO_ERC20
}

// prettier-ignore
enum ItemType {
    // 0: ETH on mainnet, MATIC on polygon, etc.
    NATIVE,

    // 1: ERC20 items (ERC777 and ERC20 analogues could also technically work)
    ERC20,

    // 2: ERC721 items
    ERC721,

    // 3: ERC1155 items
    ERC1155,

    // 4: ERC721 items where a number of tokenIds are supported
    ERC721_WITH_CRITERIA,

    // 5: ERC1155 items where a number of ids are supported
    ERC1155_WITH_CRITERIA
}

// prettier-ignore
enum Side {
    // 0: Items that can be spent
    OFFER,

    // 1: Items that must be received
    CONSIDERATION
}

File 9 of 18 : ConsiderationStructs.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {
    OrderType,
    BasicOrderType,
    ItemType,
    Side
} from "./ConsiderationEnums.sol";

/**
 * @dev An order contains eleven components: an offerer, a zone (or account that
 *      can cancel the order or restrict who can fulfill the order depending on
 *      the type), the order type (specifying partial fill support as well as
 *      restricted order status), the start and end time, a hash that will be
 *      provided to the zone when validating restricted orders, a salt, a key
 *      corresponding to a given conduit, a counter, and an arbitrary number of
 *      offer items that can be spent along with consideration items that must
 *      be received by their respective recipient.
 */
struct OrderComponents {
    address offerer;
    address zone;
    OfferItem[] offer;
    ConsiderationItem[] consideration;
    OrderType orderType;
    uint256 startTime;
    uint256 endTime;
    bytes32 zoneHash;
    uint256 salt;
    bytes32 conduitKey;
    uint256 counter;
}

/**
 * @dev An offer item has five components: an item type (ETH or other native
 *      tokens, ERC20, ERC721, and ERC1155, as well as criteria-based ERC721 and
 *      ERC1155), a token address, a dual-purpose "identifierOrCriteria"
 *      component that will either represent a tokenId or a merkle root
 *      depending on the item type, and a start and end amount that support
 *      increasing or decreasing amounts over the duration of the respective
 *      order.
 */
struct OfferItem {
    ItemType itemType;
    address token;
    uint256 identifierOrCriteria;
    uint256 startAmount;
    uint256 endAmount;
}

/**
 * @dev A consideration item has the same five components as an offer item and
 *      an additional sixth component designating the required recipient of the
 *      item.
 */
struct ConsiderationItem {
    ItemType itemType;
    address token;
    uint256 identifierOrCriteria;
    uint256 startAmount;
    uint256 endAmount;
    address payable recipient;
}

/**
 * @dev A spent item is translated from a utilized offer item and has four
 *      components: an item type (ETH or other native tokens, ERC20, ERC721, and
 *      ERC1155), a token address, a tokenId, and an amount.
 */
struct SpentItem {
    ItemType itemType;
    address token;
    uint256 identifier;
    uint256 amount;
}

/**
 * @dev A received item is translated from a utilized consideration item and has
 *      the same four components as a spent item, as well as an additional fifth
 *      component designating the required recipient of the item.
 */
struct ReceivedItem {
    ItemType itemType;
    address token;
    uint256 identifier;
    uint256 amount;
    address payable recipient;
}

/**
 * @dev For basic orders involving ETH / native / ERC20 <=> ERC721 / ERC1155
 *      matching, a group of six functions may be called that only requires a
 *      subset of the usual order arguments. Note the use of a "basicOrderType"
 *      enum; this represents both the usual order type as well as the "route"
 *      of the basic order (a simple derivation function for the basic order
 *      type is `basicOrderType = orderType + (4 * basicOrderRoute)`.)
 */
struct BasicOrderParameters {
    // calldata offset
    address considerationToken; // 0x24
    uint256 considerationIdentifier; // 0x44
    uint256 considerationAmount; // 0x64
    address payable offerer; // 0x84
    address zone; // 0xa4
    address offerToken; // 0xc4
    uint256 offerIdentifier; // 0xe4
    uint256 offerAmount; // 0x104
    BasicOrderType basicOrderType; // 0x124
    uint256 startTime; // 0x144
    uint256 endTime; // 0x164
    bytes32 zoneHash; // 0x184
    uint256 salt; // 0x1a4
    bytes32 offererConduitKey; // 0x1c4
    bytes32 fulfillerConduitKey; // 0x1e4
    uint256 totalOriginalAdditionalRecipients; // 0x204
    AdditionalRecipient[] additionalRecipients; // 0x224
    bytes signature; // 0x244
    // Total length, excluding dynamic array data: 0x264 (580)
}

/**
 * @dev Basic orders can supply any number of additional recipients, with the
 *      implied assumption that they are supplied from the offered ETH (or other
 *      native token) or ERC20 token for the order.
 */
struct AdditionalRecipient {
    uint256 amount;
    address payable recipient;
}

/**
 * @dev The full set of order components, with the exception of the counter,
 *      must be supplied when fulfilling more sophisticated orders or groups of
 *      orders. The total number of original consideration items must also be
 *      supplied, as the caller may specify additional consideration items.
 */
struct OrderParameters {
    address offerer; // 0x00
    address zone; // 0x20
    OfferItem[] offer; // 0x40
    ConsiderationItem[] consideration; // 0x60
    OrderType orderType; // 0x80
    uint256 startTime; // 0xa0
    uint256 endTime; // 0xc0
    bytes32 zoneHash; // 0xe0
    uint256 salt; // 0x100
    bytes32 conduitKey; // 0x120
    uint256 totalOriginalConsiderationItems; // 0x140
    // offer.length                          // 0x160
}

/**
 * @dev Orders require a signature in addition to the other order parameters.
 */
struct Order {
    OrderParameters parameters;
    bytes signature;
}

/**
 * @dev Advanced orders include a numerator (i.e. a fraction to attempt to fill)
 *      and a denominator (the total size of the order) in addition to the
 *      signature and other order parameters. It also supports an optional field
 *      for supplying extra data; this data will be included in a staticcall to
 *      `isValidOrderIncludingExtraData` on the zone for the order if the order
 *      type is restricted and the offerer or zone are not the caller.
 */
struct AdvancedOrder {
    OrderParameters parameters;
    uint120 numerator;
    uint120 denominator;
    bytes signature;
    bytes extraData;
}

/**
 * @dev Orders can be validated (either explicitly via `validate`, or as a
 *      consequence of a full or partial fill), specifically cancelled (they can
 *      also be cancelled in bulk via incrementing a per-zone counter), and
 *      partially or fully filled (with the fraction filled represented by a
 *      numerator and denominator).
 */
struct OrderStatus {
    bool isValidated;
    bool isCancelled;
    uint120 numerator;
    uint120 denominator;
}

/**
 * @dev A criteria resolver specifies an order, side (offer vs. consideration),
 *      and item index. It then provides a chosen identifier (i.e. tokenId)
 *      alongside a merkle proof demonstrating the identifier meets the required
 *      criteria.
 */
struct CriteriaResolver {
    uint256 orderIndex;
    Side side;
    uint256 index;
    uint256 identifier;
    bytes32[] criteriaProof;
}

/**
 * @dev A fulfillment is applied to a group of orders. It decrements a series of
 *      offer and consideration items, then generates a single execution
 *      element. A given fulfillment can be applied to as many offer and
 *      consideration items as desired, but must contain at least one offer and
 *      at least one consideration that match. The fulfillment must also remain
 *      consistent on all key parameters across all offer items (same offerer,
 *      token, type, tokenId, and conduit preference) as well as across all
 *      consideration items (token, type, tokenId, and recipient).
 */
struct Fulfillment {
    FulfillmentComponent[] offerComponents;
    FulfillmentComponent[] considerationComponents;
}

/**
 * @dev Each fulfillment component contains one index referencing a specific
 *      order and another referencing a specific offer or consideration item.
 */
struct FulfillmentComponent {
    uint256 orderIndex;
    uint256 itemIndex;
}

/**
 * @dev An execution is triggered once all consideration items have been zeroed
 *      out. It sends the item in question from the offerer to the item's
 *      recipient, optionally sourcing approvals from either this contract
 *      directly or from the offerer's chosen conduit if one is specified. An
 *      execution is not provided as an argument, but rather is derived via
 *      orders, criteria resolvers, and fulfillments (where the total number of
 *      executions will be less than or equal to the total number of indicated
 *      fulfillments) and returned as part of `matchOrders`.
 */
struct Execution {
    ReceivedItem item;
    address offerer;
    bytes32 conduitKey;
}

File 10 of 18 : IParaProxy.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

/******************************************************************************\
* EIP-2535: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/

interface IParaProxy {
    enum ProxyImplementationAction {
        Add,
        Replace,
        Remove
    }
    // Add=0, Replace=1, Remove=2

    struct ProxyImplementation {
        address implAddress;
        ProxyImplementationAction action;
        bytes4[] functionSelectors;
    }

    /// @notice Add/replace/remove any number of functions and optionally execute
    ///         a function with delegatecall
    /// @param _implementationParams Contains the implementation addresses and function selectors
    /// @param _init The address of the contract or implementation to execute _calldata
    /// @param _calldata A function call, including function selector and arguments
    ///                  _calldata is executed with delegatecall on _init
    function updateImplementation(
        ProxyImplementation[] calldata _implementationParams,
        address _init,
        bytes calldata _calldata
    ) external;

    event ImplementationUpdated(
        ProxyImplementation[] _implementationParams,
        address _init,
        bytes _calldata
    );
}

File 11 of 18 : IPoolAddressesProvider.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {DataTypes} from "../protocol/libraries/types/DataTypes.sol";
import {IParaProxy} from "../interfaces/IParaProxy.sol";

/**
 * @title IPoolAddressesProvider
 *
 * @notice Defines the basic interface for a Pool Addresses Provider.
 **/
interface IPoolAddressesProvider {
    /**
     * @dev Emitted when the market identifier is updated.
     * @param oldMarketId The old id of the market
     * @param newMarketId The new id of the market
     */
    event MarketIdSet(string indexed oldMarketId, string indexed newMarketId);

    /**
     * @dev Emitted when the pool is updated.
     * @param implementationParams The old address of the Pool
     * @param _init The new address to call upon upgrade
     * @param _calldata The calldata input for the call
     */
    event PoolUpdated(
        IParaProxy.ProxyImplementation[] indexed implementationParams,
        address _init,
        bytes _calldata
    );

    /**
     * @dev Emitted when the pool configurator is updated.
     * @param oldAddress The old address of the PoolConfigurator
     * @param newAddress The new address of the PoolConfigurator
     */
    event PoolConfiguratorUpdated(
        address indexed oldAddress,
        address indexed newAddress
    );

    /**
     * @dev Emitted when the WETH is updated.
     * @param oldAddress The old address of the WETH
     * @param newAddress The new address of the WETH
     */
    event WETHUpdated(address indexed oldAddress, address indexed newAddress);

    /**
     * @dev Emitted when the price oracle is updated.
     * @param oldAddress The old address of the PriceOracle
     * @param newAddress The new address of the PriceOracle
     */
    event PriceOracleUpdated(
        address indexed oldAddress,
        address indexed newAddress
    );

    /**
     * @dev Emitted when the ACL manager is updated.
     * @param oldAddress The old address of the ACLManager
     * @param newAddress The new address of the ACLManager
     */
    event ACLManagerUpdated(
        address indexed oldAddress,
        address indexed newAddress
    );

    /**
     * @dev Emitted when the ACL admin is updated.
     * @param oldAddress The old address of the ACLAdmin
     * @param newAddress The new address of the ACLAdmin
     */
    event ACLAdminUpdated(
        address indexed oldAddress,
        address indexed newAddress
    );

    /**
     * @dev Emitted when the price oracle sentinel is updated.
     * @param oldAddress The old address of the PriceOracleSentinel
     * @param newAddress The new address of the PriceOracleSentinel
     */
    event PriceOracleSentinelUpdated(
        address indexed oldAddress,
        address indexed newAddress
    );

    /**
     * @dev Emitted when the pool data provider is updated.
     * @param oldAddress The old address of the PoolDataProvider
     * @param newAddress The new address of the PoolDataProvider
     */
    event ProtocolDataProviderUpdated(
        address indexed oldAddress,
        address indexed newAddress
    );

    /**
     * @dev Emitted when a new proxy is created.
     * @param id The identifier of the proxy
     * @param proxyAddress The address of the created proxy contract
     * @param implementationAddress The address of the implementation contract
     */
    event ProxyCreated(
        bytes32 indexed id,
        address indexed proxyAddress,
        address indexed implementationAddress
    );

    /**
     * @dev Emitted when a new proxy is created.
     * @param id The identifier of the proxy
     * @param proxyAddress The address of the created proxy contract
     * @param implementationParams The params of the implementation update
     */
    event ParaProxyCreated(
        bytes32 indexed id,
        address indexed proxyAddress,
        IParaProxy.ProxyImplementation[] indexed implementationParams
    );

    /**
     * @dev Emitted when a new proxy is created.
     * @param id The identifier of the proxy
     * @param proxyAddress The address of the created proxy contract
     * @param implementationParams The params of the implementation update
     */
    event ParaProxyUpdated(
        bytes32 indexed id,
        address indexed proxyAddress,
        IParaProxy.ProxyImplementation[] indexed implementationParams
    );

    /**
     * @dev Emitted when a new non-proxied contract address is registered.
     * @param id The identifier of the contract
     * @param oldAddress The address of the old contract
     * @param newAddress The address of the new contract
     */
    event AddressSet(
        bytes32 indexed id,
        address indexed oldAddress,
        address indexed newAddress
    );

    /**
     * @dev Emitted when the implementation of the proxy registered with id is updated
     * @param id The identifier of the contract
     * @param proxyAddress The address of the proxy contract
     * @param oldImplementationAddress The address of the old implementation contract
     * @param newImplementationAddress The address of the new implementation contract
     */
    event AddressSetAsProxy(
        bytes32 indexed id,
        address indexed proxyAddress,
        address oldImplementationAddress,
        address indexed newImplementationAddress
    );

    /**
     * @dev Emitted when the marketplace registered is updated
     * @param id The identifier of the marketplace
     * @param marketplace The address of the marketplace contract
     * @param adapter The address of the marketplace adapter contract
     * @param operator The address of the marketplace transfer helper
     * @param paused Is the marketplace adapter paused
     */
    event MarketplaceUpdated(
        bytes32 indexed id,
        address indexed marketplace,
        address indexed adapter,
        address operator,
        bool paused
    );

    /**
     * @notice Returns the id of the ParaSpace market to which this contract points to.
     * @return The market id
     **/
    function getMarketId() external view returns (string memory);

    /**
     * @notice Associates an id with a specific PoolAddressesProvider.
     * @dev This can be used to create an onchain registry of PoolAddressesProviders to
     * identify and validate multiple ParaSpace markets.
     * @param newMarketId The market id
     */
    function setMarketId(string calldata newMarketId) external;

    /**
     * @notice Returns an address by its identifier.
     * @dev The returned address might be an EOA or a contract, potentially proxied
     * @dev It returns ZERO if there is no registered address with the given id
     * @param id The id
     * @return The address of the registered for the specified id
     */
    function getAddress(bytes32 id) external view returns (address);

    /**
     * @notice General function to update the implementation of a proxy registered with
     * certain `id`. If there is no proxy registered, it will instantiate one and
     * set as implementation the `newImplementationAddress`.
     * @dev IMPORTANT Use this function carefully, only for ids that don't have an explicit
     * setter function, in order to avoid unexpected consequences
     * @param id The id
     * @param newImplementationAddress The address of the new implementation
     */
    function setAddressAsProxy(bytes32 id, address newImplementationAddress)
        external;

    /**
     * @notice Sets an address for an id replacing the address saved in the addresses map.
     * @dev IMPORTANT Use this function carefully, as it will do a hard replacement
     * @param id The id
     * @param newAddress The address to set
     */
    function setAddress(bytes32 id, address newAddress) external;

    /**
     * @notice Returns the address of the Pool proxy.
     * @return The Pool proxy address
     **/
    function getPool() external view returns (address);

    /**
     * @notice Updates the implementation of the Pool, or creates a proxy
     * setting the new `pool` implementation when the function is called for the first time.
     * @param implementationParams Contains the implementation addresses and function selectors
     * @param _init The address of the contract or implementation to execute _calldata
     * @param _calldata A function call, including function selector and arguments
     *                  _calldata is executed with delegatecall on _init
     **/
    function updatePoolImpl(
        IParaProxy.ProxyImplementation[] calldata implementationParams,
        address _init,
        bytes calldata _calldata
    ) external;

    /**
     * @notice Returns the address of the PoolConfigurator proxy.
     * @return The PoolConfigurator proxy address
     **/
    function getPoolConfigurator() external view returns (address);

    /**
     * @notice Updates the implementation of the PoolConfigurator, or creates a proxy
     * setting the new `PoolConfigurator` implementation when the function is called for the first time.
     * @param newPoolConfiguratorImpl The new PoolConfigurator implementation
     **/
    function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external;

    /**
     * @notice Returns the address of the price oracle.
     * @return The address of the PriceOracle
     */
    function getPriceOracle() external view returns (address);

    /**
     * @notice Updates the address of the price oracle.
     * @param newPriceOracle The address of the new PriceOracle
     */
    function setPriceOracle(address newPriceOracle) external;

    /**
     * @notice Returns the address of the ACL manager.
     * @return The address of the ACLManager
     */
    function getACLManager() external view returns (address);

    /**
     * @notice Updates the address of the ACL manager.
     * @param newAclManager The address of the new ACLManager
     **/
    function setACLManager(address newAclManager) external;

    /**
     * @notice Returns the address of the ACL admin.
     * @return The address of the ACL admin
     */
    function getACLAdmin() external view returns (address);

    /**
     * @notice Updates the address of the ACL admin.
     * @param newAclAdmin The address of the new ACL admin
     */
    function setACLAdmin(address newAclAdmin) external;

    /**
     * @notice Returns the address of the price oracle sentinel.
     * @return The address of the PriceOracleSentinel
     */
    function getPriceOracleSentinel() external view returns (address);

    /**
     * @notice Updates the address of the price oracle sentinel.
     * @param newPriceOracleSentinel The address of the new PriceOracleSentinel
     **/
    function setPriceOracleSentinel(address newPriceOracleSentinel) external;

    /**
     * @notice Returns the address of the data provider.
     * @return The address of the DataProvider
     */
    function getPoolDataProvider() external view returns (address);

    /**
     * @notice Returns the address of the Wrapped ETH.
     * @return The address of the Wrapped ETH
     */
    function getWETH() external view returns (address);

    /**
     * @notice Returns the info of the marketplace.
     * @return The info of the marketplace
     */
    function getMarketplace(bytes32 id)
        external
        view
        returns (DataTypes.Marketplace memory);

    /**
     * @notice Updates the address of the data provider.
     * @param newDataProvider The address of the new DataProvider
     **/
    function setProtocolDataProvider(address newDataProvider) external;

    /**
     * @notice Updates the address of the WETH.
     * @param newWETH The address of the new WETH
     **/
    function setWETH(address newWETH) external;

    /**
     * @notice Updates the info of the marketplace.
     * @param marketplace The address of the marketplace
     *  @param adapter The contract which handles marketplace logic
     * @param operator The contract which operates users' tokens
     **/
    function setMarketplace(
        bytes32 id,
        address marketplace,
        address adapter,
        address operator,
        bool paused
    ) external;
}

File 12 of 18 : IStakefishValidator.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @title The interface for StakefishValidator
/// @notice Defines implementation of the wallet (deposit, withdraw, collect fees)
interface IStakefishValidator {
    enum State {
        PreDeposit,
        PostDeposit,
        Active,
        ExitRequested,
        Exited,
        Withdrawn,
        Burnable
    }

    /// @dev aligns into 32 byte
    struct StateChange {
        State state; // 1 byte
        bytes15 userData; // 15 byte (future use)
        uint128 changedAt; // 16 byte
    }

    function validatorIndex() external view returns (uint256);

    function pubkey() external view returns (bytes memory);

    function withdrawnBalance() external view returns (uint256);

    function feePoolAddress() external view returns (address);

    function stateHistory(uint256 index)
        external
        view
        returns (StateChange memory);

    /// @notice Inspect state of the change
    function lastStateChange() external view returns (StateChange memory);

    /// @notice NFT Owner requests a validator exit
    /// State.Running -> State.ExitRequested
    /// emit ValidatorExitRequest(pubkey)
    function requestExit() external;

    /// @notice user withdraw balance and charge a fee
    function withdraw() external;

    /// @notice get pending fee pool rewards
    function pendingFeePoolReward() external view returns (uint256, uint256);

    /// @notice claim fee pool and forward to nft owner
    function claimFeePool(uint256 amountRequested) external;

    function getProtocolFee() external view returns (uint256);

    function getNFTArtUrl() external view returns (string memory);

    /// @notice computes commission, useful for showing on UI
    function computeCommission(uint256 amount) external view returns (uint256);

    function render() external view returns (string memory);
}

File 13 of 18 : Errors.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

/**
 * @title Errors library
 *
 * @notice Defines the error messages emitted by the different contracts of the ParaSpace protocol
 */
library Errors {
    string public constant CALLER_NOT_POOL_ADMIN = "1"; // 'The caller of the function is not a pool admin'
    string public constant CALLER_NOT_EMERGENCY_ADMIN = "2"; // 'The caller of the function is not an emergency admin'
    string public constant CALLER_NOT_POOL_OR_EMERGENCY_ADMIN = "3"; // 'The caller of the function is not a pool or emergency admin'
    string public constant CALLER_NOT_RISK_OR_POOL_ADMIN = "4"; // 'The caller of the function is not a risk or pool admin'
    string public constant CALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN = "5"; // 'The caller of the function is not an asset listing or pool admin'
    string public constant CALLER_NOT_BRIDGE = "6"; // 'The caller of the function is not a bridge'
    string public constant ADDRESSES_PROVIDER_NOT_REGISTERED = "7"; // 'Pool addresses provider is not registered'
    string public constant INVALID_ADDRESSES_PROVIDER_ID = "8"; // 'Invalid id for the pool addresses provider'
    string public constant NOT_CONTRACT = "9"; // 'Address is not a contract'
    string public constant CALLER_NOT_POOL_CONFIGURATOR = "10"; // 'The caller of the function is not the pool configurator'
    string public constant CALLER_NOT_XTOKEN = "11"; // 'The caller of the function is not an PToken or NToken'
    string public constant INVALID_ADDRESSES_PROVIDER = "12"; // 'The address of the pool addresses provider is invalid'
    string public constant RESERVE_ALREADY_ADDED = "14"; // 'Reserve has already been added to reserve list'
    string public constant NO_MORE_RESERVES_ALLOWED = "15"; // 'Maximum amount of reserves in the pool reached'
    string public constant RESERVE_LIQUIDITY_NOT_ZERO = "18"; // 'The liquidity of the reserve needs to be 0'
    string public constant INVALID_RESERVE_PARAMS = "20"; // 'Invalid risk parameters for the reserve'
    string public constant CALLER_MUST_BE_POOL = "23"; // 'The caller of this function must be a pool'
    string public constant INVALID_MINT_AMOUNT = "24"; // 'Invalid amount to mint'
    string public constant INVALID_BURN_AMOUNT = "25"; // 'Invalid amount to burn'
    string public constant INVALID_AMOUNT = "26"; // 'Amount must be greater than 0'
    string public constant RESERVE_INACTIVE = "27"; // 'Action requires an active reserve'
    string public constant RESERVE_FROZEN = "28"; // 'Action cannot be performed because the reserve is frozen'
    string public constant RESERVE_PAUSED = "29"; // 'Action cannot be performed because the reserve is paused'
    string public constant BORROWING_NOT_ENABLED = "30"; // 'Borrowing is not enabled'
    string public constant STABLE_BORROWING_NOT_ENABLED = "31"; // 'Stable borrowing is not enabled'
    string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = "32"; // 'User cannot withdraw more than the available balance'
    string public constant INVALID_INTEREST_RATE_MODE_SELECTED = "33"; // 'Invalid interest rate mode selected'
    string public constant COLLATERAL_BALANCE_IS_ZERO = "34"; // 'The collateral balance is 0'
    string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD =
        "35"; // 'Health factor is lesser than the liquidation threshold'
    string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = "36"; // 'There is not enough collateral to cover a new borrow'
    string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = "37"; // 'Collateral is (mostly) the same currency that is being borrowed'
    string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = "38"; // 'The requested amount is greater than the max loan size in stable rate mode'
    string public constant NO_DEBT_OF_SELECTED_TYPE = "39"; // 'For repayment of a specific type of debt, the user needs to have debt that type'
    string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = "40"; // 'To repay on behalf of a user an explicit amount to repay is needed'
    string public constant NO_OUTSTANDING_STABLE_DEBT = "41"; // 'User does not have outstanding stable rate debt on this reserve'
    string public constant NO_OUTSTANDING_VARIABLE_DEBT = "42"; // 'User does not have outstanding variable rate debt on this reserve'
    string public constant UNDERLYING_BALANCE_ZERO = "43"; // 'The underlying balance needs to be greater than 0'
    string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = "44"; // 'Interest rate rebalance conditions were not met'
    string public constant HEALTH_FACTOR_NOT_BELOW_THRESHOLD = "45"; // 'Health factor is not below the threshold'
    string public constant COLLATERAL_CANNOT_BE_AUCTIONED_OR_LIQUIDATED = "46"; // 'The collateral chosen cannot be auctioned OR liquidated'
    string public constant SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER = "47"; // 'User did not borrow the specified currency'
    string public constant SAME_BLOCK_BORROW_REPAY = "48"; // 'Borrow and repay in same block is not allowed'
    string public constant BORROW_CAP_EXCEEDED = "50"; // 'Borrow cap is exceeded'
    string public constant SUPPLY_CAP_EXCEEDED = "51"; // 'Supply cap is exceeded'
    string public constant XTOKEN_SUPPLY_NOT_ZERO = "54"; // 'PToken supply is not zero'
    string public constant STABLE_DEBT_NOT_ZERO = "55"; // 'Stable debt supply is not zero'
    string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = "56"; // 'Variable debt supply is not zero'
    string public constant LTV_VALIDATION_FAILED = "57"; // 'Ltv validation failed'
    string public constant PRICE_ORACLE_SENTINEL_CHECK_FAILED = "59"; // 'Price oracle sentinel validation failed'
    string public constant RESERVE_ALREADY_INITIALIZED = "61"; // 'Reserve has already been initialized'
    string public constant INVALID_LTV = "63"; // 'Invalid ltv parameter for the reserve'
    string public constant INVALID_LIQ_THRESHOLD = "64"; // 'Invalid liquidity threshold parameter for the reserve'
    string public constant INVALID_LIQ_BONUS = "65"; // 'Invalid liquidity bonus parameter for the reserve'
    string public constant INVALID_DECIMALS = "66"; // 'Invalid decimals parameter of the underlying asset of the reserve'
    string public constant INVALID_RESERVE_FACTOR = "67"; // 'Invalid reserve factor parameter for the reserve'
    string public constant INVALID_BORROW_CAP = "68"; // 'Invalid borrow cap for the reserve'
    string public constant INVALID_SUPPLY_CAP = "69"; // 'Invalid supply cap for the reserve'
    string public constant INVALID_LIQUIDATION_PROTOCOL_FEE = "70"; // 'Invalid liquidation protocol fee for the reserve'
    string public constant INVALID_DEBT_CEILING = "73"; // 'Invalid debt ceiling for the reserve
    string public constant INVALID_RESERVE_INDEX = "74"; // 'Invalid reserve index'
    string public constant ACL_ADMIN_CANNOT_BE_ZERO = "75"; // 'ACL admin cannot be set to the zero address'
    string public constant INCONSISTENT_PARAMS_LENGTH = "76"; // 'Array parameters that should be equal length are not'
    string public constant ZERO_ADDRESS_NOT_VALID = "77"; // 'Zero address not valid'
    string public constant INVALID_EXPIRATION = "78"; // 'Invalid expiration'
    string public constant INVALID_SIGNATURE = "79"; // 'Invalid signature'
    string public constant OPERATION_NOT_SUPPORTED = "80"; // 'Operation not supported'
    string public constant ASSET_NOT_LISTED = "82"; // 'Asset is not listed'
    string public constant INVALID_OPTIMAL_USAGE_RATIO = "83"; // 'Invalid optimal usage ratio'
    string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = "84"; // 'Invalid optimal stable to total debt ratio'
    string public constant UNDERLYING_CANNOT_BE_RESCUED = "85"; // 'The underlying asset cannot be rescued'
    string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = "86"; // 'Reserve has already been added to reserve list'
    string public constant POOL_ADDRESSES_DO_NOT_MATCH = "87"; // 'The token implementation pool address and the pool address provided by the initializing pool do not match'
    string public constant STABLE_BORROWING_ENABLED = "88"; // 'Stable borrowing is enabled'
    string public constant SILOED_BORROWING_VIOLATION = "89"; // 'User is trying to borrow multiple assets including a siloed one'
    string public constant RESERVE_DEBT_NOT_ZERO = "90"; // the total debt of the reserve needs to be 0
    string public constant NOT_THE_OWNER = "91"; // user is not the owner of a given asset
    string public constant LIQUIDATION_AMOUNT_NOT_ENOUGH = "92";
    string public constant INVALID_ASSET_TYPE = "93"; // invalid asset type for action.
    string public constant INVALID_FLASH_CLAIM_RECEIVER = "94"; // invalid flash claim receiver.
    string public constant ERC721_HEALTH_FACTOR_NOT_BELOW_THRESHOLD = "95"; // ERC721 Health factor is not below the threshold. Can only liquidate ERC20.
    string public constant UNDERLYING_ASSET_CAN_NOT_BE_TRANSFERRED = "96"; //underlying asset can not be transferred.
    string public constant TOKEN_TRANSFERRED_CAN_NOT_BE_SELF_ADDRESS = "97"; //token transferred can not be self address.
    string public constant INVALID_AIRDROP_CONTRACT_ADDRESS = "98"; //invalid airdrop contract address.
    string public constant INVALID_AIRDROP_PARAMETERS = "99"; //invalid airdrop parameters.
    string public constant CALL_AIRDROP_METHOD_FAILED = "100"; //call airdrop method failed.
    string public constant SUPPLIER_NOT_NTOKEN = "101"; //supplier is not the NToken contract
    string public constant CALL_MARKETPLACE_FAILED = "102"; //call marketplace failed.
    string public constant INVALID_MARKETPLACE_ID = "103"; //invalid marketplace id.
    string public constant INVALID_MARKETPLACE_ORDER = "104"; //invalid marketplace id.
    string public constant CREDIT_DOES_NOT_MATCH_ORDER = "105"; //credit doesn't match order.
    string public constant PAYNOW_NOT_ENOUGH = "106"; //paynow not enough.
    string public constant INVALID_CREDIT_SIGNATURE = "107"; //invalid credit signature.
    string public constant INVALID_ORDER_TAKER = "108"; //invalid order taker.
    string public constant MARKETPLACE_PAUSED = "109"; //marketplace paused.
    string public constant INVALID_AUCTION_RECOVERY_HEALTH_FACTOR = "110"; //invalid auction recovery health factor.
    string public constant AUCTION_ALREADY_STARTED = "111"; //auction already started.
    string public constant AUCTION_NOT_STARTED = "112"; //auction not started yet.
    string public constant AUCTION_NOT_ENABLED = "113"; //auction not enabled on the reserve.
    string public constant ERC721_HEALTH_FACTOR_NOT_ABOVE_THRESHOLD = "114"; //ERC721 Health factor is not above the threshold.
    string public constant TOKEN_IN_AUCTION = "115"; //tokenId is in auction.
    string public constant AUCTIONED_BALANCE_NOT_ZERO = "116"; //auctioned balance not zero.
    string public constant LIQUIDATOR_CAN_NOT_BE_SELF = "117"; //user can not liquidate himself.
    string public constant INVALID_RECIPIENT = "118"; //invalid recipient specified in order.
    string public constant FLASHCLAIM_NOT_ALLOWED = "119"; //flash claim is not allowed for UniswapV3 & Stakefish
    string public constant NTOKEN_BALANCE_EXCEEDED = "120"; //ntoken balance exceed limit.
    string public constant ORACLE_PRICE_NOT_READY = "121"; //oracle price not ready.
    string public constant SET_ORACLE_SOURCE_NOT_ALLOWED = "122"; //source of oracle not allowed to set.
    string public constant INVALID_LIQUIDATION_ASSET = "123"; //invalid liquidation asset.
    string public constant XTOKEN_TYPE_NOT_ALLOWED = "124"; //the corresponding xTokenType not allowed in this action
    string public constant GLOBAL_DEBT_IS_ZERO = "125"; //liquidation is not allowed when global debt is zero.
    string public constant ORACLE_PRICE_EXPIRED = "126"; //oracle price expired.
    string public constant APE_STAKING_POSITION_EXISTED = "127"; //ape staking position is existed.
    string public constant SAPE_NOT_ALLOWED = "128"; //operation is not allow for sApe.
    string public constant TOTAL_STAKING_AMOUNT_WRONG = "129"; //cash plus borrow amount not equal to total staking amount.
    string public constant NOT_THE_BAKC_OWNER = "130"; //user is not the bakc owner.
    string public constant CALLER_NOT_EOA = "131"; //The caller of the function is not an EOA account
    string public constant MAKER_SAME_AS_TAKER = "132"; //maker and taker shouldn't be the same address
    string public constant TOKEN_ALREADY_DELEGATED = "133"; //token is already delegted
    string public constant INVALID_STATE = "134"; //invalid token status
    string public constant INVALID_TOKEN_ID = "135"; //invalid token id
    string public constant SENDER_SAME_AS_RECEIVER = "136"; //sender and receiver shouldn't be the same address
    string public constant INVALID_YIELD_UNDERLYING_TOKEN = "137"; //invalid yield underlying token
    string public constant CALLER_NOT_OPERATOR = "138"; // The caller of the function is not operator
    string public constant INVALID_FEE_VALUE = "139"; // invalid fee rate value
    string public constant TOKEN_NOT_ALLOW_RESCUE = "140"; // token is not allow rescue
}

File 14 of 18 : BaseImmutableAdminUpgradeabilityProxy.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {BaseUpgradeabilityProxy} from "../../../dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol";

/**
 * @title BaseImmutableAdminUpgradeabilityProxy
 * , inspired by the OpenZeppelin upgradeability proxy pattern
 * @notice This contract combines an upgradeability proxy with an authorization
 * mechanism for administrative tasks.
 * @dev The _admin role is stored in an immutable, which helps saving transactions costs
 * All external functions in this contract must be guarded by the
 * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
 * feature proposal that would enable this to be done automatically.
 */
contract BaseImmutableAdminUpgradeabilityProxy is BaseUpgradeabilityProxy {
    address internal immutable _admin;

    /**
     * @dev Constructor.
     * @param admin_ The address of the admin
     */
    constructor(address admin_) {
        _admin = admin_;
    }

    modifier ifAdmin() {
        if (msg.sender == _admin) {
            _;
        } else {
            _fallback();
        }
    }

    /**
     * @notice Return the admin address
     * @return The address of the proxy admin.
     */
    function admin() external ifAdmin returns (address) {
        return _admin;
    }

    /**
     * @notice Return the implementation address
     * @return The address of the implementation.
     */
    function implementation() external ifAdmin returns (address) {
        return _implementation();
    }

    /**
     * @notice Upgrade the backing implementation of the proxy.
     * @dev Only the admin can call this function.
     * @param newImplementation The address of the new implementation.
     */
    function upgradeTo(address newImplementation) external ifAdmin {
        _upgradeTo(newImplementation);
    }

    /**
     * @notice Upgrade the backing implementation of the proxy and call a function
     * on the new implementation.
     * @dev This is useful to initialize the proxied contract.
     * @param newImplementation The address of the new implementation.
     * @param data Data to send as msg.data in the low level call.
     * It should include the signature and the parameters of the function to be called, as described in
     * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
     */
    function upgradeToAndCall(address newImplementation, bytes calldata data)
        external
        payable
        ifAdmin
    {
        _upgradeTo(newImplementation);
        (bool success, ) = newImplementation.delegatecall(data);
        require(success);
    }

    /**
     * @notice Only fall back when the sender is not the admin.
     */
    function _willFallback() internal virtual override {
        require(
            msg.sender != _admin,
            "Cannot call fallback function from the proxy admin"
        );
        super._willFallback();
    }
}

File 15 of 18 : InitializableImmutableAdminUpgradeabilityProxy.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {InitializableUpgradeabilityProxy} from "../../../dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol";
import {Proxy} from "../../../dependencies/openzeppelin/upgradeability/Proxy.sol";
import {BaseImmutableAdminUpgradeabilityProxy} from "./BaseImmutableAdminUpgradeabilityProxy.sol";

/**
 * @title InitializableAdminUpgradeabilityProxy
 *
 * @dev Extends BaseAdminUpgradeabilityProxy with an initializer function
 */
contract InitializableImmutableAdminUpgradeabilityProxy is
    BaseImmutableAdminUpgradeabilityProxy,
    InitializableUpgradeabilityProxy
{
    /**
     * @dev Constructor.
     * @param admin The address of the admin
     */
    constructor(address admin) BaseImmutableAdminUpgradeabilityProxy(admin) {
        // Intentionally left blank
    }

    /// @inheritdoc BaseImmutableAdminUpgradeabilityProxy
    function _willFallback()
        internal
        override(BaseImmutableAdminUpgradeabilityProxy, Proxy)
    {
        BaseImmutableAdminUpgradeabilityProxy._willFallback();
    }
}

File 16 of 18 : ParaProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/******************************************************************************\
* A custom implementation of EIP-2535
* EIP-2535: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/

import {ParaProxyLib} from "./lib/ParaProxyLib.sol";
import {IParaProxy} from "../../../interfaces/IParaProxy.sol";

contract ParaProxy is IParaProxy {
    constructor(address _contractOwner) payable {
        ParaProxyLib.setContractOwner(_contractOwner);
    }

    function updateImplementation(
        ProxyImplementation[] calldata _implementationParams,
        address _init,
        bytes calldata _calldata
    ) external override {
        ParaProxyLib.enforceIsContractOwner();
        ParaProxyLib.updateImplementation(
            _implementationParams,
            _init,
            _calldata
        );
    }

    // Find implementation for function that is called and execute the
    // function if a implementation is found and return any value.
    fallback() external payable {
        ParaProxyLib.ProxyStorage storage ds;
        bytes32 position = ParaProxyLib.PROXY_STORAGE_POSITION;
        // get proxy storage
        assembly {
            ds.slot := position
        }
        // get implementation from function selector
        address implementation = ds
            .selectorToImplAndPosition[msg.sig]
            .implAddress;
        require(
            implementation != address(0),
            "ParaProxy: Function does not exist"
        );
        // Execute external function from implementation using delegatecall and return any value.
        assembly {
            // copy function selector and any arguments
            calldatacopy(0, 0, calldatasize())
            // execute function call using the implementation
            let result := delegatecall(
                gas(),
                implementation,
                0,
                calldatasize(),
                0,
                0
            )
            // get any return value
            returndatacopy(0, 0, returndatasize())
            // return any return value or error back to the caller
            switch result
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    receive() external payable {}
}

File 17 of 18 : ParaProxyLib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/******************************************************************************\
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/

import {IParaProxy} from "../../../../interfaces/IParaProxy.sol";

library ParaProxyLib {
    bytes32 constant PROXY_STORAGE_POSITION =
        bytes32(
            uint256(keccak256("paraspace.proxy.implementation.storage")) - 1
        );

    struct ImplementationAddressAndPosition {
        address implAddress;
        uint96 functionSelectorPosition; // position in implementationFunctionSelectors.functionSelectors array
    }

    struct ImplementationFunctionSelectors {
        bytes4[] functionSelectors;
        uint256 implementationAddressPosition; // position of implAddress in implementationAddresses array
    }

    struct ProxyStorage {
        // maps function selector to the implementation address and
        // the position of the selector in the implementationFunctionSelectors.selectors array
        mapping(bytes4 => ImplementationAddressAndPosition) selectorToImplAndPosition;
        // maps implementation addresses to function selectors
        mapping(address => ImplementationFunctionSelectors) implementationFunctionSelectors;
        // implementation addresses
        address[] implementationAddresses;
        // Used to query if a contract implements an interface.
        // Used to implement ERC-165.
        mapping(bytes4 => bool) supportedInterfaces;
        // owner of the contract
        address contractOwner;
    }

    function diamondStorage() internal pure returns (ProxyStorage storage ds) {
        bytes32 position = PROXY_STORAGE_POSITION;
        assembly {
            ds.slot := position
        }
    }

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

    function setContractOwner(address _newOwner) internal {
        ProxyStorage storage ds = diamondStorage();
        address previousOwner = ds.contractOwner;
        ds.contractOwner = _newOwner;
        emit OwnershipTransferred(previousOwner, _newOwner);
    }

    function contractOwner() internal view returns (address contractOwner_) {
        contractOwner_ = diamondStorage().contractOwner;
    }

    function enforceIsContractOwner() internal view {
        require(
            msg.sender == diamondStorage().contractOwner,
            "ParaProxy: Must be contract owner"
        );
    }

    event ImplementationUpdated(
        IParaProxy.ProxyImplementation[] _implementationData,
        address _init,
        bytes _calldata
    );

    // Internal function version of diamondCut
    function updateImplementation(
        IParaProxy.ProxyImplementation[] memory _implementationData,
        address _init,
        bytes memory _calldata
    ) internal {
        for (
            uint256 implIndex;
            implIndex < _implementationData.length;
            implIndex++
        ) {
            IParaProxy.ProxyImplementationAction action = _implementationData[
                implIndex
            ].action;
            if (action == IParaProxy.ProxyImplementationAction.Add) {
                addFunctions(
                    _implementationData[implIndex].implAddress,
                    _implementationData[implIndex].functionSelectors
                );
            } else if (action == IParaProxy.ProxyImplementationAction.Replace) {
                replaceFunctions(
                    _implementationData[implIndex].implAddress,
                    _implementationData[implIndex].functionSelectors
                );
            } else if (action == IParaProxy.ProxyImplementationAction.Remove) {
                removeFunctions(
                    _implementationData[implIndex].implAddress,
                    _implementationData[implIndex].functionSelectors
                );
            } else {
                revert("ParaProxy: Incorrect ProxyImplementationAction");
            }
        }
        emit ImplementationUpdated(_implementationData, _init, _calldata);
        initializeImplementation(_init, _calldata);
    }

    function addFunctions(
        address _implementationAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(
            _functionSelectors.length > 0,
            "ParaProxy: No selectors in implementation to cut"
        );
        ProxyStorage storage ds = diamondStorage();
        require(
            _implementationAddress != address(0),
            "ParaProxy: Add implementation can't be address(0)"
        );
        uint96 selectorPosition = uint96(
            ds
                .implementationFunctionSelectors[_implementationAddress]
                .functionSelectors
                .length
        );
        // add new implementation address if it does not exist
        if (selectorPosition == 0) {
            addFacet(ds, _implementationAddress);
        }
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;
            selectorIndex++
        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldImplementationAddress = ds
                .selectorToImplAndPosition[selector]
                .implAddress;
            require(
                oldImplementationAddress == address(0),
                "ParaProxy: Can't add function that already exists"
            );
            addFunction(ds, selector, selectorPosition, _implementationAddress);
            selectorPosition++;
        }
    }

    function replaceFunctions(
        address _implementationAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(
            _functionSelectors.length > 0,
            "ParaProxy: No selectors in implementation to cut"
        );
        ProxyStorage storage ds = diamondStorage();
        require(
            _implementationAddress != address(0),
            "ParaProxy: Add implementation can't be address(0)"
        );
        uint96 selectorPosition = uint96(
            ds
                .implementationFunctionSelectors[_implementationAddress]
                .functionSelectors
                .length
        );
        // add new implementation address if it does not exist
        if (selectorPosition == 0) {
            addFacet(ds, _implementationAddress);
        }
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;
            selectorIndex++
        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldImplementationAddress = ds
                .selectorToImplAndPosition[selector]
                .implAddress;
            require(
                oldImplementationAddress != _implementationAddress,
                "ParaProxy: Can't replace function with same function"
            );
            removeFunction(ds, oldImplementationAddress, selector);
            addFunction(ds, selector, selectorPosition, _implementationAddress);
            selectorPosition++;
        }
    }

    function removeFunctions(
        address _implementationAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(
            _functionSelectors.length > 0,
            "ParaProxy: No selectors in implementation to cut"
        );
        ProxyStorage storage ds = diamondStorage();
        // if function does not exist then do nothing and return
        require(
            _implementationAddress == address(0),
            "ParaProxy: Remove implementation address must be address(0)"
        );
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;
            selectorIndex++
        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldImplementationAddress = ds
                .selectorToImplAndPosition[selector]
                .implAddress;
            removeFunction(ds, oldImplementationAddress, selector);
        }
    }

    function addFacet(ProxyStorage storage ds, address _implementationAddress)
        internal
    {
        enforceHasContractCode(
            _implementationAddress,
            "ParaProxy: New implementation has no code"
        );
        ds
            .implementationFunctionSelectors[_implementationAddress]
            .implementationAddressPosition = ds.implementationAddresses.length;
        ds.implementationAddresses.push(_implementationAddress);
    }

    function addFunction(
        ProxyStorage storage ds,
        bytes4 _selector,
        uint96 _selectorPosition,
        address _implementationAddress
    ) internal {
        ds
            .selectorToImplAndPosition[_selector]
            .functionSelectorPosition = _selectorPosition;
        ds
            .implementationFunctionSelectors[_implementationAddress]
            .functionSelectors
            .push(_selector);
        ds
            .selectorToImplAndPosition[_selector]
            .implAddress = _implementationAddress;
    }

    function removeFunction(
        ProxyStorage storage ds,
        address _implementationAddress,
        bytes4 _selector
    ) internal {
        require(
            _implementationAddress != address(0),
            "ParaProxy: Can't remove function that doesn't exist"
        );
        // an immutable function is a function defined directly in a paraProxy
        require(
            _implementationAddress != address(this),
            "ParaProxy: Can't remove immutable function"
        );
        // replace selector with last selector, then delete last selector
        uint256 selectorPosition = ds
            .selectorToImplAndPosition[_selector]
            .functionSelectorPosition;
        uint256 lastSelectorPosition = ds
            .implementationFunctionSelectors[_implementationAddress]
            .functionSelectors
            .length - 1;
        // if not the same then replace _selector with lastSelector
        if (selectorPosition != lastSelectorPosition) {
            bytes4 lastSelector = ds
                .implementationFunctionSelectors[_implementationAddress]
                .functionSelectors[lastSelectorPosition];
            ds
                .implementationFunctionSelectors[_implementationAddress]
                .functionSelectors[selectorPosition] = lastSelector;
            ds
                .selectorToImplAndPosition[lastSelector]
                .functionSelectorPosition = uint96(selectorPosition);
        }
        // delete the last selector
        ds
            .implementationFunctionSelectors[_implementationAddress]
            .functionSelectors
            .pop();
        delete ds.selectorToImplAndPosition[_selector];

        // if no more selectors for implementation address then delete the implementation address
        if (lastSelectorPosition == 0) {
            // replace implementation address with last implementation address and delete last implementation address
            uint256 lastImplementationAddressPosition = ds
                .implementationAddresses
                .length - 1;
            uint256 implementationAddressPosition = ds
                .implementationFunctionSelectors[_implementationAddress]
                .implementationAddressPosition;
            if (
                implementationAddressPosition !=
                lastImplementationAddressPosition
            ) {
                address lastImplementationAddress = ds.implementationAddresses[
                    lastImplementationAddressPosition
                ];
                ds.implementationAddresses[
                    implementationAddressPosition
                ] = lastImplementationAddress;
                ds
                    .implementationFunctionSelectors[lastImplementationAddress]
                    .implementationAddressPosition = implementationAddressPosition;
            }
            ds.implementationAddresses.pop();
            delete ds
                .implementationFunctionSelectors[_implementationAddress]
                .implementationAddressPosition;
        }
    }

    function initializeImplementation(address _init, bytes memory _calldata)
        internal
    {
        if (_init == address(0)) {
            require(
                _calldata.length == 0,
                "ParaProxy: _init is address(0) but_calldata is not empty"
            );
        } else {
            require(
                _calldata.length > 0,
                "ParaProxy: _calldata is empty but _init is not address(0)"
            );
            if (_init != address(this)) {
                enforceHasContractCode(
                    _init,
                    "ParaProxy: _init address has no code"
                );
            }
            (bool success, bytes memory error) = _init.delegatecall(_calldata);
            if (!success) {
                if (error.length > 0) {
                    // bubble up the error
                    revert(string(error));
                } else {
                    revert("ParaProxy: _init function reverted");
                }
            }
        }
    }

    function enforceHasContractCode(
        address _contract,
        string memory _errorMessage
    ) internal view {
        uint256 contractSize;
        assembly {
            contractSize := extcodesize(_contract)
        }
        require(contractSize > 0, _errorMessage);
    }
}

File 18 of 18 : DataTypes.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import {OfferItem, ConsiderationItem} from "../../../dependencies/seaport/contracts/lib/ConsiderationStructs.sol";
import {IStakefishValidator} from "../../../interfaces/IStakefishValidator.sol";

library DataTypes {
    enum AssetType {
        ERC20,
        ERC721
    }

    address public constant SApeAddress = address(0x1);
    uint256 public constant HEALTH_FACTOR_LIQUIDATION_THRESHOLD = 1e18;

    struct ReserveData {
        //stores the reserve configuration
        ReserveConfigurationMap configuration;
        //the liquidity index. Expressed in ray
        uint128 liquidityIndex;
        //the current supply rate. Expressed in ray
        uint128 currentLiquidityRate;
        //variable borrow index. Expressed in ray
        uint128 variableBorrowIndex;
        //the current variable borrow rate. Expressed in ray
        uint128 currentVariableBorrowRate;
        //timestamp of last update
        uint40 lastUpdateTimestamp;
        //the id of the reserve. Represents the position in the list of the active reserves
        uint16 id;
        //xToken address
        address xTokenAddress;
        //variableDebtToken address
        address variableDebtTokenAddress;
        //address of the interest rate strategy
        address interestRateStrategyAddress;
        //address of the auction strategy
        address auctionStrategyAddress;
        //the current treasury balance, scaled
        uint128 accruedToTreasury;
        // timelock strategy
        address timeLockStrategyAddress;
        // use uint128 to be used for crosschain in the future
        // after position move
        uint128 unbacked;
    }

    struct ReserveConfigurationMap {
        //bit 0-15: LTV
        //bit 16-31: Liq. threshold
        //bit 32-47: Liq. bonus
        //bit 48-55: Decimals
        //bit 56: reserve is active
        //bit 57: reserve is frozen
        //bit 58: borrowing is enabled
        //bit 59: stable rate borrowing enabled
        //bit 60: asset is paused
        //bit 61: borrowing in isolation mode is enabled
        //bit 62-63: reserved
        //bit 64-79: reserve factor
        //bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap
        //bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap
        //bit 152-167 liquidation protocol fee
        //bit 168-175 eMode category
        //bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled
        //bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals
        //bit 252-255 unused

        uint256 data;
    }

    struct UserConfigurationMap {
        /**
         * @dev Bitmap of the users collaterals and borrows. It is divided in pairs of bits, one pair per asset.
         * The first bit indicates if an asset is used as collateral by the user, the second whether an
         * asset is borrowed by the user.
         */
        uint256 data;
        // auction validity time for closing invalid auctions in one tx.
        uint256 auctionValidityTime;
    }

    struct ERC721SupplyParams {
        uint256 tokenId;
        bool useAsCollateral;
    }

    struct StakefishNTokenData {
        uint256 validatorIndex;
        bytes pubkey;
        uint256 withdrawnBalance;
        address feePoolAddress;
        string nftArtUrl;
        uint256 protocolFee;
        IStakefishValidator.StateChange[] stateHistory;
        uint256[2] pendingFeePoolReward;
    }

    struct NTokenData {
        uint256 tokenId;
        uint256 multiplier;
        bool useAsCollateral;
        bool isAuctioned;
        StakefishNTokenData stakefishNTokenData;
    }

    struct ReserveCache {
        uint256 currScaledVariableDebt;
        uint256 nextScaledVariableDebt;
        uint256 currLiquidityIndex;
        uint256 nextLiquidityIndex;
        uint256 currVariableBorrowIndex;
        uint256 nextVariableBorrowIndex;
        uint256 currLiquidityRate;
        uint256 currVariableBorrowRate;
        uint256 reserveFactor;
        ReserveConfigurationMap reserveConfiguration;
        address xTokenAddress;
        address variableDebtTokenAddress;
        uint40 reserveLastUpdateTimestamp;
    }

    struct ExecuteLiquidateParams {
        uint256 reservesCount;
        uint256 liquidationAmount;
        uint256 collateralTokenId;
        uint256 auctionRecoveryHealthFactor;
        address weth;
        address collateralAsset;
        address liquidationAsset;
        address borrower;
        address liquidator;
        bool receiveXToken;
        address priceOracle;
        address priceOracleSentinel;
    }

    struct ExecuteAuctionParams {
        uint256 reservesCount;
        uint256 auctionRecoveryHealthFactor;
        uint256 collateralTokenId;
        address collateralAsset;
        address user;
        address priceOracle;
    }

    struct ExecuteSupplyParams {
        address asset;
        uint256 amount;
        address onBehalfOf;
        address payer;
        uint16 referralCode;
    }

    struct ExecuteSupplyERC721Params {
        address asset;
        DataTypes.ERC721SupplyParams[] tokenData;
        address onBehalfOf;
        address payer;
        uint16 referralCode;
    }

    struct ExecuteBorrowParams {
        address asset;
        address user;
        address onBehalfOf;
        uint256 amount;
        uint16 referralCode;
        bool releaseUnderlying;
        uint256 reservesCount;
        address oracle;
        address priceOracleSentinel;
    }

    struct ExecuteRepayParams {
        address asset;
        uint256 amount;
        address onBehalfOf;
        address payer;
        bool usePTokens;
    }

    struct ExecuteWithdrawParams {
        address asset;
        uint256 amount;
        address to;
        uint256 reservesCount;
        address oracle;
    }

    struct ExecuteWithdrawERC721Params {
        address asset;
        uint256[] tokenIds;
        address to;
        uint256 reservesCount;
        address oracle;
    }

    struct ExecuteDecreaseUniswapV3LiquidityParams {
        address user;
        address asset;
        uint256 tokenId;
        uint256 reservesCount;
        uint128 liquidityDecrease;
        uint256 amount0Min;
        uint256 amount1Min;
        bool receiveEthAsWeth;
        address oracle;
    }

    struct FinalizeTransferParams {
        address asset;
        address from;
        address to;
        bool usedAsCollateral;
        uint256 amount;
        uint256 balanceFromBefore;
        uint256 balanceToBefore;
        uint256 reservesCount;
        address oracle;
    }

    struct FinalizeTransferERC721Params {
        address asset;
        address from;
        address to;
        bool usedAsCollateral;
        uint256 tokenId;
        uint256 balanceFromBefore;
        uint256 reservesCount;
        address oracle;
    }

    struct CalculateUserAccountDataParams {
        UserConfigurationMap userConfig;
        uint256 reservesCount;
        address user;
        address oracle;
    }

    struct ValidateBorrowParams {
        ReserveCache reserveCache;
        UserConfigurationMap userConfig;
        address asset;
        address userAddress;
        uint256 amount;
        uint256 reservesCount;
        address oracle;
        address priceOracleSentinel;
    }

    struct ValidateLiquidateERC20Params {
        ReserveCache liquidationAssetReserveCache;
        address liquidationAsset;
        address weth;
        uint256 totalDebt;
        uint256 healthFactor;
        uint256 liquidationAmount;
        uint256 actualLiquidationAmount;
        address priceOracleSentinel;
    }

    struct ValidateLiquidateERC721Params {
        ReserveCache liquidationAssetReserveCache;
        address liquidationAsset;
        address liquidator;
        address borrower;
        uint256 globalDebt;
        uint256 healthFactor;
        address collateralAsset;
        uint256 tokenId;
        address weth;
        uint256 actualLiquidationAmount;
        uint256 maxLiquidationAmount;
        uint256 auctionRecoveryHealthFactor;
        address priceOracleSentinel;
        address xTokenAddress;
        bool auctionEnabled;
    }

    struct ValidateAuctionParams {
        address user;
        uint256 auctionRecoveryHealthFactor;
        uint256 erc721HealthFactor;
        address collateralAsset;
        uint256 tokenId;
        address xTokenAddress;
    }

    struct CalculateInterestRatesParams {
        uint256 liquidityAdded;
        uint256 liquidityTaken;
        uint256 totalVariableDebt;
        uint256 reserveFactor;
        address reserve;
        address xToken;
    }

    struct InitReserveParams {
        address asset;
        address xTokenAddress;
        address variableDebtAddress;
        address interestRateStrategyAddress;
        address auctionStrategyAddress;
        address timeLockStrategyAddress;
        uint16 reservesCount;
        uint16 maxNumberReserves;
    }

    struct ExecuteFlashClaimParams {
        address receiverAddress;
        address[] nftAssets;
        uint256[][] nftTokenIds;
        bytes params;
        address oracle;
    }

    struct Credit {
        address token;
        uint256 amount;
        bytes orderId;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    struct ExecuteMarketplaceParams {
        bytes32 marketplaceId;
        bytes payload;
        Credit credit;
        uint256 ethLeft;
        DataTypes.Marketplace marketplace;
        OrderInfo orderInfo;
        address weth;
        uint16 referralCode;
        uint256 reservesCount;
        address oracle;
        address priceOracleSentinel;
    }

    struct OrderInfo {
        address maker;
        address taker;
        bytes id;
        OfferItem[] offer;
        ConsiderationItem[] consideration;
    }

    struct Marketplace {
        address marketplace;
        address adapter;
        address operator;
        bool paused;
    }

    struct Auction {
        uint256 startTime;
    }

    struct AuctionData {
        address asset;
        uint256 tokenId;
        uint256 startTime;
        uint256 currentPriceMultiplier;
        uint256 maxPriceMultiplier;
        uint256 minExpPriceMultiplier;
        uint256 minPriceMultiplier;
        uint256 stepLinear;
        uint256 stepExp;
        uint256 tickLength;
    }

    struct TokenData {
        string symbol;
        address tokenAddress;
    }

    enum ApeCompoundType {
        SwapAndSupply
    }

    enum ApeCompoundTokenOut {
        USDC,
        WETH
    }

    struct ApeCompoundStrategy {
        ApeCompoundType ty;
        ApeCompoundTokenOut swapTokenOut;
        uint256 swapPercent;
    }

    struct PoolStorage {
        // Map of reserves and their data (underlyingAssetOfReserve => reserveData)
        mapping(address => ReserveData) _reserves;
        // Map of users address and their configuration data (userAddress => userConfiguration)
        mapping(address => UserConfigurationMap) _usersConfig;
        // List of reserves as a map (reserveId => reserve).
        // It is structured as a mapping for gas savings reasons, using the reserve id as index
        mapping(uint256 => address) _reservesList;
        // Maximum number of active reserves there have been in the protocol. It is the upper bound of the reserves list
        uint16 _reservesCount;
        // Auction recovery health factor
        uint64 _auctionRecoveryHealthFactor;
        // Incentive fee for claim ape reward to compound
        uint16 _apeCompoundFee;
        // Map of user's ape compound strategies
        mapping(address => ApeCompoundStrategy) _apeCompoundStrategies;
    }

    struct ReserveConfigData {
        uint256 decimals;
        uint256 ltv;
        uint256 liquidationThreshold;
        uint256 liquidationBonus;
        uint256 reserveFactor;
        bool usageAsCollateralEnabled;
        bool borrowingEnabled;
        bool isActive;
        bool isFrozen;
        bool isPaused;
    }

    struct TimeLockParams {
        uint48 releaseTime;
        TimeLockActionType actionType;
    }

    struct TimeLockFactorParams {
        AssetType assetType;
        address asset;
        uint256 amount;
    }

    enum TimeLockActionType {
        BORROW,
        WITHDRAW
    }

    struct ParaSpacePositionMoveInfo {
        address[] cTokens;
        DataTypes.AssetType[] cTypes;
        uint256[][] cAmountsOrTokenIds;
        address[] dTokens;
        uint256[] dAmounts;
        address to;
    }

    struct ParaSpacePositionMoveParams {
        address user;
        address[] cTokens;
        DataTypes.AssetType[] cTypes;
        uint256[][] cAmountsOrTokenIds;
        address[] dTokens;
        uint256[] dAmounts;
        address to;
        address priceOracle;
        address priceOracleSentinel;
        uint256 reservesCount;
    }
}

Settings
{
  "remappings": [
    "contracts/=contracts/",
    "ds-test/=lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "pnm-contracts/=lib/pnm-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"marketId","type":"string"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"ACLAdminUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"ACLManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"AddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"proxyAddress","type":"address"},{"indexed":false,"internalType":"address","name":"oldImplementationAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementationAddress","type":"address"}],"name":"AddressSetAsProxy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"oldMarketId","type":"string"},{"indexed":true,"internalType":"string","name":"newMarketId","type":"string"}],"name":"MarketIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"marketplace","type":"address"},{"indexed":true,"internalType":"address","name":"adapter","type":"address"},{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"MarketplaceUpdated","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":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"proxyAddress","type":"address"},{"components":[{"internalType":"address","name":"implAddress","type":"address"},{"internalType":"enum IParaProxy.ProxyImplementationAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"indexed":true,"internalType":"struct IParaProxy.ProxyImplementation[]","name":"implementationParams","type":"tuple[]"}],"name":"ParaProxyCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"proxyAddress","type":"address"},{"components":[{"internalType":"address","name":"implAddress","type":"address"},{"internalType":"enum IParaProxy.ProxyImplementationAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"indexed":true,"internalType":"struct IParaProxy.ProxyImplementation[]","name":"implementationParams","type":"tuple[]"}],"name":"ParaProxyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"PoolConfiguratorUpdated","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"implAddress","type":"address"},{"internalType":"enum IParaProxy.ProxyImplementationAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"indexed":true,"internalType":"struct IParaProxy.ProxyImplementation[]","name":"implementationParams","type":"tuple[]"},{"indexed":false,"internalType":"address","name":"_init","type":"address"},{"indexed":false,"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"PoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"PriceOracleSentinelUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"PriceOracleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"ProtocolDataProviderUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"proxyAddress","type":"address"},{"indexed":true,"internalType":"address","name":"implementationAddress","type":"address"}],"name":"ProxyCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"WETHUpdated","type":"event"},{"inputs":[],"name":"getACLAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getACLManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMarketId","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"getMarketplace","outputs":[{"components":[{"internalType":"address","name":"marketplace","type":"address"},{"internalType":"address","name":"adapter","type":"address"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"paused","type":"bool"}],"internalType":"struct DataTypes.Marketplace","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolConfigurator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolDataProvider","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPriceOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPriceOracleSentinel","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAclAdmin","type":"address"}],"name":"setACLAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAclManager","type":"address"}],"name":"setACLManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address","name":"newAddress","type":"address"}],"name":"setAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address","name":"newImplementationAddress","type":"address"}],"name":"setAddressAsProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newMarketId","type":"string"}],"name":"setMarketId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address","name":"marketplace","type":"address"},{"internalType":"address","name":"adapter","type":"address"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"paused","type":"bool"}],"name":"setMarketplace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPoolConfiguratorImpl","type":"address"}],"name":"setPoolConfiguratorImpl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPriceOracle","type":"address"}],"name":"setPriceOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPriceOracleSentinel","type":"address"}],"name":"setPriceOracleSentinel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newDataProvider","type":"address"}],"name":"setProtocolDataProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newWETH","type":"address"}],"name":"setWETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"implAddress","type":"address"},{"internalType":"enum IParaProxy.ProxyImplementationAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IParaProxy.ProxyImplementation[]","name":"implementationParams","type":"tuple[]"},{"internalType":"address","name":"_init","type":"address"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"updatePoolImpl","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162004351380380620043518339810160408190526200003491620002f1565b600080546001600160a01b0319163390811782556040519091829160008051602062004331833981519152908290a3506200006f8262000082565b6200007a8162000187565b505062000537565b6000600180546200009390620003be565b80601f0160208091040260200160405190810160405280929190818152602001828054620000c190620003be565b8015620001125780601f10620000e65761010080835404028352916020019162000112565b820191906000526020600020905b815481529060010190602001808311620000f457829003601f168201915b5050505050905081600190816200012a91906200044d565b50816040516200013b919062000519565b60405180910390208160405162000153919062000519565b604051908190038120907fe685c8cdecc6030c45030fd54778812cb84ed8e4467c38294403d68ba786082390600090a35050565b6000546001600160a01b03163314620001e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0381166200024e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620001de565b600080546040516001600160a01b03808516939216916000805160206200433183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620002cb578181015183820152602001620002b1565b50506000910152565b80516001600160a01b0381168114620002ec57600080fd5b919050565b600080604083850312156200030557600080fd5b82516001600160401b03808211156200031d57600080fd5b818501915085601f8301126200033257600080fd5b81518181111562000347576200034762000298565b604051601f8201601f19908116603f0116810190838211818310171562000372576200037262000298565b816040528281528860208487010111156200038c57600080fd5b6200039f836020830160208801620002ae565b8096505050505050620003b560208401620002d4565b90509250929050565b600181811c90821680620003d357607f821691505b602082108103620003f457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200044857600081815260208120601f850160051c81016020861015620004235750805b601f850160051c820191505b8181101562000444578281556001016200042f565b5050505b505050565b81516001600160401b0381111562000469576200046962000298565b62000481816200047a8454620003be565b84620003fa565b602080601f831160018114620004b95760008415620004a05750858301515b600019600386901b1c1916600185901b17855562000444565b600085815260208120601f198616915b82811015620004ea57888601518255948401946001909101908401620004c9565b5085821015620005095787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200052d818460208701620002ae565b9190910192915050565b613dea80620005476000396000f3fe60806040523480156200001157600080fd5b5060043610620001af5760003560e01c806376d84ffc11620000f0578063e4ca28b711620000a3578063f2fde38b116200007a578063f2fde38b14620003a5578063f3af858a14620003bc578063f67b184714620003d3578063fca513a814620003ea57600080fd5b8063e4ca28b7146200036d578063e860accb1462000384578063ed301ca9146200038e57600080fd5b806376d84ffc14620002b25780638da5cb5b14620002c9578063ca446dd914620002db578063cae5f11e14620002f2578063e0f31eb514620002fc578063e4501d29146200035657600080fd5b80635b769f3c1162000166578063631adfca116200013d578063631adfca146200027d578063707cd7161462000287578063715018a6146200029157806374944cec146200029b57600080fd5b80635b769f3c14620002455780635dcc528c146200025c5780635eb88d3d146200027357600080fd5b8063026b1d5f14620001b45780630e67178c14620001db57806321f8a72114620001e55780634585264a14620001fc578063530e784f1462000215578063568ef470146200022c575b600080fd5b620001be620003f4565b6040516001600160a01b0390911681526020015b60405180910390f35b620001be6200040d565b620001be620001f636600462001626565b62000421565b620002136200020d36600462001668565b6200043c565b005b6200021362000226366004620016dd565b62000568565b620002366200061d565b604051620001d2919062001758565b6200021362000256366004620016dd565b620006b7565b620002136200026d3660046200176d565b62000764565b620001be62000853565b620001be62000878565b620001be62000899565b62000213620008b4565b62000213620002ac366004620016dd565b6200092b565b62000213620002c3366004620016dd565b620009e9565b6000546001600160a01b0316620001be565b62000213620002ec3660046200176d565b62000a9b565b620001be62000b26565b620003136200030d36600462001626565b62000b3a565b6040805182516001600160a01b039081168252602080850151821690830152838301511691810191909152606091820151151591810191909152608001620001d2565b6200021362000367366004620016dd565b62000c15565b620002136200037e366004620016dd565b62000ccb565b620001be62000d7f565b620002136200039f366004620016dd565b62000d9c565b62000213620003b6366004620016dd565b62000e50565b62000213620003cd366004620017ec565b62000f3f565b62000213620003e4366004620018be565b62000fe1565b620001be6200101c565b600062000408631413d3d360e21b62000421565b905090565b6000620004086820a1a62fa0a226a4a760b91b5b6000908152600260205260409020546001600160a01b031690565b6000546001600160a01b03163314620004725760405162461bcd60e51b8152600401620004699062001979565b60405180910390fd5b604080516080810182526001600160a01b0380871680835286821660208085018281528885168688019081528815156060880190815260008e8152600390945292889020965187549087166001600160a01b031991821617885591516001880180549188169190931617909155516002909501805491511515600160a01b026001600160a81b0319909216959094169490941793909317909155915190919087907f1d6ec4e10cedd4a2a652d0be45309f11e682fef6bb970c752a48cba872a6ae86906200055990879087906001600160a01b039290921682521515602082015260400190565b60405180910390a45050505050565b6000546001600160a01b03163314620005955760405162461bcd60e51b8152600401620004699062001979565b6b50524943455f4f5241434c4560a01b600090815260026020527f740f710666bd7a12af42df98311e541e47f7fd33d382d11602457a6d540cbd6380546001600160a01b038481166001600160a01b03198316811790935560405191169283917f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd9190a35050565b6060600180546200062e90620019ae565b80601f01602080910402602001604051908101604052809291908181526020018280546200065c90620019ae565b8015620006ad5780601f106200068157610100808354040283529160200191620006ad565b820191906000526020600020905b8154815290600101906020018083116200068f57829003601f168201915b5050505050905090565b6000546001600160a01b03163314620006e45760405162461bcd60e51b8152600401620004699062001979565b630ae8aa8960e31b600090815260026020527f9d079330cab48a13979924dfd7e87d65711257c575e853d3b075acf5fc8707c780546001600160a01b038481166001600160a01b03198316811790935560405191169283917f1c08ec67b877c60261a1d95ebb7f008d38470096d29e66d715aed49e66ee8f5a9190a35050565b6000546001600160a01b03163314620007915760405162461bcd60e51b8152600401620004699062001979565b6040805180820190915260018152600760fb1b6020820152631413d3d360e21b8303620007d35760405162461bcd60e51b815260040162000469919062001758565b506000828152600260205260408120546001600160a01b031690620007f88462001038565b9050620008068484620010d3565b6040516001600160a01b038281168252808516919084169086907f3bbd45b5429b385e3fb37ad5cd1cd1435a3c8ec32196c7937597365a3fd3e99c9060200160405180910390a450505050565b6000620004087414149250d157d3d49050d31157d4d1539512539153605a1b62000421565b600062000408702827a7a62fa1a7a72324a3aaa920aa27a960791b62000421565b6000620004086a20a1a62fa6a0a720a3a2a960a91b62000421565b6000546001600160a01b03163314620008e15760405162461bcd60e51b8152600401620004699062001979565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314620009585760405162461bcd60e51b8152600401620004699062001979565b7414149250d157d3d49050d31157d4d1539512539153605a1b600090815260026020527f0d2c1bcee56447b4f46248272f34207a580a5c40f666a31f4e2fbb470ea53ab880546001600160a01b038481166001600160a01b03198316811790935560405191169283917f5326514eeca90494a14bedabcff812a0e683029ee85d1e23824d44fd14cd6ae79190a35050565b6000546001600160a01b0316331462000a165760405162461bcd60e51b8152600401620004699062001979565b6820a1a62fa0a226a4a760b91b600090815260026020527ffab167ad2009dcb80ee379700bb4bd029d97c1181ed9d961625632c8a6f051c680546001600160a01b038481166001600160a01b03198316811790935560405191169283917fe9cf53972264dc95304fd424458745019ddfca0e37ae8f703d74772c41ad115b9190a35050565b6000546001600160a01b0316331462000ac85760405162461bcd60e51b8152600401620004699062001979565b60008281526002602052604080822080546001600160a01b031981166001600160a01b038681169182179093559251911692839186917f9ef0e8c8e52743bb38b83b17d9429141d494b8041ca6d616a6c77cebae9cd8b791a4505050565b600062000408630ae8aa8960e31b62000421565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260036020908152604091829020825160808101845281546001600160a01b03908116808352600184015482169483019490945260029092015491821693810193909352600160a01b900460ff16151560608301521580159062000bd0575080516001600160a01b03163b15155b1562000bdc5792915050565b604080518082018252600381526231303360e81b6020820152905162461bcd60e51b815262000469919060040162001758565b50919050565b6000546001600160a01b0316331462000c425760405162461bcd60e51b8152600401620004699062001979565b6c2220aa20afa82927ab24a222a960991b600090815260026020527fcd7944601aaa5cd7ccdae1bebec659e98c6aac8f12486b30e59db0d39698051f80546001600160a01b038481166001600160a01b03198316811790935560405191169283917fc2c64a506949ea6b362b49fdfd78dbeade68586ea45c44edb102a311d3535dde9190a35050565b6000546001600160a01b0316331462000cf85760405162461bcd60e51b8152600401620004699062001979565b600062000d19702827a7a62fa1a7a72324a3aaa920aa27a960791b62001038565b905062000d3b702827a7a62fa1a7a72324a3aaa920aa27a960791b83620010d3565b816001600160a01b0316816001600160a01b03167f8932892569eba59c8382a089d9b732d1f49272878775235761a2a6b0309cd46560405160405180910390a35050565b6000620004086c2220aa20afa82927ab24a222a960991b62000421565b6000546001600160a01b0316331462000dc95760405162461bcd60e51b8152600401620004699062001979565b6a20a1a62fa6a0a720a3a2a960a91b600090815260026020527f9edef266ef35fd0c6e131df0f31a330f3dd4c4d19dd31ed615c21d005c68116b80546001600160a01b038481166001600160a01b03198316811790935560405191169283917fb30efa04327bb8a537d61cc1e5c48095345ad18ef7cc04e6bacf7dfb6caaf5079190a35050565b6000546001600160a01b0316331462000e7d5760405162461bcd60e51b8152600401620004699062001979565b6001600160a01b03811662000ee45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000469565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331462000f6c5760405162461bcd60e51b8152600401620004699062001979565b62000f83631413d3d360e21b8686868686620012f4565b848460405162000f9592919062001a9c565b60405180910390207f04bca245412c4584bfbdbd2d543feaac9e454dc3764b86c9837eed246531f4dc84848460405162000fd29392919062001b81565b60405180910390a25050505050565b6000546001600160a01b031633146200100e5760405162461bcd60e51b8152600401620004699062001979565b620010198162001505565b50565b6000620004086b50524943455f4f5241434c4560a01b62000421565b6000818152600260205260408120546001600160a01b0316806200105f5750600092915050565b6000819050806001600160a01b0316635c60da1b6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015620010a5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010cb919062001bb1565b949350505050565b604080518082019091526002815261373760f01b60208201526001600160a01b038216620011165760405162461bcd60e51b815260040162000469919062001758565b506000828152600260205260408082205490513060248201526001600160a01b039091169190819060440160408051601f198184030181529190526020810180516001600160e01b031663189acdbd60e31b17905290506001600160a01b0383166200128557306040516200118b906200160a565b6001600160a01b039091168152602001604051809103906000f080158015620011b8573d6000803e3d6000fd5b5060405163347d5e2560e21b81529092506001600160a01b0383169063d1f5789490620011ec908790859060040162001bd1565b600060405180830381600087803b1580156200120757600080fd5b505af11580156200121c573d6000803e3d6000fd5b50505060008681526002602052604080822080546001600160a01b0319166001600160a01b03878116918217909255915195965086959088169350909188917f4a465a9bd819d9662563c1e11ae958f8109e437e7f4bf1c6ef0b9a7b3f35d4789190a4620012ed565b60405163278f794360e11b81528392506001600160a01b03831690634f1ef28690620012b8908790859060040162001bd1565b600060405180830381600087803b158015620012d357600080fd5b505af1158015620012e8573d6000803e3d6000fd5b505050505b5050505050565b6000868152600260205260408120546001600160a01b031690816200143e5730604051620013229062001618565b6001600160a01b039091168152602001604051809103906000f0801580156200134f573d6000803e3d6000fd5b50604051635a83399160e01b81529091506001600160a01b03821690635a8339919062001389908a908a908a908a908a9060040162001bf7565b600060405180830381600087803b158015620013a457600080fd5b505af1158015620013b9573d6000803e3d6000fd5b5050506000898152600260205260409081902080546001600160a01b0319166001600160a01b038516179055519192508291620013fb91508890889062001a9c565b604051908190038120906001600160a01b038416908a907fc98c4080dbb73b6ab93d55682dc2921c0acc2ce5a7dbe170be426b691301f31690600090a4620014fb565b50604051635a83399160e01b815281906001600160a01b03821690635a8339919062001477908a908a908a908a908a9060040162001bf7565b600060405180830381600087803b1580156200149257600080fd5b505af1158015620014a7573d6000803e3d6000fd5b505050508686604051620014bd92919062001a9c565b604051908190038120906001600160a01b038416908a907f7364d7b110775dfa21e4e4d3339c6962e91ab9cc8abdec6c9ec1dc435cdd606e90600090a45b5050505050505050565b6000600180546200151690620019ae565b80601f01602080910402602001604051908101604052809291908181526020018280546200154490620019ae565b8015620015955780601f10620015695761010080835404028352916020019162001595565b820191906000526020600020905b8154815290600101906020018083116200157757829003601f168201915b505050505090508160019081620015ad919062001d60565b5081604051620015be919062001e2d565b604051809103902081604051620015d6919062001e2d565b604051908190038120907fe685c8cdecc6030c45030fd54778812cb84ed8e4467c38294403d68ba786082390600090a35050565b6108558062001e4c83390190565b61171480620026a183390190565b6000602082840312156200163957600080fd5b5035919050565b6001600160a01b03811681146200101957600080fd5b8035620016638162001640565b919050565b600080600080600060a086880312156200168157600080fd5b853594506020860135620016958162001640565b93506040860135620016a78162001640565b92506060860135620016b98162001640565b915060808601358015158114620016cf57600080fd5b809150509295509295909350565b600060208284031215620016f057600080fd5b8135620016fd8162001640565b9392505050565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b602081526000620016fd60208301846200172a565b600080604083850312156200178157600080fd5b823591506020830135620017958162001640565b809150509250929050565b60008083601f840112620017b357600080fd5b50813567ffffffffffffffff811115620017cc57600080fd5b602083019150836020828501011115620017e557600080fd5b9250929050565b6000806000806000606086880312156200180557600080fd5b853567ffffffffffffffff808211156200181e57600080fd5b818801915088601f8301126200183357600080fd5b8135818111156200184357600080fd5b8960208260051b85010111156200185957600080fd5b60208301975080965050620018716020890162001656565b945060408801359150808211156200188857600080fd5b506200189788828901620017a0565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215620018d157600080fd5b813567ffffffffffffffff80821115620018ea57600080fd5b818401915084601f830112620018ff57600080fd5b813581811115620019145762001914620018a8565b604051601f8201601f19908116603f011681019083821181831017156200193f576200193f620018a8565b816040528281528760208487010111156200195957600080fd5b826020860160208301376000928101602001929092525095945050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680620019c357607f821691505b60208210810362000c0f57634e487b7160e01b600052602260045260246000fd5b8035600381106200166357600080fd5b6003811062001a1357634e487b7160e01b600052602160045260246000fd5b9052565b6000808335601e1984360301811262001a2f57600080fd5b830160208101925035905067ffffffffffffffff81111562001a5057600080fd5b8060051b3603821315620017e557600080fd5b80356001600160e01b0319811681146200166357600080fd5b60008235605e1983360301811262001a9357600080fd5b90910192915050565b6000818482805b8681101562001b4c5762001ab8838962001a7c565b803562001ac58162001640565b6001600160a01b03168552602062001aec81870162001ae6848401620019e4565b620019f4565b604080870162001aff8285018562001a17565b9450915085905b8482101562001b39576001600160e01b031962001b238462001a63565b1681529183019160019190910190830162001b06565b9750505093909301925060010162001aa3565b50919695505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009062001ba8908301848662001b58565b95945050505050565b60006020828403121562001bc457600080fd5b8151620016fd8162001640565b6001600160a01b0383168152604060208201819052600090620010cb908301846200172a565b60608082528181018690526000906080808401600589901b850182018a85805b8c81101562001cd757888403607f1901855262001c35838f62001a7c565b878501813562001c458162001640565b6001600160a01b03168652602062001c5f838201620019e4565b62001c6d82890182620019f4565b50604062001c7e8185018562001a17565b9189018c9052928190529250888701855b8481101562001cc0576001600160e01b031962001cac8562001a63565b168252928201929082019060010162001c8f565b509781019796509490940193505060010162001c17565b5050506001600160a01b0389166020870152858103604087015262001cfe81888a62001b58565b9b9a5050505050505050505050565b601f82111562001d5b57600081815260208120601f850160051c8101602086101562001d365750805b601f850160051c820191505b8181101562001d575782815560010162001d42565b5050505b505050565b815167ffffffffffffffff81111562001d7d5762001d7d620018a8565b62001d958162001d8e8454620019ae565b8462001d0d565b602080601f83116001811462001dcd576000841562001db45750858301515b600019600386901b1c1916600185901b17855562001d57565b600085815260208120601f198616915b8281101562001dfe5788860151825594840194600190910190840162001ddd565b508582101562001e1d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825162001e4181846020870162001704565b919091019291505056fe60a060405234801561001057600080fd5b5060405161085538038061085583398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516107a76100ae60003960008181610123015281816101670152818161021f0152818161035e0152818161038701526104b301526107a76000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b14610098578063d1f57894146100c9578063f851a440146100dc5761005d565b3661005d5761005b6100f1565b005b61005b6100f1565b34801561007157600080fd5b5061005b610080366004610558565b610119565b61005b61009336600461057a565b61015d565b3480156100a457600080fd5b506100ad610213565b6040516001600160a01b03909116815260200160405180910390f35b61005b6100d7366004610613565b610264565b3480156100e857600080fd5b506100ad610352565b6100f96103a9565b6101176101126000805160206107528339815191525490565b6103b1565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361015557610152816103d5565b50565b6101526100f1565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361020657610196836103d5565b6000836001600160a01b031683836040516101b29291906106d5565b600060405180830381855af49150503d80600081146101ed576040519150601f19603f3d011682016040523d82523d6000602084013e6101f2565b606091505b505090508061020057600080fd5b50505050565b61020e6100f1565b505050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361025957506000805160206107528339815191525490565b6102616100f1565b90565b600061027c6000805160206107528339815191525490565b6001600160a01b03161461028f57600080fd5b6102ba60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6106e5565b600080516020610752833981519152146102d6576102d661070c565b6102df82610415565b80511561034e576000826001600160a01b0316826040516103009190610722565b600060405180830381855af49150503d806000811461033b576040519150601f19603f3d011682016040523d82523d6000602084013e610340565b606091505b505090508061020e57600080fd5b5050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361025957507f000000000000000000000000000000000000000000000000000000000000000090565b6101176104a9565b3660008037600080366000845af43d6000803e8080156103d0573d6000f35b3d6000fd5b6103de81610415565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381163b6104975760405162461bcd60e51b815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000060648201526084015b60405180910390fd5b60008051602061075283398151915255565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101175760405162461bcd60e51b815260206004820152603260248201527f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667260448201527137b6903a343290383937bc3c9030b236b4b760711b606482015260840161048e565b80356001600160a01b038116811461055357600080fd5b919050565b60006020828403121561056a57600080fd5b6105738261053c565b9392505050565b60008060006040848603121561058f57600080fd5b6105988461053c565b9250602084013567ffffffffffffffff808211156105b557600080fd5b818601915086601f8301126105c957600080fd5b8135818111156105d857600080fd5b8760208285010111156105ea57600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561062657600080fd5b61062f8361053c565b9150602083013567ffffffffffffffff8082111561064c57600080fd5b818501915085601f83011261066057600080fd5b813581811115610672576106726105fd565b604051601f8201601f19908116603f0116810190838211818310171561069a5761069a6105fd565b816040528281528860208487010111156106b357600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b8183823760009101908152919050565b8181038181111561070657634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052600160045260246000fd5b6000825160005b818110156107435760208186018101518583015201610729565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122074f34cfe5343d2f6b8453d583a99c0fffe97c41717344b7c70ced86531b4014564736f6c63430008110033608060405260405162001714380380620017148339810160408190526200002691620000db565b6200003c816200004360201b620001771760201c565b506200012f565b60006200004f620000a5565b6004810180546001600160a01b038581166001600160a01b031983168117909355604051939450169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b600080620000d560017f6337542cd2f84f19034eb9306f0e56d253861ffec87880bde5606f90448356eb6200010d565b92915050565b600060208284031215620000ee57600080fd5b81516001600160a01b03811681146200010657600080fd5b9392505050565b81810381811115620000d557634e487b7160e01b600052601160045260246000fd5b6115d5806200013f6000396000f3fe6080604052600436106100225760003560e01c80635a8339911461010357610029565b3661002957005b60008061005760017f6337542cd2f84f19034eb9306f0e56d253861ffec87880bde5606f90448356eb610fa8565b600080356001600160e01b0319168152602082905260409020549092508291506001600160a01b0316806100dd5760405162461bcd60e51b815260206004820152602260248201527f5061726150726f78793a2046756e6374696f6e20646f6573206e6f74206578696044820152611cdd60f21b60648201526084015b60405180910390fd5b3660008037600080366000845af43d6000803e8080156100fc573d6000f35b3d6000fd5b005b34801561010f57600080fd5b5061010161011e366004611020565b6101266101d7565b6101706101338587611166565b8484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061024692505050565b5050505050565b600061018161045e565b6004810180546001600160a01b038581166001600160a01b031983168117909355604051939450169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6101df61045e565b600401546001600160a01b031633146102445760405162461bcd60e51b815260206004820152602160248201527f5061726150726f78793a204d75737420626520636f6e7472616374206f776e656044820152603960f91b60648201526084016100d4565b565b60005b8351811015610413576000848281518110610266576102666112aa565b602002602001015160200151905060006002811115610287576102876112c0565b816002811115610299576102996112c0565b036102e7576102e28583815181106102b3576102b36112aa565b6020026020010151600001518684815181106102d1576102d16112aa565b602002602001015160400151610492565b610400565b60018160028111156102fb576102fb6112c0565b03610344576102e2858381518110610315576103156112aa565b602002602001015160000151868481518110610333576103336112aa565b602002602001015160400151610603565b6002816002811115610358576103586112c0565b036103a1576102e2858381518110610372576103726112aa565b602002602001015160000151868481518110610390576103906112aa565b602002602001015160400151610787565b60405162461bcd60e51b815260206004820152602e60248201527f5061726150726f78793a20496e636f72726563742050726f7879496d706c656d60448201526d32b73a30ba34b7b720b1ba34b7b760911b60648201526084016100d4565b508061040b816112d6565b915050610249565b507f7994b9362f6f8b2522d7dfbe2519931ad73d1308b8bcfbc600db6de899c3d5288383836040516104479392919061133f565b60405180910390a161045982826108a9565b505050565b60008061048c60017f6337542cd2f84f19034eb9306f0e56d253861ffec87880bde5606f90448356eb610fa8565b92915050565b60008151116104b35760405162461bcd60e51b81526004016100d49061143f565b60006104bd61045e565b90506001600160a01b0383166104e55760405162461bcd60e51b81526004016100d49061148f565b6001600160a01b0383166000908152600182016020526040812054906001600160601b038216900361051b5761051b8285610ab2565b60005b835181101561017057600084828151811061053b5761053b6112aa565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b031680156105d55760405162461bcd60e51b815260206004820152603160248201527f5061726150726f78793a2043616e2774206164642066756e6374696f6e207468604482015270617420616c72656164792065786973747360781b60648201526084016100d4565b6105e18583868a610b1c565b836105eb816114e0565b945050505080806105fb906112d6565b91505061051e565b60008151116106245760405162461bcd60e51b81526004016100d49061143f565b600061062e61045e565b90506001600160a01b0383166106565760405162461bcd60e51b81526004016100d49061148f565b6001600160a01b0383166000908152600182016020526040812054906001600160601b038216900361068c5761068c8285610ab2565b60005b83518110156101705760008482815181106106ac576106ac6112aa565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b03908116908716810361074e5760405162461bcd60e51b815260206004820152603460248201527f5061726150726f78793a2043616e2774207265706c6163652066756e6374696f60448201527337103bb4ba341039b0b6b290333ab731ba34b7b760611b60648201526084016100d4565b610759858284610bbc565b6107658583868a610b1c565b8361076f816114e0565b9450505050808061077f906112d6565b91505061068f565b60008151116107a85760405162461bcd60e51b81526004016100d49061143f565b60006107b261045e565b90506001600160a01b038316156108315760405162461bcd60e51b815260206004820152603b60248201527f5061726150726f78793a2052656d6f766520696d706c656d656e746174696f6e60448201527f2061646472657373206d7573742062652061646472657373283029000000000060648201526084016100d4565b60005b82518110156108a3576000838281518110610851576108516112aa565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b031661088e848284610bbc565b5050808061089b906112d6565b915050610834565b50505050565b6001600160a01b0382166109305780511561092c5760405162461bcd60e51b815260206004820152603860248201527f5061726150726f78793a205f696e69742069732061646472657373283029206260448201527f75745f63616c6c64617461206973206e6f7420656d707479000000000000000060648201526084016100d4565b5050565b60008151116109a75760405162461bcd60e51b815260206004820152603960248201527f5061726150726f78793a205f63616c6c6461746120697320656d70747920627560448201527f74205f696e6974206973206e6f7420616464726573732830290000000000000060648201526084016100d4565b6001600160a01b03821630146109d9576109d98260405180606001604052806024815260200161155360249139610f71565b600080836001600160a01b0316836040516109f49190611506565b600060405180830381855af49150503d8060008114610a2f576040519150601f19603f3d011682016040523d82523d6000602084013e610a34565b606091505b5091509150816108a357805115610a5f578060405162461bcd60e51b81526004016100d49190611522565b60405162461bcd60e51b815260206004820152602260248201527f5061726150726f78793a205f696e69742066756e6374696f6e20726576657274604482015261195960f21b60648201526084016100d4565b610ad48160405180606001604052806029815260200161157760299139610f71565b6002820180546001600160a01b0390921660008181526001948501602090815260408220860185905594840183559182529290200180546001600160a01b0319169091179055565b6001600160e01b0319831660008181526020868152604080832080546001600160601b03909716600160a01b026001600160a01b0397881617815594909516808352600180890183529583208054968701815583528183206008870401805460e09890981c60046007909816979097026101000a96870263ffffffff9097021990971695909517909555529290915281546001600160a01b031916179055565b6001600160a01b038216610c2e5760405162461bcd60e51b815260206004820152603360248201527f5061726150726f78793a2043616e27742072656d6f76652066756e6374696f6e604482015272081d1a185d08191bd95cdb89dd08195e1a5cdd606a1b60648201526084016100d4565b306001600160a01b03831603610c995760405162461bcd60e51b815260206004820152602a60248201527f5061726150726f78793a2043616e27742072656d6f766520696d6d757461626c6044820152693290333ab731ba34b7b760b11b60648201526084016100d4565b6001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046001600160601b03169291610ce891610fa8565b9050808214610dda576001600160a01b03841660009081526001860160205260408120805483908110610d1d57610d1d6112aa565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b925082919085908110610d6e57610d6e6112aa565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6001600160601b038516021790555b6001600160a01b03841660009081526001860160205260409020805480610e0357610e0361153c565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b03198516825286905260408120819055819003610170576002850154600090610e6690600190610fa8565b6001600160a01b0386166000908152600180890160205260409091200154909150808214610f15576000876002018381548110610ea557610ea56112aa565b6000918252602090912001546002890180546001600160a01b039092169250829184908110610ed657610ed66112aa565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600189810190925260409020018190555b86600201805480610f2857610f2861153c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b813b81816108a35760405162461bcd60e51b81526004016100d49190611522565b634e487b7160e01b600052601160045260246000fd5b8181038181111561048c5761048c610f92565b80356001600160a01b0381168114610fd257600080fd5b919050565b60008083601f840112610fe957600080fd5b50813567ffffffffffffffff81111561100157600080fd5b60208301915083602082850101111561101957600080fd5b9250929050565b60008060008060006060868803121561103857600080fd5b853567ffffffffffffffff8082111561105057600080fd5b818801915088601f83011261106457600080fd5b81358181111561107357600080fd5b8960208260051b850101111561108857600080fd5b6020830197508096505061109e60208901610fbb565b945060408801359150808211156110b457600080fd5b506110c188828901610fd7565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561110b5761110b6110d2565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561113a5761113a6110d2565b604052919050565b600067ffffffffffffffff82111561115c5761115c6110d2565b5060051b60200190565b600061117961117484611142565b611111565b83815260208082019190600586811b86013681111561119757600080fd5b865b8181101561129d57803567ffffffffffffffff808211156111ba5760008081fd5b818a019150606082360312156111d05760008081fd5b6111d86110e8565b6111e183610fbb565b815286830135600381106111f55760008081fd5b818801526040838101358381111561120d5760008081fd5b939093019236601f85011261122457600092508283fd5b8335925061123461117484611142565b83815292871b840188019288810190368511156112515760008081fd5b948901945b848610156112865785356001600160e01b0319811681146112775760008081fd5b82529489019490890190611256565b918301919091525088525050948301948301611199565b5092979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6000600182016112e8576112e8610f92565b5060010190565b60005b8381101561130a5781810151838201526020016112f2565b50506000910152565b6000815180845261132b8160208601602086016112ef565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b8481101561140f57898403607f19018652815180516001600160a01b031685528381015189860190600381106113ae57634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b808310156113fa5783516001600160e01b03191682529286019260019290920191908601906113d0565b50978501979550505090820190600101611368565b50506001600160a01b038a169088015286810360408801526114318189611313565b9a9950505050505050505050565b60208082526030908201527f5061726150726f78793a204e6f2073656c6563746f727320696e20696d706c6560408201526f1b595b9d185d1a5bdb881d1bc818dd5d60821b606082015260800190565b60208082526031908201527f5061726150726f78793a2041646420696d706c656d656e746174696f6e2063616040820152706e2774206265206164647265737328302960781b606082015260800190565b60006001600160601b038083168181036114fc576114fc610f92565b6001019392505050565b600082516115188184602087016112ef565b9190910192915050565b6020815260006115356020830184611313565b9392505050565b634e487b7160e01b600052603160045260246000fdfe5061726150726f78793a205f696e6974206164647265737320686173206e6f20636f64655061726150726f78793a204e657720696d706c656d656e746174696f6e20686173206e6f20636f6465a264697066735822122041081c9a23bf9f3e08a53d1420d1fbcae811321cd621bed0b860380f3241e08364736f6c63430008110033a26469706673582212204052dbde2bb72163806b7b8553b40cf3f77eb28177460f4cc17694be383101b364736f6c634300081100338be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e000000000000000000000000000000000000000000000000000000000000000400000000000000000000000002f2d07d60ea7330dd2314f4413ccbb2dc25276ef000000000000000000000000000000000000000000000000000000000000000b5061726153706163654d4d000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040523480156200001157600080fd5b5060043610620001af5760003560e01c806376d84ffc11620000f0578063e4ca28b711620000a3578063f2fde38b116200007a578063f2fde38b14620003a5578063f3af858a14620003bc578063f67b184714620003d3578063fca513a814620003ea57600080fd5b8063e4ca28b7146200036d578063e860accb1462000384578063ed301ca9146200038e57600080fd5b806376d84ffc14620002b25780638da5cb5b14620002c9578063ca446dd914620002db578063cae5f11e14620002f2578063e0f31eb514620002fc578063e4501d29146200035657600080fd5b80635b769f3c1162000166578063631adfca116200013d578063631adfca146200027d578063707cd7161462000287578063715018a6146200029157806374944cec146200029b57600080fd5b80635b769f3c14620002455780635dcc528c146200025c5780635eb88d3d146200027357600080fd5b8063026b1d5f14620001b45780630e67178c14620001db57806321f8a72114620001e55780634585264a14620001fc578063530e784f1462000215578063568ef470146200022c575b600080fd5b620001be620003f4565b6040516001600160a01b0390911681526020015b60405180910390f35b620001be6200040d565b620001be620001f636600462001626565b62000421565b620002136200020d36600462001668565b6200043c565b005b6200021362000226366004620016dd565b62000568565b620002366200061d565b604051620001d2919062001758565b6200021362000256366004620016dd565b620006b7565b620002136200026d3660046200176d565b62000764565b620001be62000853565b620001be62000878565b620001be62000899565b62000213620008b4565b62000213620002ac366004620016dd565b6200092b565b62000213620002c3366004620016dd565b620009e9565b6000546001600160a01b0316620001be565b62000213620002ec3660046200176d565b62000a9b565b620001be62000b26565b620003136200030d36600462001626565b62000b3a565b6040805182516001600160a01b039081168252602080850151821690830152838301511691810191909152606091820151151591810191909152608001620001d2565b6200021362000367366004620016dd565b62000c15565b620002136200037e366004620016dd565b62000ccb565b620001be62000d7f565b620002136200039f366004620016dd565b62000d9c565b62000213620003b6366004620016dd565b62000e50565b62000213620003cd366004620017ec565b62000f3f565b62000213620003e4366004620018be565b62000fe1565b620001be6200101c565b600062000408631413d3d360e21b62000421565b905090565b6000620004086820a1a62fa0a226a4a760b91b5b6000908152600260205260409020546001600160a01b031690565b6000546001600160a01b03163314620004725760405162461bcd60e51b8152600401620004699062001979565b60405180910390fd5b604080516080810182526001600160a01b0380871680835286821660208085018281528885168688019081528815156060880190815260008e8152600390945292889020965187549087166001600160a01b031991821617885591516001880180549188169190931617909155516002909501805491511515600160a01b026001600160a81b0319909216959094169490941793909317909155915190919087907f1d6ec4e10cedd4a2a652d0be45309f11e682fef6bb970c752a48cba872a6ae86906200055990879087906001600160a01b039290921682521515602082015260400190565b60405180910390a45050505050565b6000546001600160a01b03163314620005955760405162461bcd60e51b8152600401620004699062001979565b6b50524943455f4f5241434c4560a01b600090815260026020527f740f710666bd7a12af42df98311e541e47f7fd33d382d11602457a6d540cbd6380546001600160a01b038481166001600160a01b03198316811790935560405191169283917f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd9190a35050565b6060600180546200062e90620019ae565b80601f01602080910402602001604051908101604052809291908181526020018280546200065c90620019ae565b8015620006ad5780601f106200068157610100808354040283529160200191620006ad565b820191906000526020600020905b8154815290600101906020018083116200068f57829003601f168201915b5050505050905090565b6000546001600160a01b03163314620006e45760405162461bcd60e51b8152600401620004699062001979565b630ae8aa8960e31b600090815260026020527f9d079330cab48a13979924dfd7e87d65711257c575e853d3b075acf5fc8707c780546001600160a01b038481166001600160a01b03198316811790935560405191169283917f1c08ec67b877c60261a1d95ebb7f008d38470096d29e66d715aed49e66ee8f5a9190a35050565b6000546001600160a01b03163314620007915760405162461bcd60e51b8152600401620004699062001979565b6040805180820190915260018152600760fb1b6020820152631413d3d360e21b8303620007d35760405162461bcd60e51b815260040162000469919062001758565b506000828152600260205260408120546001600160a01b031690620007f88462001038565b9050620008068484620010d3565b6040516001600160a01b038281168252808516919084169086907f3bbd45b5429b385e3fb37ad5cd1cd1435a3c8ec32196c7937597365a3fd3e99c9060200160405180910390a450505050565b6000620004087414149250d157d3d49050d31157d4d1539512539153605a1b62000421565b600062000408702827a7a62fa1a7a72324a3aaa920aa27a960791b62000421565b6000620004086a20a1a62fa6a0a720a3a2a960a91b62000421565b6000546001600160a01b03163314620008e15760405162461bcd60e51b8152600401620004699062001979565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314620009585760405162461bcd60e51b8152600401620004699062001979565b7414149250d157d3d49050d31157d4d1539512539153605a1b600090815260026020527f0d2c1bcee56447b4f46248272f34207a580a5c40f666a31f4e2fbb470ea53ab880546001600160a01b038481166001600160a01b03198316811790935560405191169283917f5326514eeca90494a14bedabcff812a0e683029ee85d1e23824d44fd14cd6ae79190a35050565b6000546001600160a01b0316331462000a165760405162461bcd60e51b8152600401620004699062001979565b6820a1a62fa0a226a4a760b91b600090815260026020527ffab167ad2009dcb80ee379700bb4bd029d97c1181ed9d961625632c8a6f051c680546001600160a01b038481166001600160a01b03198316811790935560405191169283917fe9cf53972264dc95304fd424458745019ddfca0e37ae8f703d74772c41ad115b9190a35050565b6000546001600160a01b0316331462000ac85760405162461bcd60e51b8152600401620004699062001979565b60008281526002602052604080822080546001600160a01b031981166001600160a01b038681169182179093559251911692839186917f9ef0e8c8e52743bb38b83b17d9429141d494b8041ca6d616a6c77cebae9cd8b791a4505050565b600062000408630ae8aa8960e31b62000421565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260036020908152604091829020825160808101845281546001600160a01b03908116808352600184015482169483019490945260029092015491821693810193909352600160a01b900460ff16151560608301521580159062000bd0575080516001600160a01b03163b15155b1562000bdc5792915050565b604080518082018252600381526231303360e81b6020820152905162461bcd60e51b815262000469919060040162001758565b50919050565b6000546001600160a01b0316331462000c425760405162461bcd60e51b8152600401620004699062001979565b6c2220aa20afa82927ab24a222a960991b600090815260026020527fcd7944601aaa5cd7ccdae1bebec659e98c6aac8f12486b30e59db0d39698051f80546001600160a01b038481166001600160a01b03198316811790935560405191169283917fc2c64a506949ea6b362b49fdfd78dbeade68586ea45c44edb102a311d3535dde9190a35050565b6000546001600160a01b0316331462000cf85760405162461bcd60e51b8152600401620004699062001979565b600062000d19702827a7a62fa1a7a72324a3aaa920aa27a960791b62001038565b905062000d3b702827a7a62fa1a7a72324a3aaa920aa27a960791b83620010d3565b816001600160a01b0316816001600160a01b03167f8932892569eba59c8382a089d9b732d1f49272878775235761a2a6b0309cd46560405160405180910390a35050565b6000620004086c2220aa20afa82927ab24a222a960991b62000421565b6000546001600160a01b0316331462000dc95760405162461bcd60e51b8152600401620004699062001979565b6a20a1a62fa6a0a720a3a2a960a91b600090815260026020527f9edef266ef35fd0c6e131df0f31a330f3dd4c4d19dd31ed615c21d005c68116b80546001600160a01b038481166001600160a01b03198316811790935560405191169283917fb30efa04327bb8a537d61cc1e5c48095345ad18ef7cc04e6bacf7dfb6caaf5079190a35050565b6000546001600160a01b0316331462000e7d5760405162461bcd60e51b8152600401620004699062001979565b6001600160a01b03811662000ee45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000469565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331462000f6c5760405162461bcd60e51b8152600401620004699062001979565b62000f83631413d3d360e21b8686868686620012f4565b848460405162000f9592919062001a9c565b60405180910390207f04bca245412c4584bfbdbd2d543feaac9e454dc3764b86c9837eed246531f4dc84848460405162000fd29392919062001b81565b60405180910390a25050505050565b6000546001600160a01b031633146200100e5760405162461bcd60e51b8152600401620004699062001979565b620010198162001505565b50565b6000620004086b50524943455f4f5241434c4560a01b62000421565b6000818152600260205260408120546001600160a01b0316806200105f5750600092915050565b6000819050806001600160a01b0316635c60da1b6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015620010a5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010cb919062001bb1565b949350505050565b604080518082019091526002815261373760f01b60208201526001600160a01b038216620011165760405162461bcd60e51b815260040162000469919062001758565b506000828152600260205260408082205490513060248201526001600160a01b039091169190819060440160408051601f198184030181529190526020810180516001600160e01b031663189acdbd60e31b17905290506001600160a01b0383166200128557306040516200118b906200160a565b6001600160a01b039091168152602001604051809103906000f080158015620011b8573d6000803e3d6000fd5b5060405163347d5e2560e21b81529092506001600160a01b0383169063d1f5789490620011ec908790859060040162001bd1565b600060405180830381600087803b1580156200120757600080fd5b505af11580156200121c573d6000803e3d6000fd5b50505060008681526002602052604080822080546001600160a01b0319166001600160a01b03878116918217909255915195965086959088169350909188917f4a465a9bd819d9662563c1e11ae958f8109e437e7f4bf1c6ef0b9a7b3f35d4789190a4620012ed565b60405163278f794360e11b81528392506001600160a01b03831690634f1ef28690620012b8908790859060040162001bd1565b600060405180830381600087803b158015620012d357600080fd5b505af1158015620012e8573d6000803e3d6000fd5b505050505b5050505050565b6000868152600260205260408120546001600160a01b031690816200143e5730604051620013229062001618565b6001600160a01b039091168152602001604051809103906000f0801580156200134f573d6000803e3d6000fd5b50604051635a83399160e01b81529091506001600160a01b03821690635a8339919062001389908a908a908a908a908a9060040162001bf7565b600060405180830381600087803b158015620013a457600080fd5b505af1158015620013b9573d6000803e3d6000fd5b5050506000898152600260205260409081902080546001600160a01b0319166001600160a01b038516179055519192508291620013fb91508890889062001a9c565b604051908190038120906001600160a01b038416908a907fc98c4080dbb73b6ab93d55682dc2921c0acc2ce5a7dbe170be426b691301f31690600090a4620014fb565b50604051635a83399160e01b815281906001600160a01b03821690635a8339919062001477908a908a908a908a908a9060040162001bf7565b600060405180830381600087803b1580156200149257600080fd5b505af1158015620014a7573d6000803e3d6000fd5b505050508686604051620014bd92919062001a9c565b604051908190038120906001600160a01b038416908a907f7364d7b110775dfa21e4e4d3339c6962e91ab9cc8abdec6c9ec1dc435cdd606e90600090a45b5050505050505050565b6000600180546200151690620019ae565b80601f01602080910402602001604051908101604052809291908181526020018280546200154490620019ae565b8015620015955780601f10620015695761010080835404028352916020019162001595565b820191906000526020600020905b8154815290600101906020018083116200157757829003601f168201915b505050505090508160019081620015ad919062001d60565b5081604051620015be919062001e2d565b604051809103902081604051620015d6919062001e2d565b604051908190038120907fe685c8cdecc6030c45030fd54778812cb84ed8e4467c38294403d68ba786082390600090a35050565b6108558062001e4c83390190565b61171480620026a183390190565b6000602082840312156200163957600080fd5b5035919050565b6001600160a01b03811681146200101957600080fd5b8035620016638162001640565b919050565b600080600080600060a086880312156200168157600080fd5b853594506020860135620016958162001640565b93506040860135620016a78162001640565b92506060860135620016b98162001640565b915060808601358015158114620016cf57600080fd5b809150509295509295909350565b600060208284031215620016f057600080fd5b8135620016fd8162001640565b9392505050565b60005b838110156200172157818101518382015260200162001707565b50506000910152565b600081518084526200174481602086016020860162001704565b601f01601f19169290920160200192915050565b602081526000620016fd60208301846200172a565b600080604083850312156200178157600080fd5b823591506020830135620017958162001640565b809150509250929050565b60008083601f840112620017b357600080fd5b50813567ffffffffffffffff811115620017cc57600080fd5b602083019150836020828501011115620017e557600080fd5b9250929050565b6000806000806000606086880312156200180557600080fd5b853567ffffffffffffffff808211156200181e57600080fd5b818801915088601f8301126200183357600080fd5b8135818111156200184357600080fd5b8960208260051b85010111156200185957600080fd5b60208301975080965050620018716020890162001656565b945060408801359150808211156200188857600080fd5b506200189788828901620017a0565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215620018d157600080fd5b813567ffffffffffffffff80821115620018ea57600080fd5b818401915084601f830112620018ff57600080fd5b813581811115620019145762001914620018a8565b604051601f8201601f19908116603f011681019083821181831017156200193f576200193f620018a8565b816040528281528760208487010111156200195957600080fd5b826020860160208301376000928101602001929092525095945050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680620019c357607f821691505b60208210810362000c0f57634e487b7160e01b600052602260045260246000fd5b8035600381106200166357600080fd5b6003811062001a1357634e487b7160e01b600052602160045260246000fd5b9052565b6000808335601e1984360301811262001a2f57600080fd5b830160208101925035905067ffffffffffffffff81111562001a5057600080fd5b8060051b3603821315620017e557600080fd5b80356001600160e01b0319811681146200166357600080fd5b60008235605e1983360301811262001a9357600080fd5b90910192915050565b6000818482805b8681101562001b4c5762001ab8838962001a7c565b803562001ac58162001640565b6001600160a01b03168552602062001aec81870162001ae6848401620019e4565b620019f4565b604080870162001aff8285018562001a17565b9450915085905b8482101562001b39576001600160e01b031962001b238462001a63565b1681529183019160019190910190830162001b06565b9750505093909301925060010162001aa3565b50919695505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009062001ba8908301848662001b58565b95945050505050565b60006020828403121562001bc457600080fd5b8151620016fd8162001640565b6001600160a01b0383168152604060208201819052600090620010cb908301846200172a565b60608082528181018690526000906080808401600589901b850182018a85805b8c81101562001cd757888403607f1901855262001c35838f62001a7c565b878501813562001c458162001640565b6001600160a01b03168652602062001c5f838201620019e4565b62001c6d82890182620019f4565b50604062001c7e8185018562001a17565b9189018c9052928190529250888701855b8481101562001cc0576001600160e01b031962001cac8562001a63565b168252928201929082019060010162001c8f565b509781019796509490940193505060010162001c17565b5050506001600160a01b0389166020870152858103604087015262001cfe81888a62001b58565b9b9a5050505050505050505050565b601f82111562001d5b57600081815260208120601f850160051c8101602086101562001d365750805b601f850160051c820191505b8181101562001d575782815560010162001d42565b5050505b505050565b815167ffffffffffffffff81111562001d7d5762001d7d620018a8565b62001d958162001d8e8454620019ae565b8462001d0d565b602080601f83116001811462001dcd576000841562001db45750858301515b600019600386901b1c1916600185901b17855562001d57565b600085815260208120601f198616915b8281101562001dfe5788860151825594840194600190910190840162001ddd565b508582101562001e1d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825162001e4181846020870162001704565b919091019291505056fe60a060405234801561001057600080fd5b5060405161085538038061085583398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516107a76100ae60003960008181610123015281816101670152818161021f0152818161035e0152818161038701526104b301526107a76000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b14610098578063d1f57894146100c9578063f851a440146100dc5761005d565b3661005d5761005b6100f1565b005b61005b6100f1565b34801561007157600080fd5b5061005b610080366004610558565b610119565b61005b61009336600461057a565b61015d565b3480156100a457600080fd5b506100ad610213565b6040516001600160a01b03909116815260200160405180910390f35b61005b6100d7366004610613565b610264565b3480156100e857600080fd5b506100ad610352565b6100f96103a9565b6101176101126000805160206107528339815191525490565b6103b1565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361015557610152816103d5565b50565b6101526100f1565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361020657610196836103d5565b6000836001600160a01b031683836040516101b29291906106d5565b600060405180830381855af49150503d80600081146101ed576040519150601f19603f3d011682016040523d82523d6000602084013e6101f2565b606091505b505090508061020057600080fd5b50505050565b61020e6100f1565b505050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361025957506000805160206107528339815191525490565b6102616100f1565b90565b600061027c6000805160206107528339815191525490565b6001600160a01b03161461028f57600080fd5b6102ba60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6106e5565b600080516020610752833981519152146102d6576102d661070c565b6102df82610415565b80511561034e576000826001600160a01b0316826040516103009190610722565b600060405180830381855af49150503d806000811461033b576040519150601f19603f3d011682016040523d82523d6000602084013e610340565b606091505b505090508061020e57600080fd5b5050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361025957507f000000000000000000000000000000000000000000000000000000000000000090565b6101176104a9565b3660008037600080366000845af43d6000803e8080156103d0573d6000f35b3d6000fd5b6103de81610415565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381163b6104975760405162461bcd60e51b815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000060648201526084015b60405180910390fd5b60008051602061075283398151915255565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101175760405162461bcd60e51b815260206004820152603260248201527f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667260448201527137b6903a343290383937bc3c9030b236b4b760711b606482015260840161048e565b80356001600160a01b038116811461055357600080fd5b919050565b60006020828403121561056a57600080fd5b6105738261053c565b9392505050565b60008060006040848603121561058f57600080fd5b6105988461053c565b9250602084013567ffffffffffffffff808211156105b557600080fd5b818601915086601f8301126105c957600080fd5b8135818111156105d857600080fd5b8760208285010111156105ea57600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561062657600080fd5b61062f8361053c565b9150602083013567ffffffffffffffff8082111561064c57600080fd5b818501915085601f83011261066057600080fd5b813581811115610672576106726105fd565b604051601f8201601f19908116603f0116810190838211818310171561069a5761069a6105fd565b816040528281528860208487010111156106b357600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b8183823760009101908152919050565b8181038181111561070657634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052600160045260246000fd5b6000825160005b818110156107435760208186018101518583015201610729565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122074f34cfe5343d2f6b8453d583a99c0fffe97c41717344b7c70ced86531b4014564736f6c63430008110033608060405260405162001714380380620017148339810160408190526200002691620000db565b6200003c816200004360201b620001771760201c565b506200012f565b60006200004f620000a5565b6004810180546001600160a01b038581166001600160a01b031983168117909355604051939450169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b600080620000d560017f6337542cd2f84f19034eb9306f0e56d253861ffec87880bde5606f90448356eb6200010d565b92915050565b600060208284031215620000ee57600080fd5b81516001600160a01b03811681146200010657600080fd5b9392505050565b81810381811115620000d557634e487b7160e01b600052601160045260246000fd5b6115d5806200013f6000396000f3fe6080604052600436106100225760003560e01c80635a8339911461010357610029565b3661002957005b60008061005760017f6337542cd2f84f19034eb9306f0e56d253861ffec87880bde5606f90448356eb610fa8565b600080356001600160e01b0319168152602082905260409020549092508291506001600160a01b0316806100dd5760405162461bcd60e51b815260206004820152602260248201527f5061726150726f78793a2046756e6374696f6e20646f6573206e6f74206578696044820152611cdd60f21b60648201526084015b60405180910390fd5b3660008037600080366000845af43d6000803e8080156100fc573d6000f35b3d6000fd5b005b34801561010f57600080fd5b5061010161011e366004611020565b6101266101d7565b6101706101338587611166565b8484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061024692505050565b5050505050565b600061018161045e565b6004810180546001600160a01b038581166001600160a01b031983168117909355604051939450169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6101df61045e565b600401546001600160a01b031633146102445760405162461bcd60e51b815260206004820152602160248201527f5061726150726f78793a204d75737420626520636f6e7472616374206f776e656044820152603960f91b60648201526084016100d4565b565b60005b8351811015610413576000848281518110610266576102666112aa565b602002602001015160200151905060006002811115610287576102876112c0565b816002811115610299576102996112c0565b036102e7576102e28583815181106102b3576102b36112aa565b6020026020010151600001518684815181106102d1576102d16112aa565b602002602001015160400151610492565b610400565b60018160028111156102fb576102fb6112c0565b03610344576102e2858381518110610315576103156112aa565b602002602001015160000151868481518110610333576103336112aa565b602002602001015160400151610603565b6002816002811115610358576103586112c0565b036103a1576102e2858381518110610372576103726112aa565b602002602001015160000151868481518110610390576103906112aa565b602002602001015160400151610787565b60405162461bcd60e51b815260206004820152602e60248201527f5061726150726f78793a20496e636f72726563742050726f7879496d706c656d60448201526d32b73a30ba34b7b720b1ba34b7b760911b60648201526084016100d4565b508061040b816112d6565b915050610249565b507f7994b9362f6f8b2522d7dfbe2519931ad73d1308b8bcfbc600db6de899c3d5288383836040516104479392919061133f565b60405180910390a161045982826108a9565b505050565b60008061048c60017f6337542cd2f84f19034eb9306f0e56d253861ffec87880bde5606f90448356eb610fa8565b92915050565b60008151116104b35760405162461bcd60e51b81526004016100d49061143f565b60006104bd61045e565b90506001600160a01b0383166104e55760405162461bcd60e51b81526004016100d49061148f565b6001600160a01b0383166000908152600182016020526040812054906001600160601b038216900361051b5761051b8285610ab2565b60005b835181101561017057600084828151811061053b5761053b6112aa565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b031680156105d55760405162461bcd60e51b815260206004820152603160248201527f5061726150726f78793a2043616e2774206164642066756e6374696f6e207468604482015270617420616c72656164792065786973747360781b60648201526084016100d4565b6105e18583868a610b1c565b836105eb816114e0565b945050505080806105fb906112d6565b91505061051e565b60008151116106245760405162461bcd60e51b81526004016100d49061143f565b600061062e61045e565b90506001600160a01b0383166106565760405162461bcd60e51b81526004016100d49061148f565b6001600160a01b0383166000908152600182016020526040812054906001600160601b038216900361068c5761068c8285610ab2565b60005b83518110156101705760008482815181106106ac576106ac6112aa565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b03908116908716810361074e5760405162461bcd60e51b815260206004820152603460248201527f5061726150726f78793a2043616e2774207265706c6163652066756e6374696f60448201527337103bb4ba341039b0b6b290333ab731ba34b7b760611b60648201526084016100d4565b610759858284610bbc565b6107658583868a610b1c565b8361076f816114e0565b9450505050808061077f906112d6565b91505061068f565b60008151116107a85760405162461bcd60e51b81526004016100d49061143f565b60006107b261045e565b90506001600160a01b038316156108315760405162461bcd60e51b815260206004820152603b60248201527f5061726150726f78793a2052656d6f766520696d706c656d656e746174696f6e60448201527f2061646472657373206d7573742062652061646472657373283029000000000060648201526084016100d4565b60005b82518110156108a3576000838281518110610851576108516112aa565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b031661088e848284610bbc565b5050808061089b906112d6565b915050610834565b50505050565b6001600160a01b0382166109305780511561092c5760405162461bcd60e51b815260206004820152603860248201527f5061726150726f78793a205f696e69742069732061646472657373283029206260448201527f75745f63616c6c64617461206973206e6f7420656d707479000000000000000060648201526084016100d4565b5050565b60008151116109a75760405162461bcd60e51b815260206004820152603960248201527f5061726150726f78793a205f63616c6c6461746120697320656d70747920627560448201527f74205f696e6974206973206e6f7420616464726573732830290000000000000060648201526084016100d4565b6001600160a01b03821630146109d9576109d98260405180606001604052806024815260200161155360249139610f71565b600080836001600160a01b0316836040516109f49190611506565b600060405180830381855af49150503d8060008114610a2f576040519150601f19603f3d011682016040523d82523d6000602084013e610a34565b606091505b5091509150816108a357805115610a5f578060405162461bcd60e51b81526004016100d49190611522565b60405162461bcd60e51b815260206004820152602260248201527f5061726150726f78793a205f696e69742066756e6374696f6e20726576657274604482015261195960f21b60648201526084016100d4565b610ad48160405180606001604052806029815260200161157760299139610f71565b6002820180546001600160a01b0390921660008181526001948501602090815260408220860185905594840183559182529290200180546001600160a01b0319169091179055565b6001600160e01b0319831660008181526020868152604080832080546001600160601b03909716600160a01b026001600160a01b0397881617815594909516808352600180890183529583208054968701815583528183206008870401805460e09890981c60046007909816979097026101000a96870263ffffffff9097021990971695909517909555529290915281546001600160a01b031916179055565b6001600160a01b038216610c2e5760405162461bcd60e51b815260206004820152603360248201527f5061726150726f78793a2043616e27742072656d6f76652066756e6374696f6e604482015272081d1a185d08191bd95cdb89dd08195e1a5cdd606a1b60648201526084016100d4565b306001600160a01b03831603610c995760405162461bcd60e51b815260206004820152602a60248201527f5061726150726f78793a2043616e27742072656d6f766520696d6d757461626c6044820152693290333ab731ba34b7b760b11b60648201526084016100d4565b6001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046001600160601b03169291610ce891610fa8565b9050808214610dda576001600160a01b03841660009081526001860160205260408120805483908110610d1d57610d1d6112aa565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b925082919085908110610d6e57610d6e6112aa565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6001600160601b038516021790555b6001600160a01b03841660009081526001860160205260409020805480610e0357610e0361153c565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b03198516825286905260408120819055819003610170576002850154600090610e6690600190610fa8565b6001600160a01b0386166000908152600180890160205260409091200154909150808214610f15576000876002018381548110610ea557610ea56112aa565b6000918252602090912001546002890180546001600160a01b039092169250829184908110610ed657610ed66112aa565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600189810190925260409020018190555b86600201805480610f2857610f2861153c565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b813b81816108a35760405162461bcd60e51b81526004016100d49190611522565b634e487b7160e01b600052601160045260246000fd5b8181038181111561048c5761048c610f92565b80356001600160a01b0381168114610fd257600080fd5b919050565b60008083601f840112610fe957600080fd5b50813567ffffffffffffffff81111561100157600080fd5b60208301915083602082850101111561101957600080fd5b9250929050565b60008060008060006060868803121561103857600080fd5b853567ffffffffffffffff8082111561105057600080fd5b818801915088601f83011261106457600080fd5b81358181111561107357600080fd5b8960208260051b850101111561108857600080fd5b6020830197508096505061109e60208901610fbb565b945060408801359150808211156110b457600080fd5b506110c188828901610fd7565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561110b5761110b6110d2565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561113a5761113a6110d2565b604052919050565b600067ffffffffffffffff82111561115c5761115c6110d2565b5060051b60200190565b600061117961117484611142565b611111565b83815260208082019190600586811b86013681111561119757600080fd5b865b8181101561129d57803567ffffffffffffffff808211156111ba5760008081fd5b818a019150606082360312156111d05760008081fd5b6111d86110e8565b6111e183610fbb565b815286830135600381106111f55760008081fd5b818801526040838101358381111561120d5760008081fd5b939093019236601f85011261122457600092508283fd5b8335925061123461117484611142565b83815292871b840188019288810190368511156112515760008081fd5b948901945b848610156112865785356001600160e01b0319811681146112775760008081fd5b82529489019490890190611256565b918301919091525088525050948301948301611199565b5092979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6000600182016112e8576112e8610f92565b5060010190565b60005b8381101561130a5781810151838201526020016112f2565b50506000910152565b6000815180845261132b8160208601602086016112ef565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b8481101561140f57898403607f19018652815180516001600160a01b031685528381015189860190600381106113ae57634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b808310156113fa5783516001600160e01b03191682529286019260019290920191908601906113d0565b50978501979550505090820190600101611368565b50506001600160a01b038a169088015286810360408801526114318189611313565b9a9950505050505050505050565b60208082526030908201527f5061726150726f78793a204e6f2073656c6563746f727320696e20696d706c6560408201526f1b595b9d185d1a5bdb881d1bc818dd5d60821b606082015260800190565b60208082526031908201527f5061726150726f78793a2041646420696d706c656d656e746174696f6e2063616040820152706e2774206265206164647265737328302960781b606082015260800190565b60006001600160601b038083168181036114fc576114fc610f92565b6001019392505050565b600082516115188184602087016112ef565b9190910192915050565b6020815260006115356020830184611313565b9392505050565b634e487b7160e01b600052603160045260246000fdfe5061726150726f78793a205f696e6974206164647265737320686173206e6f20636f64655061726150726f78793a204e657720696d706c656d656e746174696f6e20686173206e6f20636f6465a264697066735822122041081c9a23bf9f3e08a53d1420d1fbcae811321cd621bed0b860380f3241e08364736f6c63430008110033a26469706673582212204052dbde2bb72163806b7b8553b40cf3f77eb28177460f4cc17694be383101b364736f6c63430008110033

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

00000000000000000000000000000000000000000000000000000000000000400000000000000000000000002f2d07d60ea7330dd2314f4413ccbb2dc25276ef000000000000000000000000000000000000000000000000000000000000000b5061726153706163654d4d000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : marketId (string): ParaSpaceMM
Arg [1] : owner (address): 0x2f2d07d60ea7330DD2314f4413CCbB2dC25276EF

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000002f2d07d60ea7330dd2314f4413ccbb2dc25276ef
Arg [2] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [3] : 5061726153706163654d4d000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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