ETH Price: $3,914.91 (+0.64%)
Gas: 7.77 Gwei

Contract

0x090B2787D6798000710a8e821EC6111d254bb958
 
Transaction Hash
Method
Block
From
To
Withdraw200556492024-06-09 17:06:23187 days ago1717952783IN
0x090B2787...d254bb958
0 ETH0.0037953612.37909237
Withdraw200556372024-06-09 17:03:47187 days ago1717952627IN
0x090B2787...d254bb958
0 ETH0.0037555212.34219747
Withdraw200556272024-06-09 17:01:47187 days ago1717952507IN
0x090B2787...d254bb958
0 ETH0.0038963312.80444992
Withdraw200556152024-06-09 16:59:11187 days ago1717952351IN
0x090B2787...d254bb958
0 ETH0.0040326913.25258477
Burn200555952024-06-09 16:55:11187 days ago1717952111IN
0x090B2787...d254bb958
0 ETH0.0045025412.92619558
Mint200333512024-06-06 14:22:11190 days ago1717683731IN
0x090B2787...d254bb958
0 ETH0.0162083727.73915795
Deposit Asset To...200333392024-06-06 14:19:47190 days ago1717683587IN
0x090B2787...d254bb958
0 ETH0.00210328.62747978
Withdraw197197502024-04-23 18:01:59234 days ago1713895319IN
0x090B2787...d254bb958
0 ETH0.0038891513.1812934
Withdraw197197392024-04-23 17:59:47234 days ago1713895187IN
0x090B2787...d254bb958
0 ETH0.0029675913.39514118
Withdraw193047102024-02-25 12:51:11292 days ago1708865471IN
0x090B2787...d254bb958
0 ETH0.0021478324.68122702
Withdraw191659822024-02-06 1:39:35312 days ago1707183575IN
0x090B2787...d254bb958
0 ETH0.0015848418.21177656
Burn191659582024-02-06 1:34:47312 days ago1707183287IN
0x090B2787...d254bb958
0 ETH0.0061346217.59717298
Withdraw191420072024-02-02 16:49:47315 days ago1706892587IN
0x090B2787...d254bb958
0 ETH0.0050425123.17664059
Burn191419992024-02-02 16:47:59315 days ago1706892479IN
0x090B2787...d254bb958
0 ETH0.0098959524.97672807
Withdraw191059422024-01-28 15:32:11320 days ago1706455931IN
0x090B2787...d254bb958
0 ETH0.0032910314.93339542
Withdraw191059372024-01-28 15:31:11320 days ago1706455871IN
0x090B2787...d254bb958
0 ETH0.0034430615.78800445
Withdraw191059302024-01-28 15:29:47320 days ago1706455787IN
0x090B2787...d254bb958
0 ETH0.0030437113.9568029
Burn191059172024-01-28 15:27:11320 days ago1706455631IN
0x090B2787...d254bb958
0 ETH0.0045054913.40718156
Burn191058142024-01-28 15:06:23320 days ago1706454383IN
0x090B2787...d254bb958
0 ETH0.0058188117.566826
Withdraw190805622024-01-25 2:09:35324 days ago1706148575IN
0x090B2787...d254bb958
0 ETH0.0027855712.64119089
Withdraw190747412024-01-24 6:34:11325 days ago1706078051IN
0x090B2787...d254bb958
0 ETH0.001982328.99646367
Burn190747362024-01-24 6:33:11325 days ago1706077991IN
0x090B2787...d254bb958
0 ETH0.003729619.13040388
Burn190687102024-01-23 10:15:35325 days ago1706004935IN
0x090B2787...d254bb958
0 ETH0.008644320.86554861
Withdraw189816442024-01-11 5:35:11338 days ago1704951311IN
0x090B2787...d254bb958
0 ETH0.0070224224.91573377
Deposit Asset To...189651112024-01-08 21:58:23340 days ago1704751103IN
0x090B2787...d254bb958
0 ETH0.0128834222.52334682
View all transactions

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
181101522023-09-11 2:31:59460 days ago1694399519
0x090B2787...d254bb958
10 ETH
180905682023-09-08 8:40:23463 days ago1694162423
0x090B2787...d254bb958
1 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LybraRETHVault

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : LybraRETHVault.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.17;

import "../interfaces/IEUSD.sol";
import "./base/LybraPeUSDVaultBase.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

interface IRETH {
    function getExchangeRate() external view returns (uint256);
}

interface IRocketDepositPool {
    function deposit() external payable;
}
interface IRocketStorageInterface {
    function getAddress(bytes32 _key) external view returns (address);
}

contract LybraRETHVault is LybraPeUSDVaultBase, ReentrancyGuard {
    IRocketStorageInterface immutable rocketStorage;

    // _rocketStorageAddress = 0x1d8f8f00cfa6758d7bE78336684788Fb0ee0Fa46
    // _rETH = 0xae78736Cd615f374D3085123A210448E74Fc6393
    constructor(address _rocketStorageAddress, address _rETH, address _oracle, address _config)
        LybraPeUSDVaultBase(_rETH, _oracle, _config) {
        rocketStorage = IRocketStorageInterface(_rocketStorageAddress);
    }

    function depositEtherToMint(uint256 mintAmount) nonReentrant external payable override {
        require(msg.value >= 1 ether, "DNL");
        uint256 preBalance = collateralAsset.balanceOf(address(this));
        IRocketDepositPool(rocketStorage.getAddress(keccak256(abi.encodePacked("contract.address", "rocketDepositPool")))).deposit{value: msg.value}();
        uint256 balance = collateralAsset.balanceOf(address(this));
        depositedAsset[msg.sender] += balance - preBalance;

        if (mintAmount > 0) {
            _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());
        }

        emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);
    }

    function getAssetPrice() public override returns (uint256) {
        return (_etherPrice() * IRETH(address(collateralAsset)).getExchangeRate()) / 1e18;
    }

    function getAsset2EtherExchangeRate() external view override returns (uint256) {
        return IRETH(address(collateralAsset)).getExchangeRate();
    }
}

File 2 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

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

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}

File 4 of 13 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 5 of 13 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 6 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 7 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 8 of 13 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 9 of 13 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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 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) {
        return msg.sender;
    }

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

File 10 of 13 : Iconfigurator.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.17;

interface Iconfigurator {
    function mintVault(address pool) external view returns(bool);
    function mintVaultMaxSupply(address pool) external view returns(uint256);
    function vaultMintPaused(address pool) external view returns(bool);
    function vaultBurnPaused(address pool) external view returns(bool);
    function tokenMiner(address pool) external view returns(bool);
    function getSafeCollateralRatio(address pool) external view returns(uint256);
    function getBadCollateralRatio(address pool) external view returns(uint256);
    function getVaultWeight(address pool) external view returns (uint256);
    function vaultMintFeeApy(address pool) external view returns(uint256);
    function vaultKeeperRatio(address pool) external view returns(uint256);
    function redemptionFee() external view returns(uint256);
    function getEUSDAddress() external view returns(address);
    function peUSD() external view returns(address);
    function eUSDMiningIncentives() external view returns(address);
    function getProtocolRewardsPool() external view returns(address);
    function flashloanFee() external view returns(uint256);
    function getEUSDMaxLocked() external view returns (uint256);
    function stableToken() external view returns (address);
    function isRedemptionProvider(address user) external view returns (bool);
    function becomeRedemptionProvider(bool _bool) external;
    function refreshMintReward(address user) external;
    function distributeRewards() external;
    function hasRole(bytes32 role, address account) external view returns (bool);
}

File 11 of 13 : IEUSD.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;

interface IEUSD {
    function totalSupply() external view returns (uint256);

    function getTotalShares() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function sharesOf(address _account) external view returns (uint256);

    function allowance(
        address owner,
        address spender
    ) external view returns (uint256);

    function approve(address _spender, uint256 _amount) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);

    function transferShares(
        address _recipient,
        uint256 _sharesAmount
    ) external returns (uint256);

    function getSharesByMintedEUSD(
        uint256 _EUSDAmount
    ) external view returns (uint256);

    function getMintedEUSDByShares(
        uint256 _sharesAmount
    ) external view returns (uint256);

    function mint(
        address _recipient,
        uint256 _mintAmount
    ) external returns (uint256 newTotalShares);

    function burnShares(
        address _account,
        uint256 burnAmount
    ) external returns (uint256 newTotalShares);

    function burn(
        address _account,
        uint256 burnAmount
    ) external returns (uint256 newTotalShares);

    function transfer(address to, uint256 amount) external returns (bool);
}

File 12 of 13 : IPeUSD.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;

interface IPeUSD {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
    function convertToPeUSD(address user, uint256 eusdAmount) external;
    function mint(
        address to,
        uint256 amount
    ) external returns (bool);
    function burn(
        address account,
        uint256 amount
    ) external returns (bool);
}

File 13 of 13 : LybraPeUSDVaultBase.sol
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.17;

import "../../interfaces/Iconfigurator.sol";
import "../../interfaces/IPeUSD.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IPriceFeed {
    function fetchPrice() external returns (uint256);
}

abstract contract LybraPeUSDVaultBase {
    using SafeERC20 for IERC20;
    IPeUSD public immutable PeUSD;
    IERC20 public immutable collateralAsset;
    Iconfigurator public immutable configurator;
    uint256 poolTotalCirculation;
    IPriceFeed immutable etherOracle;

    mapping(address => uint256) public depositedAsset;
    mapping(address => uint256) borrowed;
    mapping(address => uint256) feeStored;
    mapping(address => uint256) feeUpdatedAt;

    event DepositEther(address indexed onBehalfOf, address asset, uint256 etherAmount, uint256 assetAmount, uint256 timestamp);

    event DepositAsset(address indexed onBehalfOf, address asset, uint256 amount, uint256 timestamp);
    event WithdrawAsset(address indexed sponsor, address asset, address indexed onBehalfOf, uint256 amount, uint256 timestamp);
    event Mint(address indexed sponsor, address indexed onBehalfOf, uint256 amount, uint256 timestamp);
    event Burn(address indexed sponsor, address indexed onBehalfOf, uint256 amount, uint256 timestamp);
    event LiquidationRecord(address indexed provider, address indexed keeper, address indexed onBehalfOf, uint256 eusdamount, uint256 LiquidateAssetAmount, uint256 keeperReward, bool superLiquidation, uint256 timestamp);

    event RigidRedemption(address indexed caller, address indexed provider, uint256 peusdAmount, uint256 assetAmount, uint256 timestamp);
    event FeeDistribution(address indexed feeAddress, uint256 feeAmount, uint256 timestamp);

    constructor(address _collateral, address _etherOracle, address _configurator) {
        collateralAsset = IERC20(_collateral);
        configurator = Iconfigurator(_configurator);
        PeUSD = IPeUSD(configurator.peUSD());
        etherOracle = IPriceFeed(_etherOracle);
    }

    function totalDepositedAsset() public view virtual returns (uint256) {
        return collateralAsset.balanceOf(address(this));
    }

    function depositEtherToMint(uint256 mintAmount) external payable virtual;

    /**
     * @notice Deposit staked ETH, update the interest distribution, can mint peUSD directly
     * Emits a `DepositAsset` event.
     *
     * Requirements:
     * - `assetAmount` Must be higher than 0.
     * - `mintAmount` Send 0 if doesn't mint peUSD
     */
    function depositAssetToMint(uint256 assetAmount, uint256 mintAmount) external virtual {
        require(assetAmount >= 1 ether, "Deposit should not be less than 1 collateral asset.");
        collateralAsset.safeTransferFrom(msg.sender, address(this), assetAmount);

        depositedAsset[msg.sender] += assetAmount;
        if (mintAmount > 0) {
            uint256 assetPrice = getAssetPrice();
            _mintPeUSD(msg.sender, msg.sender, mintAmount, assetPrice);
        }
        emit DepositAsset(msg.sender, address(collateralAsset), assetAmount, block.timestamp);
    }

    /**
     * @notice Withdraw collateral assets to an address
     * Emits a `WithdrawAsset` event.
     *
     * Requirements:
     * - `onBehalfOf` cannot be the zero address.
     * - `amount` Must be higher than 0.
     *
     * @dev Withdraw collateral. Check user’s collateral ratio after withdrawal, should be higher than `safeCollateralRatio`
     */
    function withdraw(address onBehalfOf, uint256 amount) external virtual {
        require(onBehalfOf != address(0), "TZA");
        require(amount != 0, "ZA");
        _withdraw(msg.sender, onBehalfOf, amount);
    }

    /**
     * @notice The mint amount number of peUSD is minted to the address
     * Emits a `Mint` event.
     *
     * Requirements:
     * - `onBehalfOf` cannot be the zero address.
     */
    function mint(address onBehalfOf, uint256 amount) external virtual {
        require(onBehalfOf != address(0), "TZA");
        require(amount != 0, "ZA");
        _mintPeUSD(msg.sender, onBehalfOf, amount, getAssetPrice());
    }

    /**
     * @notice Burn the amount of peUSD and payback the amount of minted peUSD
     * Emits a `Burn` event.
     * Requirements:
     * - `onBehalfOf` cannot be the zero address.
     * - `amount` Must be higher than 0.
     * @dev Calling the internal`_repay`function.
     */
    function burn(address onBehalfOf, uint256 amount) external virtual {
        require(onBehalfOf != address(0), "TZA");
        require(amount != 0, "ZA");
        _repay(msg.sender, onBehalfOf, amount);
    }

    /**
     * @notice Keeper liquidates borrowers whose collateral ratio is below badCollateralRatio, using peUSD provided by Liquidation Provider.
     *
     * Requirements:
     * - onBehalfOf Collateral Ratio should be below badCollateralRatio
     * - assetAmount should be less than 50% of collateral
     * - provider should authorize Lybra to utilize peUSD
     * @dev After liquidation, borrower's debt is reduced by assetAmount * assetPrice, providers and keepers can receive up to an additional 10% liquidation reward.
     */
    function liquidation(address provider, address onBehalfOf, uint256 assetAmount) external virtual {
        uint256 assetPrice = getAssetPrice();
        uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / getBorrowedOf(onBehalfOf);
        require(onBehalfOfCollateralRatio < configurator.getBadCollateralRatio(address(this)), "Borrowers collateral ratio should below badCollateralRatio");

        require(assetAmount * 2 <= depositedAsset[onBehalfOf], "a max of 50% collateral can be liquidated");
        require(PeUSD.allowance(provider, address(this)) != 0 || msg.sender == provider, "provider should authorize to provide liquidation peUSD");
        uint256 peusdAmount = (assetAmount * assetPrice) / 1e18;

        _repay(provider, onBehalfOf, peusdAmount);
        uint256 reducedAsset = assetAmount;
        if(onBehalfOfCollateralRatio > 1e20 && onBehalfOfCollateralRatio < 11e19) {
            reducedAsset = assetAmount * onBehalfOfCollateralRatio / 1e20;
        }
        if(onBehalfOfCollateralRatio >= 11e19) {
            reducedAsset = assetAmount * 11 / 10;
        }
        depositedAsset[onBehalfOf] -= reducedAsset;
        uint256 reward2keeper;
        uint256 keeperRatio = configurator.vaultKeeperRatio(address(this));
        if (msg.sender != provider && onBehalfOfCollateralRatio >= 1e20 + keeperRatio * 1e18) {
            reward2keeper = assetAmount * keeperRatio / 100;
            collateralAsset.safeTransfer(msg.sender, reward2keeper);
        }
        collateralAsset.safeTransfer(provider, reducedAsset - reward2keeper);
        emit LiquidationRecord(provider, msg.sender, onBehalfOf, peusdAmount, reducedAsset, reward2keeper, false, block.timestamp);
    }

    /**
     * @notice Choose a Redemption Provider, Rigid Redeem `peusdAmount` of peUSD and get 1:1 value of collateral
     * Emits a `RigidRedemption` event.
     *
     * *Requirements:
     * - `provider` must be a Redemption Provider
     * - `provider`debt must equal to or above`peusdAmount`
     * @dev Service Fee for rigidRedemption `redemptionFee` is set to 0.5% by default, can be revised by DAO.
     */
    function rigidRedemption(address provider, uint256 peusdAmount, uint256 minReceiveAmount) external virtual {
        require(provider != msg.sender, "CBS");
        require(configurator.isRedemptionProvider(provider), "provider is not a RedemptionProvider");
        require(borrowed[provider] >= peusdAmount, "peusdAmount cannot surpass providers debt");
        uint256 assetPrice = getAssetPrice();
        uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / getBorrowedOf(provider);
        require(providerCollateralRatio >= 100 * 1e18, "The provider's collateral ratio should be not less than 100%.");
        _repay(msg.sender, provider, peusdAmount);
        uint256 collateralAmount = peusdAmount * 1e18 * (10_000 - configurator.redemptionFee()) / assetPrice / 10_000;
        require(collateralAmount >= minReceiveAmount, "EL");
        depositedAsset[provider] -= collateralAmount;
        collateralAsset.safeTransfer(msg.sender, collateralAmount);
        emit RigidRedemption(msg.sender, provider, peusdAmount, collateralAmount, block.timestamp);
    }

    /**
     * @dev Refresh LBR reward before adding providers debt. Refresh Lybra generated service fee before adding totalSupply. Check providers collateralRatio cannot below `safeCollateralRatio`after minting.
     */
    function _mintPeUSD(address _provider, address _onBehalfOf, uint256 _mintAmount, uint256 _assetPrice) internal virtual {
        require(poolTotalCirculation + _mintAmount <= configurator.mintVaultMaxSupply(address(this)), "ESL");
        _updateFee(_provider);

        configurator.refreshMintReward(_provider);

        borrowed[_provider] += _mintAmount;

        PeUSD.mint(_onBehalfOf, _mintAmount);
        poolTotalCirculation += _mintAmount;
        _checkHealth(_provider, _assetPrice);
        emit Mint(_provider, _onBehalfOf, _mintAmount, block.timestamp);
    }

    /**
     * @notice Burn _provideramount peUSD to payback minted peUSD for _onBehalfOf.
     *
     * @dev Refresh LBR reward before reducing providers debt. Refresh Lybra generated service fee before reducing totalPeUSDCirculation.
     */
    function _repay(address _provider, address _onBehalfOf, uint256 _amount) internal virtual {
        configurator.refreshMintReward(_onBehalfOf);
        _updateFee(_onBehalfOf);
        uint256 totalFee = feeStored[_onBehalfOf];
        uint256 amount = borrowed[_onBehalfOf] + totalFee >= _amount ? _amount : borrowed[_onBehalfOf] + totalFee;
        if(amount > totalFee) {
            feeStored[_onBehalfOf] = 0;
            PeUSD.transferFrom(_provider, address(configurator), totalFee);
            PeUSD.burn(_provider, amount - totalFee);
            borrowed[_onBehalfOf] -= amount - totalFee;
            poolTotalCirculation -= amount - totalFee;
        } else {
            feeStored[_onBehalfOf] = totalFee - amount;
            PeUSD.transferFrom(_provider, address(configurator), amount);
        }
        try configurator.distributeRewards() {} catch {}
        emit Burn(_provider, _onBehalfOf, amount, block.timestamp);
    }

    function _withdraw(address _provider, address _onBehalfOf, uint256 _amount) internal virtual {
        require(depositedAsset[_provider] >= _amount, "Withdraw amount exceeds deposited amount.");
        depositedAsset[_provider] -= _amount;
        collateralAsset.safeTransfer(_onBehalfOf, _amount);
        if (getBorrowedOf(_provider) > 0) {
            _checkHealth(_provider, getAssetPrice());
        }
        emit WithdrawAsset(_provider, address(collateralAsset), _onBehalfOf, _amount, block.timestamp);
    }

    /**
     * @dev Get USD value of current collateral asset and minted peUSD through price oracle / Collateral asset USD value must higher than safe Collateral Ratio.
     */
    function _checkHealth(address user, uint256 price) internal view {
        if (((depositedAsset[user] * price * 100) / getBorrowedOf(user)) < configurator.getSafeCollateralRatio(address(this))) 
            revert("collateralRatio is Below safeCollateralRatio");
    }

    function _updateFee(address user) internal {
        if (block.timestamp > feeUpdatedAt[user]) {
            feeStored[user] += _newFee(user);
            feeUpdatedAt[user] = block.timestamp;
        }
    }

    function _newFee(address user) internal view returns (uint256) {
        return (borrowed[user] * configurator.vaultMintFeeApy(address(this)) * (block.timestamp - feeUpdatedAt[user])) / (86_400 * 365) / 10_000;
    }

    /**
     * @dev Return USD value of current ETH through Liquity PriceFeed Contract.
     */
    function _etherPrice() internal returns (uint256) {
        return etherOracle.fetchPrice();
    }

    /**
     * @dev Returns the current borrowing amount for the user, including borrowed shares and accumulated fees.
     * @param user The address of the user.
     * @return The total borrowing amount for the user.
     */
    function getBorrowedOf(address user) public view returns (uint256) {
        return borrowed[user] + feeStored[user] + _newFee(user);
    }

    function getPoolTotalCirculation() external view returns (uint256) {
        return poolTotalCirculation;
    }

    function getAsset() external view returns (address) {
        return address(collateralAsset);
    }

    function getVaultType() external pure returns (uint8) {
        return 1;
    }

    function getAssetPrice() public virtual returns (uint256);
    function getAsset2EtherExchangeRate() external view virtual returns (uint256);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_rocketStorageAddress","type":"address"},{"internalType":"address","name":"_rETH","type":"address"},{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_config","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sponsor","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"DepositAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"etherAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"DepositEther","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"feeAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"FeeDistribution","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":true,"internalType":"address","name":"keeper","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"uint256","name":"eusdamount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"LiquidateAssetAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"keeperReward","type":"uint256"},{"indexed":false,"internalType":"bool","name":"superLiquidation","type":"bool"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LiquidationRecord","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sponsor","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"peusdAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RigidRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sponsor","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"WithdrawAsset","type":"event"},{"inputs":[],"name":"PeUSD","outputs":[{"internalType":"contract IPeUSD","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collateralAsset","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"configurator","outputs":[{"internalType":"contract Iconfigurator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assetAmount","type":"uint256"},{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"depositAssetToMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"depositEtherToMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"depositedAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAsset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAsset2EtherExchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAssetPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getBorrowedOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolTotalCirculation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVaultType","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"assetAmount","type":"uint256"}],"name":"liquidation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"uint256","name":"peusdAmount","type":"uint256"},{"internalType":"uint256","name":"minReceiveAmount","type":"uint256"}],"name":"rigidRedemption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalDepositedAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101206040523480156200001257600080fd5b50604051620028f1380380620028f18339810160408190526200003591620000fc565b6001600160a01b0380841660a052811660c081905260408051633558a88760e21b8152905185928592859263d562a21c916004808201926020929091908290030181865afa1580156200008c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b2919062000159565b6001600160a01b0390811660805291821660e0525060016005559490941661010052506200017e92505050565b80516001600160a01b0381168114620000f757600080fd5b919050565b600080600080608085870312156200011357600080fd5b6200011e85620000df565b93506200012e60208601620000df565b92506200013e60408601620000df565b91506200014e60608601620000df565b905092959194509250565b6000602082840312156200016c57600080fd5b6200017782620000df565b9392505050565b60805160a05160c05160e051610100516126556200029c600039600061054e01526000611db90152600081816101680152818161090201528181610c6101528181611017015281816112380152818161151d0152818161163f0152818161171c015281816118c7015281816119ce01528181611bb301528181611c5501526120130152600081816101e6015281816102cf015281816103fc015281816104d7015281816106990152818161077b0152818161083e01528181610d3d01528181610d7c01528181610edf01528181610f5901528181611366015281816113ee01528181611ecc0152611f1b01526000818161034301528181610a92015281816117cb015281816119fd01528181611a770152611be201526126556000f3fe6080604052600436106101095760003560e01c806396171e5911610095578063abbc421711610064578063abbc4217146102f1578063ca0b785614610311578063e1e21ba114610331578063e54f088014610365578063f3fef3a31461037a57600080fd5b806396171e59146102685780639754d1dc146102885780639dc29fac1461029d578063aabaecd6146102bd57600080fd5b806340c10f19116100dc57806340c10f19146101b75780635c222bad146101d75780635df104721461020a57806369d83b3c1461021f57806375baf37f1461024c57600080fd5b806305ad83081461010e57806317d145a2146101415780632b507df8146101565780632f0bc965146101a2575b600080fd5b34801561011a57600080fd5b5061012e6101293660046123a5565b61039a565b6040519081526020015b60405180910390f35b34801561014d57600080fd5b5061012e6103e4565b34801561016257600080fd5b5061018a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610138565b6101b56101b03660046123c9565b610474565b005b3480156101c357600080fd5b506101b56101d23660046123e2565b6107e2565b3480156101e357600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061018a565b34801561021657600080fd5b5061012e61083a565b34801561022b57600080fd5b5061012e61023a3660046123a5565b60016020526000908152604090205481565b34801561025857600080fd5b5060405160018152602001610138565b34801561027457600080fd5b506101b561028336600461240e565b61089a565b34801561029457600080fd5b5060005461012e565b3480156102a957600080fd5b506101b56102b83660046123e2565b610e0d565b3480156102c957600080fd5b5061018a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102fd57600080fd5b506101b561030c36600461244f565b610e5e565b34801561031d57600080fd5b506101b561032c366004612471565b610fba565b34801561033d57600080fd5b5061018a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561037157600080fd5b5061012e6113e1565b34801561038657600080fd5b506101b56103953660046123e2565b61148a565b60006103a5826114db565b6001600160a01b0383166000908152600360209081526040808320546002909252909120546103d491906124bc565b6103de91906124bc565b92915050565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906124cf565b905090565b61047c6115d1565b670de0b6b3a76400003410156104bf5760405162461bcd60e51b815260206004820152600360248201526211139360ea1b60448201526064015b60405180910390fd5b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a91906124cf565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166321f8a7216040516020016105bb906f636f6e74726163742e6164647265737360801b8152701c9bd8dad95d11195c1bdcda5d141bdbdb607a1b601082015260210190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016105ef91815260200190565b602060405180830381865afa15801561060c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063091906124e8565b6001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561066a57600080fd5b505af115801561067e573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600093507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506370a082319150602401602060405180830381865afa1580156106ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070e91906124cf565b905061071a8282612505565b33600090815260016020526040812080549091906107399084906124bc565b90915550508215610757576107573333856107526113e1565b61162a565b337f6a7b44958c301c33959b506daa1c81df7d298aa58fd6c510f4fd967f0eb87ce87f0000000000000000000000000000000000000000000000000000000000000000346107a58686612505565b604080516001600160a01b03909416845260208401929092529082015242606082015260800160405180910390a250506107df6001600555565b50565b6001600160a01b0382166108085760405162461bcd60e51b81526004016104b690612518565b806000036108285760405162461bcd60e51b81526004016104b690612535565b6108363383836107526113e1565b5050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561044b573d6000803e3d6000fd5b60006108a46113e1565b905060006108b18461039a565b6001600160a01b0385166000908152600160205260409020546108d5908490612551565b6108e0906064612551565b6108ea9190612568565b60405163355360cb60e21b81523060048201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d54d832c90602401602060405180830381865afa158015610951573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097591906124cf565b81106109e95760405162461bcd60e51b815260206004820152603a60248201527f426f72726f7765727320636f6c6c61746572616c20726174696f2073686f756c60448201527f642062656c6f7720626164436f6c6c61746572616c526174696f00000000000060648201526084016104b6565b6001600160a01b038416600090815260016020526040902054610a0d846002612551565b1115610a6d5760405162461bcd60e51b815260206004820152602960248201527f61206d6178206f662035302520636f6c6c61746572616c2063616e206265206c6044820152681a5c5d5a59185d195960ba1b60648201526084016104b6565b604051636eb1769f60e11b81526001600160a01b0386811660048301523060248301527f0000000000000000000000000000000000000000000000000000000000000000169063dd62ed3e90604401602060405180830381865afa158015610ad9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afd91906124cf565b151580610b125750336001600160a01b038616145b610b7d5760405162461bcd60e51b815260206004820152603660248201527f70726f76696465722073686f756c6420617574686f72697a6520746f2070726f6044820152751d9a5919481b1a5c5d5a59185d1a5bdb881c195554d160521b60648201526084016104b6565b6000670de0b6b3a7640000610b928486612551565b610b9c9190612568565b9050610ba98686836118a8565b8368056bc75e2d6310000083118015610bca57506805f68e8131ecf8000083105b15610bf05768056bc75e2d63100000610be38487612551565b610bed9190612568565b90505b6805f68e8131ecf800008310610c1a57600a610c0d86600b612551565b610c179190612568565b90505b6001600160a01b03861660009081526001602052604081208054839290610c42908490612505565b909155505060405163b300a55960e01b815230600482015260009081907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b300a55990602401602060405180830381865afa158015610cb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd491906124cf565b9050336001600160a01b038a1614801590610d135750610cfc81670de0b6b3a7640000612551565b610d0f9068056bc75e2d631000006124bc565b8510155b15610d64576064610d248289612551565b610d2e9190612568565b9150610d646001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163384611d0f565b610da389610d728486612505565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190611d0f565b6040805185815260208101859052908101839052600060608201524260808201526001600160a01b03808a169133918c16907fb59dc9737d55b75fc6ca7522e82d6161da5d7c8337b9ab990a5846f95b5ccdad9060a00160405180910390a4505050505050505050565b6001600160a01b038216610e335760405162461bcd60e51b81526004016104b690612518565b80600003610e535760405162461bcd60e51b81526004016104b690612535565b6108363383836118a8565b670de0b6b3a7640000821015610ed25760405162461bcd60e51b815260206004820152603360248201527f4465706f7369742073686f756c64206e6f74206265206c657373207468616e20604482015272189031b7b63630ba32b930b61030b9b9b2ba1760691b60648201526084016104b6565b610f076001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611d77565b3360009081526001602052604081208054849290610f269084906124bc565b90915550508015610f4b576000610f3b6113e1565b9050610f493333848461162a565b505b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152602081018490524281830152905133917ff80e165f76857acc123ffe20b1116e9ec31ad7f2c4ecd6f379a9cc9151b50371919081900360600190a25050565b336001600160a01b03841603610ff85760405162461bcd60e51b815260206004820152600360248201526243425360e81b60448201526064016104b6565b604051631e24111360e21b81526001600160a01b0384811660048301527f00000000000000000000000000000000000000000000000000000000000000001690637890444c90602401602060405180830381865afa15801561105e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611082919061258a565b6110da5760405162461bcd60e51b8152602060048201526024808201527f70726f7669646572206973206e6f74206120526564656d7074696f6e50726f7660448201526334b232b960e11b60648201526084016104b6565b6001600160a01b0383166000908152600260205260409020548211156111545760405162461bcd60e51b815260206004820152602960248201527f7065757364416d6f756e742063616e6e6f7420737572706173732070726f766960448201526819195c9cc81919589d60ba1b60648201526084016104b6565b600061115e6113e1565b9050600061116b8561039a565b6001600160a01b03861660009081526001602052604090205461118f908490612551565b61119a906064612551565b6111a49190612568565b905068056bc75e2d631000008110156112255760405162461bcd60e51b815260206004820152603d60248201527f5468652070726f7669646572277320636f6c6c61746572616c20726174696f2060448201527f73686f756c64206265206e6f74206c657373207468616e20313030252e00000060648201526084016104b6565b6112303386866118a8565b6000612710837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663458f58156040518163ffffffff1660e01b8152600401602060405180830381865afa158015611294573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b891906124cf565b6112c490612710612505565b6112d688670de0b6b3a7640000612551565b6112e09190612551565b6112ea9190612568565b6112f49190612568565b90508381101561132b5760405162461bcd60e51b8152602060048201526002602482015261115360f21b60448201526064016104b6565b6001600160a01b03861660009081526001602052604081208054839290611353908490612505565b9091555061138d90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383611d0f565b6040805186815260208101839052428183015290516001600160a01b0388169133917f1a7ab636ab77b4d93c0afba804a009a127e77def45e623e572144ca8f8a03ac59181900360600190a3505050505050565b6000670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561144a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146e91906124cf565b611476611db5565b6114809190612551565b61046f9190612568565b6001600160a01b0382166114b05760405162461bcd60e51b81526004016104b690612518565b806000036114d05760405162461bcd60e51b81526004016104b690612535565b610836338383611e17565b6001600160a01b038116600090815260046020526040812054612710906301e13380906115089042612505565b604051630440bd9560e21b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631102f65490602401602060405180830381865afa15801561156c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159091906124cf565b6001600160a01b0386166000908152600260205260409020546115b39190612551565b6115bd9190612551565b6115c79190612568565b6103de9190612568565b6002600554036116235760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104b6565b6002600555565b6040516333050e8160e21b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063cc143a0490602401602060405180830381865afa15801561168e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b291906124cf565b826000546116c091906124bc565b11156116f45760405162461bcd60e51b81526020600482015260036024820152621154d360ea1b60448201526064016104b6565b6116fd84611f8c565b604051636f086f1360e11b81526001600160a01b0385811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063de10de2690602401600060405180830381600087803b15801561176057600080fd5b505af1158015611774573d6000803e3d6000fd5b505050506001600160a01b038416600090815260026020526040812080548492906117a09084906124bc565b90915550506040516340c10f1960e01b81526001600160a01b038481166004830152602482018490527f000000000000000000000000000000000000000000000000000000000000000016906340c10f19906044016020604051808303816000875af1158015611814573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611838919061258a565b508160008082825461184a91906124bc565b9091555061185a90508482611ffe565b604080518381524260208201526001600160a01b0380861692908716917f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee910160405180910390a350505050565b604051636f086f1360e11b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063de10de2690602401600060405180830381600087803b15801561190b57600080fd5b505af115801561191f573d6000803e3d6000fd5b5050505061192c82611f8c565b6001600160a01b038216600090815260036020908152604080832054600290925282205490919083906119609084906124bc565b101561198f576001600160a01b03841660009081526002602052604090205461198a9083906124bc565b611991565b825b905081811115611b74576001600160a01b0384811660009081526003602052604080822091909155516323b872dd60e01b815286821660048201527f000000000000000000000000000000000000000000000000000000000000000082166024820152604481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303816000875af1158015611a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6c919061258a565b506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016639dc29fac86611aa78585612505565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b16919061258a565b50611b218282612505565b6001600160a01b03851660009081526002602052604081208054909190611b49908490612505565b90915550611b5990508282612505565b600080828254611b699190612505565b90915550611c539050565b611b7e8183612505565b6001600160a01b03858116600090815260036020526040908190209290925590516323b872dd60e01b815286821660048201527f000000000000000000000000000000000000000000000000000000000000000082166024820152604481018390527f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303816000875af1158015611c2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c51919061258a565b505b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636f4a2cd06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611cae57600080fd5b505af1925050508015611cbf575060015b50604080518281524260208201526001600160a01b0380871692908816917f5d624aa9c148153ab3446c1b154f660ee7701e549fe9b62dab7171b1c80e6fa2910160405180910390a35050505050565b6040516001600160a01b038316602482015260448101829052611d7290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261212b565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611daf9085906323b872dd60e01b90608401611d3b565b50505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630fdb11cf6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561044b573d6000803e3d6000fd5b6001600160a01b038316600090815260016020526040902054811115611e915760405162461bcd60e51b815260206004820152602960248201527f576974686472617720616d6f756e742065786365656473206465706f73697465604482015268321030b6b7bab73a1760b91b60648201526084016104b6565b6001600160a01b03831660009081526001602052604081208054839290611eb9908490612505565b90915550611ef390506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168383611d0f565b6000611efe8461039a565b1115611f1557611f1583611f106113e1565b611ffe565b604080517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811682526020820184905242828401529151848316928616917f31c6c2b083b6c6fb9c8345de5c29efda3ef312a42d1bc0d4a3029465080809c1919081900360600190a3505050565b6001600160a01b0381166000908152600460205260409020544211156107df57611fb5816114db565b6001600160a01b03821660009081526003602052604081208054909190611fdd9084906124bc565b90915550506001600160a01b03166000908152600460205260409020429055565b60405163ae91874960e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ae91874990602401602060405180830381865afa158015612062573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208691906124cf565b61208f8361039a565b6001600160a01b0384166000908152600160205260409020546120b3908490612551565b6120be906064612551565b6120c89190612568565b10156108365760405162461bcd60e51b815260206004820152602c60248201527f636f6c6c61746572616c526174696f2069732042656c6f772073616665436f6c60448201526b6c61746572616c526174696f60a01b60648201526084016104b6565b6000612180826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122009092919063ffffffff16565b90508051600014806121a15750808060200190518101906121a1919061258a565b611d725760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104b6565b606061220f8484600085612217565b949350505050565b6060824710156122785760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104b6565b600080866001600160a01b0316858760405161229491906125d0565b60006040518083038185875af1925050503d80600081146122d1576040519150601f19603f3d011682016040523d82523d6000602084013e6122d6565b606091505b50915091506122e7878383876122f2565b979650505050505050565b6060831561236157825160000361235a576001600160a01b0385163b61235a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104b6565b508161220f565b61220f83838151156123765781518083602001fd5b8060405162461bcd60e51b81526004016104b691906125ec565b6001600160a01b03811681146107df57600080fd5b6000602082840312156123b757600080fd5b81356123c281612390565b9392505050565b6000602082840312156123db57600080fd5b5035919050565b600080604083850312156123f557600080fd5b823561240081612390565b946020939093013593505050565b60008060006060848603121561242357600080fd5b833561242e81612390565b9250602084013561243e81612390565b929592945050506040919091013590565b6000806040838503121561246257600080fd5b50508035926020909101359150565b60008060006060848603121561248657600080fd5b833561249181612390565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103de576103de6124a6565b6000602082840312156124e157600080fd5b5051919050565b6000602082840312156124fa57600080fd5b81516123c281612390565b818103818111156103de576103de6124a6565b602080825260039082015262545a4160e81b604082015260600190565b6020808252600290820152615a4160f01b604082015260600190565b80820281158282048414176103de576103de6124a6565b60008261258557634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561259c57600080fd5b815180151581146123c257600080fd5b60005b838110156125c75781810151838201526020016125af565b50506000910152565b600082516125e28184602087016125ac565b9190910192915050565b602081526000825180602084015261260b8160408501602087016125ac565b601f01601f1916919091016040019291505056fea2646970667358221220f40e1e667039c2ae21912a9549e13cf62742ced3a5761539fc0852237395d46564736f6c634300081100330000000000000000000000001d8f8f00cfa6758d7be78336684788fb0ee0fa46000000000000000000000000ae78736cd615f374d3085123a210448e74fc63930000000000000000000000004c517d4e2c851ca76d7ec94b805269df0f2201de000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff

Deployed Bytecode

0x6080604052600436106101095760003560e01c806396171e5911610095578063abbc421711610064578063abbc4217146102f1578063ca0b785614610311578063e1e21ba114610331578063e54f088014610365578063f3fef3a31461037a57600080fd5b806396171e59146102685780639754d1dc146102885780639dc29fac1461029d578063aabaecd6146102bd57600080fd5b806340c10f19116100dc57806340c10f19146101b75780635c222bad146101d75780635df104721461020a57806369d83b3c1461021f57806375baf37f1461024c57600080fd5b806305ad83081461010e57806317d145a2146101415780632b507df8146101565780632f0bc965146101a2575b600080fd5b34801561011a57600080fd5b5061012e6101293660046123a5565b61039a565b6040519081526020015b60405180910390f35b34801561014d57600080fd5b5061012e6103e4565b34801561016257600080fd5b5061018a7f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff81565b6040516001600160a01b039091168152602001610138565b6101b56101b03660046123c9565b610474565b005b3480156101c357600080fd5b506101b56101d23660046123e2565b6107e2565b3480156101e357600080fd5b507f000000000000000000000000ae78736cd615f374d3085123a210448e74fc639361018a565b34801561021657600080fd5b5061012e61083a565b34801561022b57600080fd5b5061012e61023a3660046123a5565b60016020526000908152604090205481565b34801561025857600080fd5b5060405160018152602001610138565b34801561027457600080fd5b506101b561028336600461240e565b61089a565b34801561029457600080fd5b5060005461012e565b3480156102a957600080fd5b506101b56102b83660046123e2565b610e0d565b3480156102c957600080fd5b5061018a7f000000000000000000000000ae78736cd615f374d3085123a210448e74fc639381565b3480156102fd57600080fd5b506101b561030c36600461244f565b610e5e565b34801561031d57600080fd5b506101b561032c366004612471565b610fba565b34801561033d57600080fd5b5061018a7f000000000000000000000000d585aaafa2b58b1cd75092b51ade9fa4ce52f24781565b34801561037157600080fd5b5061012e6113e1565b34801561038657600080fd5b506101b56103953660046123e2565b61148a565b60006103a5826114db565b6001600160a01b0383166000908152600360209081526040808320546002909252909120546103d491906124bc565b6103de91906124bc565b92915050565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000ae78736cd615f374d3085123a210448e74fc63936001600160a01b0316906370a0823190602401602060405180830381865afa15801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906124cf565b905090565b61047c6115d1565b670de0b6b3a76400003410156104bf5760405162461bcd60e51b815260206004820152600360248201526211139360ea1b60448201526064015b60405180910390fd5b6040516370a0823160e01b81523060048201526000907f000000000000000000000000ae78736cd615f374d3085123a210448e74fc63936001600160a01b0316906370a0823190602401602060405180830381865afa158015610526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054a91906124cf565b90507f0000000000000000000000001d8f8f00cfa6758d7be78336684788fb0ee0fa466001600160a01b03166321f8a7216040516020016105bb906f636f6e74726163742e6164647265737360801b8152701c9bd8dad95d11195c1bdcda5d141bdbdb607a1b601082015260210190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016105ef91815260200190565b602060405180830381865afa15801561060c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063091906124e8565b6001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561066a57600080fd5b505af115801561067e573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600093507f000000000000000000000000ae78736cd615f374d3085123a210448e74fc63936001600160a01b031692506370a082319150602401602060405180830381865afa1580156106ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070e91906124cf565b905061071a8282612505565b33600090815260016020526040812080549091906107399084906124bc565b90915550508215610757576107573333856107526113e1565b61162a565b337f6a7b44958c301c33959b506daa1c81df7d298aa58fd6c510f4fd967f0eb87ce87f000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393346107a58686612505565b604080516001600160a01b03909416845260208401929092529082015242606082015260800160405180910390a250506107df6001600555565b50565b6001600160a01b0382166108085760405162461bcd60e51b81526004016104b690612518565b806000036108285760405162461bcd60e51b81526004016104b690612535565b6108363383836107526113e1565b5050565b60007f000000000000000000000000ae78736cd615f374d3085123a210448e74fc63936001600160a01b031663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561044b573d6000803e3d6000fd5b60006108a46113e1565b905060006108b18461039a565b6001600160a01b0385166000908152600160205260409020546108d5908490612551565b6108e0906064612551565b6108ea9190612568565b60405163355360cb60e21b81523060048201529091507f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff6001600160a01b03169063d54d832c90602401602060405180830381865afa158015610951573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097591906124cf565b81106109e95760405162461bcd60e51b815260206004820152603a60248201527f426f72726f7765727320636f6c6c61746572616c20726174696f2073686f756c60448201527f642062656c6f7720626164436f6c6c61746572616c526174696f00000000000060648201526084016104b6565b6001600160a01b038416600090815260016020526040902054610a0d846002612551565b1115610a6d5760405162461bcd60e51b815260206004820152602960248201527f61206d6178206f662035302520636f6c6c61746572616c2063616e206265206c6044820152681a5c5d5a59185d195960ba1b60648201526084016104b6565b604051636eb1769f60e11b81526001600160a01b0386811660048301523060248301527f000000000000000000000000d585aaafa2b58b1cd75092b51ade9fa4ce52f247169063dd62ed3e90604401602060405180830381865afa158015610ad9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afd91906124cf565b151580610b125750336001600160a01b038616145b610b7d5760405162461bcd60e51b815260206004820152603660248201527f70726f76696465722073686f756c6420617574686f72697a6520746f2070726f6044820152751d9a5919481b1a5c5d5a59185d1a5bdb881c195554d160521b60648201526084016104b6565b6000670de0b6b3a7640000610b928486612551565b610b9c9190612568565b9050610ba98686836118a8565b8368056bc75e2d6310000083118015610bca57506805f68e8131ecf8000083105b15610bf05768056bc75e2d63100000610be38487612551565b610bed9190612568565b90505b6805f68e8131ecf800008310610c1a57600a610c0d86600b612551565b610c179190612568565b90505b6001600160a01b03861660009081526001602052604081208054839290610c42908490612505565b909155505060405163b300a55960e01b815230600482015260009081907f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff6001600160a01b03169063b300a55990602401602060405180830381865afa158015610cb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd491906124cf565b9050336001600160a01b038a1614801590610d135750610cfc81670de0b6b3a7640000612551565b610d0f9068056bc75e2d631000006124bc565b8510155b15610d64576064610d248289612551565b610d2e9190612568565b9150610d646001600160a01b037f000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393163384611d0f565b610da389610d728486612505565b6001600160a01b037f000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393169190611d0f565b6040805185815260208101859052908101839052600060608201524260808201526001600160a01b03808a169133918c16907fb59dc9737d55b75fc6ca7522e82d6161da5d7c8337b9ab990a5846f95b5ccdad9060a00160405180910390a4505050505050505050565b6001600160a01b038216610e335760405162461bcd60e51b81526004016104b690612518565b80600003610e535760405162461bcd60e51b81526004016104b690612535565b6108363383836118a8565b670de0b6b3a7640000821015610ed25760405162461bcd60e51b815260206004820152603360248201527f4465706f7369742073686f756c64206e6f74206265206c657373207468616e20604482015272189031b7b63630ba32b930b61030b9b9b2ba1760691b60648201526084016104b6565b610f076001600160a01b037f000000000000000000000000ae78736cd615f374d3085123a210448e74fc639316333085611d77565b3360009081526001602052604081208054849290610f269084906124bc565b90915550508015610f4b576000610f3b6113e1565b9050610f493333848461162a565b505b604080516001600160a01b037f000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393168152602081018490524281830152905133917ff80e165f76857acc123ffe20b1116e9ec31ad7f2c4ecd6f379a9cc9151b50371919081900360600190a25050565b336001600160a01b03841603610ff85760405162461bcd60e51b815260206004820152600360248201526243425360e81b60448201526064016104b6565b604051631e24111360e21b81526001600160a01b0384811660048301527f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff1690637890444c90602401602060405180830381865afa15801561105e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611082919061258a565b6110da5760405162461bcd60e51b8152602060048201526024808201527f70726f7669646572206973206e6f74206120526564656d7074696f6e50726f7660448201526334b232b960e11b60648201526084016104b6565b6001600160a01b0383166000908152600260205260409020548211156111545760405162461bcd60e51b815260206004820152602960248201527f7065757364416d6f756e742063616e6e6f7420737572706173732070726f766960448201526819195c9cc81919589d60ba1b60648201526084016104b6565b600061115e6113e1565b9050600061116b8561039a565b6001600160a01b03861660009081526001602052604090205461118f908490612551565b61119a906064612551565b6111a49190612568565b905068056bc75e2d631000008110156112255760405162461bcd60e51b815260206004820152603d60248201527f5468652070726f7669646572277320636f6c6c61746572616c20726174696f2060448201527f73686f756c64206265206e6f74206c657373207468616e20313030252e00000060648201526084016104b6565b6112303386866118a8565b6000612710837f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff6001600160a01b031663458f58156040518163ffffffff1660e01b8152600401602060405180830381865afa158015611294573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b891906124cf565b6112c490612710612505565b6112d688670de0b6b3a7640000612551565b6112e09190612551565b6112ea9190612568565b6112f49190612568565b90508381101561132b5760405162461bcd60e51b8152602060048201526002602482015261115360f21b60448201526064016104b6565b6001600160a01b03861660009081526001602052604081208054839290611353908490612505565b9091555061138d90506001600160a01b037f000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393163383611d0f565b6040805186815260208101839052428183015290516001600160a01b0388169133917f1a7ab636ab77b4d93c0afba804a009a127e77def45e623e572144ca8f8a03ac59181900360600190a3505050505050565b6000670de0b6b3a76400007f000000000000000000000000ae78736cd615f374d3085123a210448e74fc63936001600160a01b031663e6aa216c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561144a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146e91906124cf565b611476611db5565b6114809190612551565b61046f9190612568565b6001600160a01b0382166114b05760405162461bcd60e51b81526004016104b690612518565b806000036114d05760405162461bcd60e51b81526004016104b690612535565b610836338383611e17565b6001600160a01b038116600090815260046020526040812054612710906301e13380906115089042612505565b604051630440bd9560e21b81523060048201527f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff6001600160a01b031690631102f65490602401602060405180830381865afa15801561156c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159091906124cf565b6001600160a01b0386166000908152600260205260409020546115b39190612551565b6115bd9190612551565b6115c79190612568565b6103de9190612568565b6002600554036116235760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104b6565b6002600555565b6040516333050e8160e21b81523060048201527f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff6001600160a01b03169063cc143a0490602401602060405180830381865afa15801561168e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b291906124cf565b826000546116c091906124bc565b11156116f45760405162461bcd60e51b81526020600482015260036024820152621154d360ea1b60448201526064016104b6565b6116fd84611f8c565b604051636f086f1360e11b81526001600160a01b0385811660048301527f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff169063de10de2690602401600060405180830381600087803b15801561176057600080fd5b505af1158015611774573d6000803e3d6000fd5b505050506001600160a01b038416600090815260026020526040812080548492906117a09084906124bc565b90915550506040516340c10f1960e01b81526001600160a01b038481166004830152602482018490527f000000000000000000000000d585aaafa2b58b1cd75092b51ade9fa4ce52f24716906340c10f19906044016020604051808303816000875af1158015611814573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611838919061258a565b508160008082825461184a91906124bc565b9091555061185a90508482611ffe565b604080518381524260208201526001600160a01b0380861692908716917f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee910160405180910390a350505050565b604051636f086f1360e11b81526001600160a01b0383811660048301527f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff169063de10de2690602401600060405180830381600087803b15801561190b57600080fd5b505af115801561191f573d6000803e3d6000fd5b5050505061192c82611f8c565b6001600160a01b038216600090815260036020908152604080832054600290925282205490919083906119609084906124bc565b101561198f576001600160a01b03841660009081526002602052604090205461198a9083906124bc565b611991565b825b905081811115611b74576001600160a01b0384811660009081526003602052604080822091909155516323b872dd60e01b815286821660048201527f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff82166024820152604481018490527f000000000000000000000000d585aaafa2b58b1cd75092b51ade9fa4ce52f247909116906323b872dd906064016020604051808303816000875af1158015611a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6c919061258a565b506001600160a01b037f000000000000000000000000d585aaafa2b58b1cd75092b51ade9fa4ce52f24716639dc29fac86611aa78585612505565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b16919061258a565b50611b218282612505565b6001600160a01b03851660009081526002602052604081208054909190611b49908490612505565b90915550611b5990508282612505565b600080828254611b699190612505565b90915550611c539050565b611b7e8183612505565b6001600160a01b03858116600090815260036020526040908190209290925590516323b872dd60e01b815286821660048201527f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff82166024820152604481018390527f000000000000000000000000d585aaafa2b58b1cd75092b51ade9fa4ce52f247909116906323b872dd906064016020604051808303816000875af1158015611c2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c51919061258a565b505b7f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff6001600160a01b0316636f4a2cd06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611cae57600080fd5b505af1925050508015611cbf575060015b50604080518281524260208201526001600160a01b0380871692908816917f5d624aa9c148153ab3446c1b154f660ee7701e549fe9b62dab7171b1c80e6fa2910160405180910390a35050505050565b6040516001600160a01b038316602482015260448101829052611d7290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261212b565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611daf9085906323b872dd60e01b90608401611d3b565b50505050565b60007f0000000000000000000000004c517d4e2c851ca76d7ec94b805269df0f2201de6001600160a01b0316630fdb11cf6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561044b573d6000803e3d6000fd5b6001600160a01b038316600090815260016020526040902054811115611e915760405162461bcd60e51b815260206004820152602960248201527f576974686472617720616d6f756e742065786365656473206465706f73697465604482015268321030b6b7bab73a1760b91b60648201526084016104b6565b6001600160a01b03831660009081526001602052604081208054839290611eb9908490612505565b90915550611ef390506001600160a01b037f000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393168383611d0f565b6000611efe8461039a565b1115611f1557611f1583611f106113e1565b611ffe565b604080517f000000000000000000000000ae78736cd615f374d3085123a210448e74fc63936001600160a01b0390811682526020820184905242828401529151848316928616917f31c6c2b083b6c6fb9c8345de5c29efda3ef312a42d1bc0d4a3029465080809c1919081900360600190a3505050565b6001600160a01b0381166000908152600460205260409020544211156107df57611fb5816114db565b6001600160a01b03821660009081526003602052604081208054909190611fdd9084906124bc565b90915550506001600160a01b03166000908152600460205260409020429055565b60405163ae91874960e01b81523060048201527f000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff6001600160a01b03169063ae91874990602401602060405180830381865afa158015612062573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208691906124cf565b61208f8361039a565b6001600160a01b0384166000908152600160205260409020546120b3908490612551565b6120be906064612551565b6120c89190612568565b10156108365760405162461bcd60e51b815260206004820152602c60248201527f636f6c6c61746572616c526174696f2069732042656c6f772073616665436f6c60448201526b6c61746572616c526174696f60a01b60648201526084016104b6565b6000612180826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122009092919063ffffffff16565b90508051600014806121a15750808060200190518101906121a1919061258a565b611d725760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104b6565b606061220f8484600085612217565b949350505050565b6060824710156122785760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104b6565b600080866001600160a01b0316858760405161229491906125d0565b60006040518083038185875af1925050503d80600081146122d1576040519150601f19603f3d011682016040523d82523d6000602084013e6122d6565b606091505b50915091506122e7878383876122f2565b979650505050505050565b6060831561236157825160000361235a576001600160a01b0385163b61235a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104b6565b508161220f565b61220f83838151156123765781518083602001fd5b8060405162461bcd60e51b81526004016104b691906125ec565b6001600160a01b03811681146107df57600080fd5b6000602082840312156123b757600080fd5b81356123c281612390565b9392505050565b6000602082840312156123db57600080fd5b5035919050565b600080604083850312156123f557600080fd5b823561240081612390565b946020939093013593505050565b60008060006060848603121561242357600080fd5b833561242e81612390565b9250602084013561243e81612390565b929592945050506040919091013590565b6000806040838503121561246257600080fd5b50508035926020909101359150565b60008060006060848603121561248657600080fd5b833561249181612390565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103de576103de6124a6565b6000602082840312156124e157600080fd5b5051919050565b6000602082840312156124fa57600080fd5b81516123c281612390565b818103818111156103de576103de6124a6565b602080825260039082015262545a4160e81b604082015260600190565b6020808252600290820152615a4160f01b604082015260600190565b80820281158282048414176103de576103de6124a6565b60008261258557634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561259c57600080fd5b815180151581146123c257600080fd5b60005b838110156125c75781810151838201526020016125af565b50506000910152565b600082516125e28184602087016125ac565b9190910192915050565b602081526000825180602084015261260b8160408501602087016125ac565b601f01601f1916919091016040019291505056fea2646970667358221220f40e1e667039c2ae21912a9549e13cf62742ced3a5761539fc0852237395d46564736f6c63430008110033

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

0000000000000000000000001d8f8f00cfa6758d7be78336684788fb0ee0fa46000000000000000000000000ae78736cd615f374d3085123a210448e74fc63930000000000000000000000004c517d4e2c851ca76d7ec94b805269df0f2201de000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff

-----Decoded View---------------
Arg [0] : _rocketStorageAddress (address): 0x1d8f8f00cfa6758d7bE78336684788Fb0ee0Fa46
Arg [1] : _rETH (address): 0xae78736Cd615f374D3085123A210448E74Fc6393
Arg [2] : _oracle (address): 0x4c517D4e2C851CA76d7eC94B805269Df0f2201De
Arg [3] : _config (address): 0xC8353594Eeedc5ce5a4544D3D9907b694c4690Ff

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000001d8f8f00cfa6758d7be78336684788fb0ee0fa46
Arg [1] : 000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393
Arg [2] : 0000000000000000000000004c517d4e2c851ca76d7ec94b805269df0f2201de
Arg [3] : 000000000000000000000000c8353594eeedc5ce5a4544d3d9907b694c4690ff


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.