ETH Price: $3,911.96 (+0.09%)

Contract

0xE6AA8fF911000a52d685493097E0EF0403f860d9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Liquidator

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 300 runs

Other Settings:
default evmVersion
File 1 of 11 : Liquidator.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

import "../interfaces/INFTVault.sol";
import "../interfaces/IAggregatorV3Interface.sol";
import "../interfaces/IJPEGAuction.sol";

/// @title Liquidator escrow contract
/// @notice Liquidator contract that allows liquidator bots to liquidate positions without holding any stablecoins/NFTs.
/// It's only meant to be used by DAO bots.
/// The liquidated NFTs are auctioned.
contract Liquidator is OwnableUpgradeable {
    using AddressUpgradeable for address;

    error ZeroAddress();
    error InvalidLength();
    error UnknownVault(INFTVault vault);
    error InsufficientBalance(IERC20Upgradeable stablecoin);

    struct OracleInfo {
        IAggregatorV3Interface oracle;
        uint8 decimals;
    }

    struct VaultInfo {
        IERC20Upgradeable stablecoin;
        address nftOrWrapper;
        bool isWrapped;
    }

    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    IJPEGAuction public immutable AUCTION;

    mapping(IERC20Upgradeable => OracleInfo) public stablecoinOracle;
    mapping(INFTVault => VaultInfo) public vaultInfo;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor(address _auction) {
        if (_auction == address(0)) revert ZeroAddress();

        AUCTION = IJPEGAuction(_auction);
    }

    function initialize() external initializer {
        __Ownable_init();
    }

    /// @notice Allows any address to liquidate multiple positions at once.
    /// It assumes enough stablecoin is in the contract.
    /// The liquidated NFTs are sent to the DAO.
    /// This function can be called by anyone, however the address calling it doesn't get any stablecoins/NFTs.
    /// @dev This function doesn't revert if one of the positions is not liquidatable.
    /// This is done to prevent situations in which multiple positions can't be liquidated
    /// because of one not liquidatable position.
    /// It reverts on insufficient balance.
    /// @param _toLiquidate The positions to liquidate
    /// @param _nftVault The address of the NFTVault
    function liquidate(
        uint256[] memory _toLiquidate,
        INFTVault _nftVault
    ) external {
        VaultInfo memory _vaultInfo = vaultInfo[_nftVault];
        if (_vaultInfo.nftOrWrapper == address(0))
            revert UnknownVault(_nftVault);

        uint256 _length = _toLiquidate.length;
        if (_length == 0) revert InvalidLength();

        uint256 _balance = _vaultInfo.stablecoin.balanceOf(address(this));
        _vaultInfo.stablecoin.approve(address(_nftVault), _balance);

        for (uint256 i; i < _length; ++i) {
            uint256 _nftIndex = _toLiquidate[i];

            INFTVault.Position memory _position = _nftVault.positions(
                _nftIndex
            );
            uint256 _interest = _nftVault.getDebtInterest(_nftIndex);
            address _destAddress = _vaultInfo.isWrapped
                ? _vaultInfo.nftOrWrapper
                : address(this);

            try _nftVault.liquidate(_nftIndex, _destAddress) {
                if (
                    _position.borrowType != INFTVault.BorrowType.USE_INSURANCE
                ) {
                    uint256 _normalizedDebt = _convertDebtAmount(
                        _position.debtPrincipal + _interest,
                        stablecoinOracle[_vaultInfo.stablecoin]
                    );

                    if (!_vaultInfo.isWrapped)
                        IERC721Upgradeable(_vaultInfo.nftOrWrapper).approve(
                            address(AUCTION),
                            _nftIndex
                        );

                    AUCTION.newAuction(
                        _vaultInfo.nftOrWrapper,
                        _nftIndex,
                        _normalizedDebt
                    );
                }
            } catch Error(string memory _reason) {
                //insufficient allowance -> insufficient balance
                if (
                    keccak256(abi.encodePacked(_reason)) ==
                    keccak256(abi.encodePacked("ERC20: insufficient allowance"))
                ) revert InsufficientBalance(_vaultInfo.stablecoin);
            }
        }

        //reset appoval
        _vaultInfo.stablecoin.approve(address(_nftVault), 0);
    }

    /// @notice Allows any address to claim NFTs from multiple expired insurance postions at once.
    /// The claimed NFTs are auctioned.
    /// This function can be called by anyone, however the address calling it doesn't get any stablecoins/NFTs.
    /// @dev This function doesn't revert if one of the NFTs isn't claimable yet. This is done to prevent
    /// situations in which multiple NFTs can't be claimed because of one not being claimable yet
    /// @param _toClaim The indexes of the NFTs to claim
    /// @param _nftVault The address of the NFTVault
    function claimExpiredInsuranceNFT(
        uint256[] memory _toClaim,
        INFTVault _nftVault
    ) external {
        VaultInfo memory _vaultInfo = vaultInfo[_nftVault];
        if (_vaultInfo.nftOrWrapper == address(0))
            revert UnknownVault(_nftVault);

        uint256 _length = _toClaim.length;
        if (_length == 0) revert InvalidLength();

        for (uint256 i; i < _length; ++i) {
            uint256 _nftIndex = _toClaim[i];

            INFTVault.Position memory _position = _nftVault.positions(
                _nftIndex
            );
            address _destAddress = _vaultInfo.isWrapped
                ? _vaultInfo.nftOrWrapper
                : address(this);

            try _nftVault.claimExpiredInsuranceNFT(_nftIndex, _destAddress) {
                uint256 _normalizedDebt = _convertDebtAmount(
                    _position.debtAmountForRepurchase,
                    stablecoinOracle[_vaultInfo.stablecoin]
                );

                if (!_vaultInfo.isWrapped)
                    IERC721Upgradeable(_vaultInfo.nftOrWrapper).approve(
                        address(AUCTION),
                        _nftIndex
                    );

                AUCTION.newAuction(
                    _vaultInfo.nftOrWrapper,
                    _nftIndex,
                    _normalizedDebt
                );
            } catch {
                //catch and ignore claim errors
            }
        }
    }

    /// @notice Allows the owner to add information about a NFTVault
    function addNFTVault(
        INFTVault _nftVault,
        address _nftOrWrapper,
        bool _isWrapped
    ) external onlyOwner {
        if (address(_nftVault) == address(0) || _nftOrWrapper == address(0))
            revert ZeroAddress();

        vaultInfo[_nftVault] = VaultInfo(
            IERC20Upgradeable(_nftVault.stablecoin()),
            _nftOrWrapper,
            _isWrapped
        );
    }

    /// @notice Allows the owner to remove a NFTVault
    function removeNFTVault(INFTVault _nftVault) external onlyOwner {
        delete vaultInfo[_nftVault];
    }

    /// @notice Allows the owner to set the oracle address for a specific stablecoin.
    function setOracle(
        IERC20Upgradeable _stablecoin,
        IAggregatorV3Interface _oracle
    ) external onlyOwner {
        if (
            address(_stablecoin) == address(0) || address(_oracle) == address(0)
        ) revert ZeroAddress();

        stablecoinOracle[_stablecoin] = OracleInfo(_oracle, _oracle.decimals());
    }

    /// @notice Allows the DAO to perform multiple calls using this contract (recovering funds/NFTs stuck in this contract)
    /// @param _targets The target addresses
    /// @param _calldatas The data to pass in each call
    /// @param _values The ETH value for each call
    function doCalls(
        address[] memory _targets,
        bytes[] memory _calldatas,
        uint256[] memory _values
    ) external payable onlyOwner {
        for (uint256 i = 0; i < _targets.length; i++) {
            _targets[i].functionCallWithValue(_calldatas[i], _values[i]);
        }
    }

    function _convertDebtAmount(
        uint256 _debt,
        OracleInfo memory _info
    ) internal view returns (uint256) {
        if (address(_info.oracle) == address(0)) return _debt;
        else {
            //not checking for stale prices because we have no fallback oracle
            //and stale/wrong prices are not an issue since they are only needed
            //to set the minimum bid for the auction
            (, int256 _answer, , , ) = _info.oracle.latestRoundData();

            return (_debt * 10 ** _info.decimals) / uint256(_answer);
        }
    }
}

File 2 of 11 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 3 of 11 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 4 of 11 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 11 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165Upgradeable.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

File 6 of 11 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

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

File 7 of 11 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 8 of 11 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 9 of 11 : IAggregatorV3Interface.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;

interface IAggregatorV3Interface {
    function decimals() external view returns (uint8);

    function latestRoundData()
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );
}

File 10 of 11 : IJPEGAuction.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;

interface IJPEGAuction {
    function newAuction(address _nft, uint256 _idx, uint256 _minBid) external;
}

File 11 of 11 : INFTVault.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;

interface INFTVault {
    struct Rate {
        uint128 numerator;
        uint128 denominator;
    }

    struct VaultSettings {
        Rate debtInterestApr;
        /// @custom:oz-renamed-from creditLimitRate
        Rate unused15;
        /// @custom:oz-renamed-from liquidationLimitRate
        Rate unused16;
        /// @custom:oz-renamed-from cigStakedCreditLimitRate
        Rate unused17;
        /// @custom:oz-renamed-from cigStakedLiquidationLimitRate
        Rate unused18;
        /// @custom:oz-renamed-from valueIncreaseLockRate
        Rate unused12;
        Rate organizationFeeRate;
        Rate insurancePurchaseRate;
        Rate insuranceLiquidationPenaltyRate;
        uint256 insuranceRepurchaseTimeLimit;
        uint256 borrowAmountCap;
    }

    enum BorrowType {
        NOT_CONFIRMED,
        NON_INSURANCE,
        USE_INSURANCE
    }

    struct Position {
        BorrowType borrowType;
        uint256 debtPrincipal;
        uint256 debtPortion;
        uint256 debtAmountForRepurchase;
        uint256 liquidatedAt;
        address liquidator;
        address strategy;
    }

    function settings() external view returns (VaultSettings memory);

    function accrue() external;

    function setSettings(VaultSettings calldata _settings) external;

    function doActionsFor(
        address _account,
        uint8[] calldata _actions,
        bytes[] calldata _data
    ) external;

    function hasStrategy(address _strategy) external view returns (bool);

    function stablecoin() external view returns (address);

    function nftContract() external view returns (address);

    function positions(uint256 _idx) external view returns (Position memory);

    function getDebtInterest(uint256 _nftIndex) external view returns (uint256);

    function liquidate(uint256 _nftIndex, address _recipient) external;

    function claimExpiredInsuranceNFT(
        uint256 _nftIndex,
        address _recipient
    ) external;

    function forceClosePosition(
        address _account,
        uint256 _nftIndex,
        address _recipient
    ) external returns (uint256);

    function importPosition(
        address _account,
        uint256 _nftIndex,
        uint256 _amount,
        bool _insurance,
        address _strategy
    ) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_auction","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"contract IERC20Upgradeable","name":"stablecoin","type":"address"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidLength","type":"error"},{"inputs":[{"internalType":"contract INFTVault","name":"vault","type":"address"}],"name":"UnknownVault","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"AUCTION","outputs":[{"internalType":"contract IJPEGAuction","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract INFTVault","name":"_nftVault","type":"address"},{"internalType":"address","name":"_nftOrWrapper","type":"address"},{"internalType":"bool","name":"_isWrapped","type":"bool"}],"name":"addNFTVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_toClaim","type":"uint256[]"},{"internalType":"contract INFTVault","name":"_nftVault","type":"address"}],"name":"claimExpiredInsuranceNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_targets","type":"address[]"},{"internalType":"bytes[]","name":"_calldatas","type":"bytes[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"}],"name":"doCalls","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_toLiquidate","type":"uint256[]"},{"internalType":"contract INFTVault","name":"_nftVault","type":"address"}],"name":"liquidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract INFTVault","name":"_nftVault","type":"address"}],"name":"removeNFTVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Upgradeable","name":"_stablecoin","type":"address"},{"internalType":"contract IAggregatorV3Interface","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"name":"stablecoinOracle","outputs":[{"internalType":"contract IAggregatorV3Interface","name":"oracle","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INFTVault","name":"","type":"address"}],"name":"vaultInfo","outputs":[{"internalType":"contract IERC20Upgradeable","name":"stablecoin","type":"address"},{"internalType":"address","name":"nftOrWrapper","type":"address"},{"internalType":"bool","name":"isWrapped","type":"bool"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b5060405162001f8d38038062001f8d8339810160408190526100319161006d565b6001600160a01b0381166100585760405163d92e233d60e01b815260040160405180910390fd5b60601b6001600160601b03191660805261009b565b60006020828403121561007e578081fd5b81516001600160a01b0381168114610094578182fd5b9392505050565b60805160601c611eb7620000d66000396000818161014b015281816105610152818161060001528181610b3d0152610bdc0152611eb76000f3fe6080604052600436106100d25760003560e01c80637a46ea531161007f5780639164359a116100595780639164359a14610212578063a833e2fa14610287578063efbba8ce146102ea578063f2fde38b146102fd57600080fd5b80637a46ea53146101bf5780638129fc1c146101df5780638da5cb5b146101f457600080fd5b806363779c74116100b057806363779c74146101395780636ed848ea1461018a578063715018a6146101aa57600080fd5b80631fe281b8146100d757806333f150af146100f95780635c38eb3a14610119575b600080fd5b3480156100e357600080fd5b506100f76100f23660046118bf565b61031d565b005b34801561010557600080fd5b506100f76101143660046118bf565b61067b565b34801561012557600080fd5b506100f761013436600461192b565b610cdf565b34801561014557600080fd5b5061016d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561019657600080fd5b506100f76101a5366004611797565b610e3c565b3480156101b657600080fd5b506100f7610ebc565b3480156101cb57600080fd5b506100f76101da366004611958565b610f10565b3480156101eb57600080fd5b506100f7611084565b34801561020057600080fd5b506033546001600160a01b031661016d565b34801561021e57600080fd5b5061025f61022d366004611797565b606660205260009081526040902080546001909101546001600160a01b0391821691811690600160a01b900460ff1683565b604080516001600160a01b039485168152939092166020840152151590820152606001610181565b34801561029357600080fd5b506102c96102a2366004611797565b6065602052600090815260409020546001600160a01b03811690600160a01b900460ff1682565b604080516001600160a01b03909316835260ff909116602083015201610181565b6100f76102f83660046117cf565b611145565b34801561030957600080fd5b506100f7610318366004611797565b611245565b6001600160a01b038181166000908152606660209081526040918290208251606081018452815485168152600190910154938416918101829052600160a01b90930460ff16151591830191909152610398576040516376bfd6b960e01b81526001600160a01b03831660048201526024015b60405180910390fd5b8251806103b85760405163251f56a160e21b815260040160405180910390fd5b60005b818110156106745760008582815181106103e557634e487b7160e01b600052603260045260246000fd5b602002602001015190506000856001600160a01b03166399fbab88836040518263ffffffff1660e01b815260040161041f91815260200190565b60e06040518083038186803b15801561043757600080fd5b505afa15801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906119a2565b9050600085604001516104825730610488565b85602001515b60405163f800467560e01b8152600481018590526001600160a01b0380831660248301529192509088169063f800467590604401600060405180830381600087803b1580156104d657600080fd5b505af19250505080156104e7575060015b6104f057610660565b606082015186516001600160a01b0390811660009081526065602090815260408083208151808301909252549384168152600160a01b90930460ff16908301529161053a916112fb565b905086604001516105ce57602087015160405163095ea7b360e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018790529091169063095ea7b390604401600060405180830381600087803b1580156105b557600080fd5b505af11580156105c9573d6000803e3d6000fd5b505050505b6020870151604051639ef1e4a160e01b81526001600160a01b03918216600482015260248101869052604481018390527f000000000000000000000000000000000000000000000000000000000000000090911690639ef1e4a190606401600060405180830381600087803b15801561064657600080fd5b505af115801561065a573d6000803e3d6000fd5b50505050505b5050508061066d90611d2c565b90506103bb565b5050505050565b6001600160a01b038181166000908152606660209081526040918290208251606081018452815485168152600190910154938416918101829052600160a01b90930460ff161515918301919091526106f1576040516376bfd6b960e01b81526001600160a01b038316600482015260240161038f565b8251806107115760405163251f56a160e21b815260040160405180910390fd5b81516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561075457600080fd5b505afa158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c9190611a22565b835160405163095ea7b360e01b81526001600160a01b0387811660048301526024820184905292935091169063095ea7b390604401602060405180830381600087803b1580156107db57600080fd5b505af11580156107ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610813919061190f565b5060005b82811015610c5157600086828151811061084157634e487b7160e01b600052603260045260246000fd5b602002602001015190506000866001600160a01b03166399fbab88836040518263ffffffff1660e01b815260040161087b91815260200190565b60e06040518083038186803b15801561089357600080fd5b505afa1580156108a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cb91906119a2565b6040516327c0b28560e11b8152600481018490529091506000906001600160a01b03891690634f81650a9060240160206040518083038186803b15801561091157600080fd5b505afa158015610925573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109499190611a22565b90506000876040015161095c5730610962565b87602001515b604051635fae8b3d60e01b8152600481018690526001600160a01b038083166024830152919250908a1690635fae8b3d90604401600060405180830381600087803b1580156109b057600080fd5b505af19250505080156109c1575060015b610a95576109cd611d73565b806308c379a01415610a8957506109e2611d8b565b806109ed5750610a8b565b6040517f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006020820152603d016040516020818303038152906040528051906020012081604051602001610a409190611aaa565b604051602081830303815290604052805190602001201415610a8357885160405163112fed8b60e31b81526001600160a01b03909116600482015260240161038f565b50610c3c565b505b3d6000803e3d6000fd5b600283516002811115610ab857634e487b7160e01b600052602160045260246000fd5b14610c3c576000610b16838560200151610ad29190611b68565b8a516001600160a01b039081166000908152606560209081526040918290208251808401909352549283168252600160a01b90920460ff16918101919091526112fb565b90508860400151610baa57602089015160405163095ea7b360e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018890529091169063095ea7b390604401600060405180830381600087803b158015610b9157600080fd5b505af1158015610ba5573d6000803e3d6000fd5b505050505b6020890151604051639ef1e4a160e01b81526001600160a01b03918216600482015260248101879052604481018390527f000000000000000000000000000000000000000000000000000000000000000090911690639ef1e4a190606401600060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b50505050505b5050505080610c4a90611d2c565b9050610817565b50825160405163095ea7b360e01b81526001600160a01b038681166004830152600060248301529091169063095ea7b390604401602060405180830381600087803b158015610c9f57600080fd5b505af1158015610cb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd7919061190f565b505050505050565b6033546001600160a01b03163314610d275760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b6001600160a01b0382161580610d4457506001600160a01b038116155b15610d625760405163d92e233d60e01b815260040160405180910390fd5b6040518060400160405280826001600160a01b03168152602001826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610db557600080fd5b505afa158015610dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ded9190611a89565b60ff9081169091526001600160a01b039384166000908152606560209081526040909120835181549490920151909216600160a01b026001600160a81b03199093169416939093171790915550565b6033546001600160a01b03163314610e845760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b6001600160a01b0316600090815260666020526040902080546001600160a01b031916815560010180546001600160a81b0319169055565b6033546001600160a01b03163314610f045760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b610f0e60006113c1565b565b6033546001600160a01b03163314610f585760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b6001600160a01b0383161580610f7557506001600160a01b038216155b15610f935760405163d92e233d60e01b815260040160405180910390fd5b6040518060600160405280846001600160a01b031663e9cbd8226040518163ffffffff1660e01b815260040160206040518083038186803b158015610fd757600080fd5b505afa158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100f91906117b3565b6001600160a01b039081168252938416602080830191909152921515604091820152938316600090815260668352849020815181549085166001600160a01b0319909116178155918101516001909201805491909401511515600160a01b026001600160a81b03199091169190921617179055565b600054610100900460ff1661109f5760005460ff16156110a3565b303b155b6111065760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161038f565b600054610100900460ff16158015611128576000805461ffff19166101011790555b611130611413565b8015611142576000805461ff00191690555b50565b6033546001600160a01b0316331461118d5760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b60005b835181101561123f5761122c8382815181106111bc57634e487b7160e01b600052603260045260246000fd5b60200260200101518383815181106111e457634e487b7160e01b600052603260045260246000fd5b602002602001015186848151811061120c57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166114429092919063ffffffff16565b508061123781611d2c565b915050611190565b50505050565b6033546001600160a01b0316331461128d5760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b6001600160a01b0381166112f25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161038f565b611142816113c1565b80516000906001600160a01b03166113145750816113bb565b600082600001516001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561135357600080fd5b505afa158015611367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138b9190611a3a565b505050915050808360200151600a6113a39190611be3565b6113ad9086611c8e565b6113b79190611b80565b9150505b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661143a5760405162461bcd60e51b815260040161038f90611af9565b610f0e611472565b6060611468848484604051806060016040528060298152602001611e39602991396114a2565b90505b9392505050565b600054610100900460ff166114995760405162461bcd60e51b815260040161038f90611af9565b610f0e336113c1565b6060824710156115035760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161038f565b6001600160a01b0385163b61155a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161038f565b600080866001600160a01b031685876040516115769190611aaa565b60006040518083038185875af1925050503d80600081146115b3576040519150601f19603f3d011682016040523d82523d6000602084013e6115b8565b606091505b50915091506115c88282866115d3565b979650505050505050565b606083156115e257508161146b565b8251156115f25782518084602001fd5b8160405162461bcd60e51b815260040161038f9190611ac6565b805161161781611e15565b919050565b6000601f838184011261162d578182fd5b8235602061163a82611b44565b604080516116488382611cff565b8481528381019250878401600586901b890185018a1015611667578788fd5b875b868110156116fa57813567ffffffffffffffff80821115611688578a8bfd5b818c0191508c603f83011261169b578a8bfd5b87820135818111156116af576116af611d5d565b865191506116c5818c01601f19168a0183611cff565b8082528d878285010111156116d8578b8cfd5b808784018a840137810188018b90528652509385019390850190600101611669565b50909998505050505050505050565b600082601f830112611719578081fd5b8135602061172682611b44565b6040516117338282611cff565b8381528281019150858301600585901b87018401881015611752578586fd5b855b8581101561177057813584529284019290840190600101611754565b5090979650505050505050565b805169ffffffffffffffffffff8116811461161757600080fd5b6000602082840312156117a8578081fd5b813561146b81611e15565b6000602082840312156117c4578081fd5b815161146b81611e15565b6000806000606084860312156117e3578182fd5b833567ffffffffffffffff808211156117fa578384fd5b818601915086601f83011261180d578384fd5b8135602061181a82611b44565b6040516118278282611cff565b8381528281019150858301600585901b870184018c1015611846578889fd5b8896505b8487101561187157803561185d81611e15565b83526001969096019591830191830161184a565b5097505087013592505080821115611887578384fd5b6118938783880161161c565b935060408601359150808211156118a8578283fd5b506118b586828701611709565b9150509250925092565b600080604083850312156118d1578081fd5b823567ffffffffffffffff8111156118e7578182fd5b6118f385828601611709565b925050602083013561190481611e15565b809150509250929050565b600060208284031215611920578081fd5b815161146b81611e2a565b6000806040838503121561193d578182fd5b823561194881611e15565b9150602083013561190481611e15565b60008060006060848603121561196c578081fd5b833561197781611e15565b9250602084013561198781611e15565b9150604084013561199781611e2a565b809150509250925092565b600060e082840312156119b3578081fd5b6040516119bf81611cd9565b8251600381106119cd578283fd5b8082525060208301516020820152604083015160408201526060830151606082015260808301516080820152611a0560a0840161160c565b60a0820152611a1660c0840161160c565b60c08201529392505050565b600060208284031215611a33578081fd5b5051919050565b600080600080600060a08688031215611a51578283fd5b611a5a8661177d565b9450602086015193506040860151925060608601519150611a7d6080870161177d565b90509295509295909350565b600060208284031215611a9a578081fd5b815160ff8116811461146b578182fd5b60008251611abc818460208701611cad565b9190910192915050565b6020815260008251806020840152611ae5816040850160208701611cad565b601f01601f19169190910160400192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600067ffffffffffffffff821115611b5e57611b5e611d5d565b5060051b60200190565b60008219821115611b7b57611b7b611d47565b500190565b600082611b9b57634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115611bdb578160001904821115611bc157611bc1611d47565b80851615611bce57918102915b93841c9390800290611ba5565b509250929050565b600061146b60ff841683600082611bfc575060016113bb565b81611c09575060006113bb565b8160018114611c1f5760028114611c2957611c45565b60019150506113bb565b60ff841115611c3a57611c3a611d47565b50506001821b6113bb565b5060208310610133831016604e8410600b8410161715611c68575081810a6113bb565b611c728383611ba0565b8060001904821115611c8657611c86611d47565b029392505050565b6000816000190483118215151615611ca857611ca8611d47565b500290565b60005b83811015611cc8578181015183820152602001611cb0565b8381111561123f5750506000910152565b60e0810181811067ffffffffffffffff82111715611cf957611cf9611d5d565b60405250565b601f8201601f1916810167ffffffffffffffff81118282101715611d2557611d25611d5d565b6040525050565b6000600019821415611d4057611d40611d47565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115611d8857600481823e5160e01c5b90565b600060443d1015611d995790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611dc957505050505090565b8285019150815181811115611de15750505050505090565b843d8701016020828501011115611dfb5750505050505090565b611e0a60208286010187611cff565b509095945050505050565b6001600160a01b038116811461114257600080fd5b801515811461114257600080fdfe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c65644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212203eb95ea52435dbd8bc374844f94ac35ada4fb0e3e0f4c3a1184245a14a192b8364736f6c6343000804003300000000000000000000000052280f10e64a2f866ce49c1da9ce5db1e65c14af

Deployed Bytecode

0x6080604052600436106100d25760003560e01c80637a46ea531161007f5780639164359a116100595780639164359a14610212578063a833e2fa14610287578063efbba8ce146102ea578063f2fde38b146102fd57600080fd5b80637a46ea53146101bf5780638129fc1c146101df5780638da5cb5b146101f457600080fd5b806363779c74116100b057806363779c74146101395780636ed848ea1461018a578063715018a6146101aa57600080fd5b80631fe281b8146100d757806333f150af146100f95780635c38eb3a14610119575b600080fd5b3480156100e357600080fd5b506100f76100f23660046118bf565b61031d565b005b34801561010557600080fd5b506100f76101143660046118bf565b61067b565b34801561012557600080fd5b506100f761013436600461192b565b610cdf565b34801561014557600080fd5b5061016d7f00000000000000000000000052280f10e64a2f866ce49c1da9ce5db1e65c14af81565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561019657600080fd5b506100f76101a5366004611797565b610e3c565b3480156101b657600080fd5b506100f7610ebc565b3480156101cb57600080fd5b506100f76101da366004611958565b610f10565b3480156101eb57600080fd5b506100f7611084565b34801561020057600080fd5b506033546001600160a01b031661016d565b34801561021e57600080fd5b5061025f61022d366004611797565b606660205260009081526040902080546001909101546001600160a01b0391821691811690600160a01b900460ff1683565b604080516001600160a01b039485168152939092166020840152151590820152606001610181565b34801561029357600080fd5b506102c96102a2366004611797565b6065602052600090815260409020546001600160a01b03811690600160a01b900460ff1682565b604080516001600160a01b03909316835260ff909116602083015201610181565b6100f76102f83660046117cf565b611145565b34801561030957600080fd5b506100f7610318366004611797565b611245565b6001600160a01b038181166000908152606660209081526040918290208251606081018452815485168152600190910154938416918101829052600160a01b90930460ff16151591830191909152610398576040516376bfd6b960e01b81526001600160a01b03831660048201526024015b60405180910390fd5b8251806103b85760405163251f56a160e21b815260040160405180910390fd5b60005b818110156106745760008582815181106103e557634e487b7160e01b600052603260045260246000fd5b602002602001015190506000856001600160a01b03166399fbab88836040518263ffffffff1660e01b815260040161041f91815260200190565b60e06040518083038186803b15801561043757600080fd5b505afa15801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906119a2565b9050600085604001516104825730610488565b85602001515b60405163f800467560e01b8152600481018590526001600160a01b0380831660248301529192509088169063f800467590604401600060405180830381600087803b1580156104d657600080fd5b505af19250505080156104e7575060015b6104f057610660565b606082015186516001600160a01b0390811660009081526065602090815260408083208151808301909252549384168152600160a01b90930460ff16908301529161053a916112fb565b905086604001516105ce57602087015160405163095ea7b360e01b81526001600160a01b037f00000000000000000000000052280f10e64a2f866ce49c1da9ce5db1e65c14af81166004830152602482018790529091169063095ea7b390604401600060405180830381600087803b1580156105b557600080fd5b505af11580156105c9573d6000803e3d6000fd5b505050505b6020870151604051639ef1e4a160e01b81526001600160a01b03918216600482015260248101869052604481018390527f00000000000000000000000052280f10e64a2f866ce49c1da9ce5db1e65c14af90911690639ef1e4a190606401600060405180830381600087803b15801561064657600080fd5b505af115801561065a573d6000803e3d6000fd5b50505050505b5050508061066d90611d2c565b90506103bb565b5050505050565b6001600160a01b038181166000908152606660209081526040918290208251606081018452815485168152600190910154938416918101829052600160a01b90930460ff161515918301919091526106f1576040516376bfd6b960e01b81526001600160a01b038316600482015260240161038f565b8251806107115760405163251f56a160e21b815260040160405180910390fd5b81516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561075457600080fd5b505afa158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c9190611a22565b835160405163095ea7b360e01b81526001600160a01b0387811660048301526024820184905292935091169063095ea7b390604401602060405180830381600087803b1580156107db57600080fd5b505af11580156107ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610813919061190f565b5060005b82811015610c5157600086828151811061084157634e487b7160e01b600052603260045260246000fd5b602002602001015190506000866001600160a01b03166399fbab88836040518263ffffffff1660e01b815260040161087b91815260200190565b60e06040518083038186803b15801561089357600080fd5b505afa1580156108a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cb91906119a2565b6040516327c0b28560e11b8152600481018490529091506000906001600160a01b03891690634f81650a9060240160206040518083038186803b15801561091157600080fd5b505afa158015610925573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109499190611a22565b90506000876040015161095c5730610962565b87602001515b604051635fae8b3d60e01b8152600481018690526001600160a01b038083166024830152919250908a1690635fae8b3d90604401600060405180830381600087803b1580156109b057600080fd5b505af19250505080156109c1575060015b610a95576109cd611d73565b806308c379a01415610a8957506109e2611d8b565b806109ed5750610a8b565b6040517f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006020820152603d016040516020818303038152906040528051906020012081604051602001610a409190611aaa565b604051602081830303815290604052805190602001201415610a8357885160405163112fed8b60e31b81526001600160a01b03909116600482015260240161038f565b50610c3c565b505b3d6000803e3d6000fd5b600283516002811115610ab857634e487b7160e01b600052602160045260246000fd5b14610c3c576000610b16838560200151610ad29190611b68565b8a516001600160a01b039081166000908152606560209081526040918290208251808401909352549283168252600160a01b90920460ff16918101919091526112fb565b90508860400151610baa57602089015160405163095ea7b360e01b81526001600160a01b037f00000000000000000000000052280f10e64a2f866ce49c1da9ce5db1e65c14af81166004830152602482018890529091169063095ea7b390604401600060405180830381600087803b158015610b9157600080fd5b505af1158015610ba5573d6000803e3d6000fd5b505050505b6020890151604051639ef1e4a160e01b81526001600160a01b03918216600482015260248101879052604481018390527f00000000000000000000000052280f10e64a2f866ce49c1da9ce5db1e65c14af90911690639ef1e4a190606401600060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b50505050505b5050505080610c4a90611d2c565b9050610817565b50825160405163095ea7b360e01b81526001600160a01b038681166004830152600060248301529091169063095ea7b390604401602060405180830381600087803b158015610c9f57600080fd5b505af1158015610cb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd7919061190f565b505050505050565b6033546001600160a01b03163314610d275760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b6001600160a01b0382161580610d4457506001600160a01b038116155b15610d625760405163d92e233d60e01b815260040160405180910390fd5b6040518060400160405280826001600160a01b03168152602001826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610db557600080fd5b505afa158015610dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ded9190611a89565b60ff9081169091526001600160a01b039384166000908152606560209081526040909120835181549490920151909216600160a01b026001600160a81b03199093169416939093171790915550565b6033546001600160a01b03163314610e845760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b6001600160a01b0316600090815260666020526040902080546001600160a01b031916815560010180546001600160a81b0319169055565b6033546001600160a01b03163314610f045760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b610f0e60006113c1565b565b6033546001600160a01b03163314610f585760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b6001600160a01b0383161580610f7557506001600160a01b038216155b15610f935760405163d92e233d60e01b815260040160405180910390fd5b6040518060600160405280846001600160a01b031663e9cbd8226040518163ffffffff1660e01b815260040160206040518083038186803b158015610fd757600080fd5b505afa158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100f91906117b3565b6001600160a01b039081168252938416602080830191909152921515604091820152938316600090815260668352849020815181549085166001600160a01b0319909116178155918101516001909201805491909401511515600160a01b026001600160a81b03199091169190921617179055565b600054610100900460ff1661109f5760005460ff16156110a3565b303b155b6111065760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161038f565b600054610100900460ff16158015611128576000805461ffff19166101011790555b611130611413565b8015611142576000805461ff00191690555b50565b6033546001600160a01b0316331461118d5760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b60005b835181101561123f5761122c8382815181106111bc57634e487b7160e01b600052603260045260246000fd5b60200260200101518383815181106111e457634e487b7160e01b600052603260045260246000fd5b602002602001015186848151811061120c57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166114429092919063ffffffff16565b508061123781611d2c565b915050611190565b50505050565b6033546001600160a01b0316331461128d5760405162461bcd60e51b81526020600482018190526024820152600080516020611e62833981519152604482015260640161038f565b6001600160a01b0381166112f25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161038f565b611142816113c1565b80516000906001600160a01b03166113145750816113bb565b600082600001516001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561135357600080fd5b505afa158015611367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138b9190611a3a565b505050915050808360200151600a6113a39190611be3565b6113ad9086611c8e565b6113b79190611b80565b9150505b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661143a5760405162461bcd60e51b815260040161038f90611af9565b610f0e611472565b6060611468848484604051806060016040528060298152602001611e39602991396114a2565b90505b9392505050565b600054610100900460ff166114995760405162461bcd60e51b815260040161038f90611af9565b610f0e336113c1565b6060824710156115035760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161038f565b6001600160a01b0385163b61155a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161038f565b600080866001600160a01b031685876040516115769190611aaa565b60006040518083038185875af1925050503d80600081146115b3576040519150601f19603f3d011682016040523d82523d6000602084013e6115b8565b606091505b50915091506115c88282866115d3565b979650505050505050565b606083156115e257508161146b565b8251156115f25782518084602001fd5b8160405162461bcd60e51b815260040161038f9190611ac6565b805161161781611e15565b919050565b6000601f838184011261162d578182fd5b8235602061163a82611b44565b604080516116488382611cff565b8481528381019250878401600586901b890185018a1015611667578788fd5b875b868110156116fa57813567ffffffffffffffff80821115611688578a8bfd5b818c0191508c603f83011261169b578a8bfd5b87820135818111156116af576116af611d5d565b865191506116c5818c01601f19168a0183611cff565b8082528d878285010111156116d8578b8cfd5b808784018a840137810188018b90528652509385019390850190600101611669565b50909998505050505050505050565b600082601f830112611719578081fd5b8135602061172682611b44565b6040516117338282611cff565b8381528281019150858301600585901b87018401881015611752578586fd5b855b8581101561177057813584529284019290840190600101611754565b5090979650505050505050565b805169ffffffffffffffffffff8116811461161757600080fd5b6000602082840312156117a8578081fd5b813561146b81611e15565b6000602082840312156117c4578081fd5b815161146b81611e15565b6000806000606084860312156117e3578182fd5b833567ffffffffffffffff808211156117fa578384fd5b818601915086601f83011261180d578384fd5b8135602061181a82611b44565b6040516118278282611cff565b8381528281019150858301600585901b870184018c1015611846578889fd5b8896505b8487101561187157803561185d81611e15565b83526001969096019591830191830161184a565b5097505087013592505080821115611887578384fd5b6118938783880161161c565b935060408601359150808211156118a8578283fd5b506118b586828701611709565b9150509250925092565b600080604083850312156118d1578081fd5b823567ffffffffffffffff8111156118e7578182fd5b6118f385828601611709565b925050602083013561190481611e15565b809150509250929050565b600060208284031215611920578081fd5b815161146b81611e2a565b6000806040838503121561193d578182fd5b823561194881611e15565b9150602083013561190481611e15565b60008060006060848603121561196c578081fd5b833561197781611e15565b9250602084013561198781611e15565b9150604084013561199781611e2a565b809150509250925092565b600060e082840312156119b3578081fd5b6040516119bf81611cd9565b8251600381106119cd578283fd5b8082525060208301516020820152604083015160408201526060830151606082015260808301516080820152611a0560a0840161160c565b60a0820152611a1660c0840161160c565b60c08201529392505050565b600060208284031215611a33578081fd5b5051919050565b600080600080600060a08688031215611a51578283fd5b611a5a8661177d565b9450602086015193506040860151925060608601519150611a7d6080870161177d565b90509295509295909350565b600060208284031215611a9a578081fd5b815160ff8116811461146b578182fd5b60008251611abc818460208701611cad565b9190910192915050565b6020815260008251806020840152611ae5816040850160208701611cad565b601f01601f19169190910160400192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600067ffffffffffffffff821115611b5e57611b5e611d5d565b5060051b60200190565b60008219821115611b7b57611b7b611d47565b500190565b600082611b9b57634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115611bdb578160001904821115611bc157611bc1611d47565b80851615611bce57918102915b93841c9390800290611ba5565b509250929050565b600061146b60ff841683600082611bfc575060016113bb565b81611c09575060006113bb565b8160018114611c1f5760028114611c2957611c45565b60019150506113bb565b60ff841115611c3a57611c3a611d47565b50506001821b6113bb565b5060208310610133831016604e8410600b8410161715611c68575081810a6113bb565b611c728383611ba0565b8060001904821115611c8657611c86611d47565b029392505050565b6000816000190483118215151615611ca857611ca8611d47565b500290565b60005b83811015611cc8578181015183820152602001611cb0565b8381111561123f5750506000910152565b60e0810181811067ffffffffffffffff82111715611cf957611cf9611d5d565b60405250565b601f8201601f1916810167ffffffffffffffff81118282101715611d2557611d25611d5d565b6040525050565b6000600019821415611d4057611d40611d47565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115611d8857600481823e5160e01c5b90565b600060443d1015611d995790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611dc957505050505090565b8285019150815181811115611de15750505050505090565b843d8701016020828501011115611dfb5750505050505090565b611e0a60208286010187611cff565b509095945050505050565b6001600160a01b038116811461114257600080fd5b801515811461114257600080fdfe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c65644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212203eb95ea52435dbd8bc374844f94ac35ada4fb0e3e0f4c3a1184245a14a192b8364736f6c63430008040033

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

00000000000000000000000052280f10e64a2f866ce49c1da9ce5db1e65c14af

-----Decoded View---------------
Arg [0] : _auction (address): 0x52280f10e64a2F866Ce49C1DA9cE5dB1e65C14af

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000052280f10e64a2f866ce49c1da9ce5db1e65c14af


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

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.