ETH Price: $1,930.11 (+0.05%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SelfOwnedStETHBurner

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 10 : SelfOwnedStETHBurner.sol
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>

// SPDX-License-Identifier: GPL-3.0

/* See contracts/COMPILERS.md */
pragma solidity 0.8.9;

import "@openzeppelin/contracts-v4.4/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-v4.4/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts-v4.4/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts-v4.4/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts-v4.4/utils/math/Math.sol";
import "./interfaces/IBeaconReportReceiver.sol";
import "./interfaces/ISelfOwnedStETHBurner.sol";

/**
  * @title Interface defining a Lido liquid staking pool
  * @dev see also [Lido liquid staking pool core contract](https://docs.lido.fi/contracts/lido)
  */
interface ILido {
    /**
      * @notice Destroys given amount of shares from account's holdings
      * @param _account address of the shares holder
      * @param _sharesAmount shares amount to burn
      * @dev incurs stETH token rebase by decreasing the total amount of shares.
      */
    function burnShares(address _account, uint256 _sharesAmount) external returns (uint256 newTotalShares);

    /**
      * @notice Gets authorized oracle address
      * @return address of oracle contract.
      */
    function getOracle() external view returns (address);

    /**
      * @notice Get stETH amount by the provided shares amount
      * @param _sharesAmount shares amount
      * @dev dual to `getSharesByPooledEth`.
      */
    function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);

    /**
      * @notice Get shares amount by the provided stETH amount
      * @param _pooledEthAmount stETH amount
      * @dev dual to `getPooledEthByShares`.
      */
    function getSharesByPooledEth(uint256 _pooledEthAmount) external view returns (uint256);

    /**
      * @notice Get shares amount of the provided account
      * @param _account provided account address.
      */
    function sharesOf(address _account) external view returns (uint256);

    /**
      * @notice Get total amount of shares in existence
      */
    function getTotalShares() external view returns (uint256);
}

/**
  * @title Interface for the Lido Beacon Chain Oracle
  */
interface IOracle {
    /**
     * @notice Gets currently set beacon report receiver
     * @return address of a beacon receiver
     */
    function getBeaconReportReceiver() external view returns (address);
}

/**
  * @title A dedicated contract for enacting stETH burning requests
  * @notice See the Lido improvement proposal #6 (LIP-6) spec.
  * @author Eugene Mamin <[email protected]>
  *
  * @dev Burning stETH means 'decrease total underlying shares amount to perform stETH token rebase'
  */
contract SelfOwnedStETHBurner is ISelfOwnedStETHBurner, IBeaconReportReceiver, ERC165 {
    using SafeERC20 for IERC20;

    uint256 private constant MAX_BASIS_POINTS = 10000;

    uint256 private coverSharesBurnRequested;
    uint256 private nonCoverSharesBurnRequested;

    uint256 private totalCoverSharesBurnt;
    uint256 private totalNonCoverSharesBurnt;

    uint256 private maxBurnAmountPerRunBasisPoints = 4; // 0.04% by default for the biggest `stETH:ETH` curve pool

    address public immutable LIDO;
    address public immutable TREASURY;
    address public immutable VOTING;

    /**
      * Emitted when a new single burn quota is set
      */
    event BurnAmountPerRunQuotaChanged(
        uint256 maxBurnAmountPerRunBasisPoints
    );

    /**
      * Emitted when a new stETH burning request is added by the `requestedBy` address.
      */
    event StETHBurnRequested(
        bool indexed isCover,
        address indexed requestedBy,
        uint256 amount,
        uint256 sharesAmount
    );

    /**
      * Emitted when the stETH `amount` (corresponding to `sharesAmount` shares) burnt for the `isCover` reason.
      */
    event StETHBurnt(
        bool indexed isCover,
        uint256 amount,
        uint256 sharesAmount
    );

    /**
      * Emitted when the excessive stETH `amount` (corresponding to `sharesAmount` shares) recovered (i.e. transferred)
      * to the Lido treasure address by `requestedBy` sender.
      */
    event ExcessStETHRecovered(
        address indexed requestedBy,
        uint256 amount,
        uint256 sharesAmount
    );

    /**
      * Emitted when the ERC20 `token` recovered (i.e. transferred)
      * to the Lido treasure address by `requestedBy` sender.
      */
    event ERC20Recovered(
        address indexed requestedBy,
        address indexed token,
        uint256 amount
    );

    /**
      * Emitted when the ERC721-compatible `token` (NFT) recovered (i.e. transferred)
      * to the Lido treasure address by `requestedBy` sender.
      */
    event ERC721Recovered(
        address indexed requestedBy,
        address indexed token,
        uint256 tokenId
    );

    /**
      * Ctor
      *
      * @param _treasury the Lido treasury address (see StETH/ERC20/ERC721-recovery interfaces)
      * @param _lido the Lido token (stETH) address
      * @param _voting the Lido Aragon Voting address
      * @param _totalCoverSharesBurnt Shares burnt counter init value (cover case)
      * @param _totalNonCoverSharesBurnt Shares burnt counter init value (non-cover case)
      * @param _maxBurnAmountPerRunBasisPoints Max burn amount per single run
      */
    constructor(
        address _treasury,
        address _lido,
        address _voting,
        uint256 _totalCoverSharesBurnt,
        uint256 _totalNonCoverSharesBurnt,
        uint256 _maxBurnAmountPerRunBasisPoints
    ) {
        require(_treasury != address(0), "TREASURY_ZERO_ADDRESS");
        require(_lido != address(0), "LIDO_ZERO_ADDRESS");
        require(_voting != address(0), "VOTING_ZERO_ADDRESS");
        require(_maxBurnAmountPerRunBasisPoints > 0, "ZERO_BURN_AMOUNT_PER_RUN");
        require(_maxBurnAmountPerRunBasisPoints <= MAX_BASIS_POINTS, "TOO_LARGE_BURN_AMOUNT_PER_RUN");

        TREASURY = _treasury;
        LIDO = _lido;
        VOTING = _voting;

        totalCoverSharesBurnt = _totalCoverSharesBurnt;
        totalNonCoverSharesBurnt = _totalNonCoverSharesBurnt;

        maxBurnAmountPerRunBasisPoints = _maxBurnAmountPerRunBasisPoints;
    }

    /**
      * Sets the maximum amount of shares allowed to burn per single run (quota).
      *
      * @dev only `voting` allowed to call this function.
      *
      * @param _maxBurnAmountPerRunBasisPoints a fraction expressed in basis points (taken from Lido.totalSharesAmount)
      *
      */
    function setBurnAmountPerRunQuota(uint256 _maxBurnAmountPerRunBasisPoints) external {
        require(_maxBurnAmountPerRunBasisPoints > 0, "ZERO_BURN_AMOUNT_PER_RUN");
        require(_maxBurnAmountPerRunBasisPoints <= MAX_BASIS_POINTS, "TOO_LARGE_BURN_AMOUNT_PER_RUN");
        require(msg.sender == VOTING, "MSG_SENDER_MUST_BE_VOTING");

        emit BurnAmountPerRunQuotaChanged(_maxBurnAmountPerRunBasisPoints);

        maxBurnAmountPerRunBasisPoints = _maxBurnAmountPerRunBasisPoints;
    }

    /**
      * @notice BE CAREFUL, the provided stETH will be burnt permanently.
      * @dev only `voting` allowed to call this function.
      *
      * Transfers `_stETH2Burn` stETH tokens from the message sender and irreversibly locks these
      * on the burner contract address. Internally converts `_stETH2Burn` amount into underlying
      * shares amount (`_stETH2BurnAsShares`) and marks the converted amount for burning
      * by increasing the `coverSharesBurnRequested` counter.
      *
      * @param _stETH2Burn stETH tokens to burn
      *
      */
    function requestBurnMyStETHForCover(uint256 _stETH2Burn) external {
        _requestBurnMyStETH(_stETH2Burn, true);
    }

    /**
      * @notice BE CAREFUL, the provided stETH will be burnt permanently.
      * @dev only `voting` allowed to call this function.
      *
      * Transfers `_stETH2Burn` stETH tokens from the message sender and irreversibly locks these
      * on the burner contract address. Internally converts `_stETH2Burn` amount into underlying
      * shares amount (`_stETH2BurnAsShares`) and marks the converted amount for burning
      * by increasing the `nonCoverSharesBurnRequested` counter.
      *
      * @param _stETH2Burn stETH tokens to burn
      *
      */
    function requestBurnMyStETH(uint256 _stETH2Burn) external {
        _requestBurnMyStETH(_stETH2Burn, false);
    }

    /**
      * Transfers the excess stETH amount (e.g. belonging to the burner contract address
      * but not marked for burning) to the Lido treasury address set upon the
      * contract construction.
      */
    function recoverExcessStETH() external {
        uint256 excessStETH = getExcessStETH();

        if (excessStETH > 0) {
            uint256 excessSharesAmount = ILido(LIDO).getSharesByPooledEth(excessStETH);

            emit ExcessStETHRecovered(msg.sender, excessStETH, excessSharesAmount);

            require(IERC20(LIDO).transfer(TREASURY, excessStETH));
        }
    }

    /**
      * Intentionally deny incoming ether
      */
    receive() external payable {
        revert("INCOMING_ETH_IS_FORBIDDEN");
    }

    /**
      * Transfers a given `_amount` of an ERC20-token (defined by the `_token` contract address)
      * currently belonging to the burner contract address to the Lido treasury address.
      *
      * @param _token an ERC20-compatible token
      * @param _amount token amount
      */
    function recoverERC20(address _token, uint256 _amount) external {
        require(_amount > 0, "ZERO_RECOVERY_AMOUNT");
        require(_token != LIDO, "STETH_RECOVER_WRONG_FUNC");

        emit ERC20Recovered(msg.sender, _token, _amount);

        IERC20(_token).safeTransfer(TREASURY, _amount);
    }

    /**
      * Transfers a given token_id of an ERC721-compatible NFT (defined by the token contract address)
      * currently belonging to the burner contract address to the Lido treasury address.
      *
      * @param _token an ERC721-compatible token
      * @param _tokenId minted token id
      */
    function recoverERC721(address _token, uint256 _tokenId) external {
        emit ERC721Recovered(msg.sender, _token, _tokenId);

        IERC721(_token).transferFrom(address(this), TREASURY, _tokenId);
    }

    /**
     * Enacts cover/non-cover burning requests and logs cover/non-cover shares amount just burnt.
     * Increments `totalCoverSharesBurnt` and `totalNonCoverSharesBurnt` counters.
     * Resets `coverSharesBurnRequested` and `nonCoverSharesBurnRequested` counters to zero.
     * Does nothing if there are no pending burning requests.
     */
    function processLidoOracleReport(uint256, uint256, uint256) external virtual override {
        uint256 memCoverSharesBurnRequested = coverSharesBurnRequested;
        uint256 memNonCoverSharesBurnRequested = nonCoverSharesBurnRequested;

        uint256 burnAmount = memCoverSharesBurnRequested + memNonCoverSharesBurnRequested;

        if (burnAmount == 0) {
            return;
        }

        address oracle = ILido(LIDO).getOracle();

        /**
          * Allow invocation only from `LidoOracle` or previously set composite beacon report receiver.
          * The second condition provides a way to use multiple callbacks packed into a single composite container.
          */
        require(
            msg.sender == oracle
            || (msg.sender == IOracle(oracle).getBeaconReportReceiver()),
            "APP_AUTH_FAILED"
        );

        uint256 maxSharesToBurnNow = (ILido(LIDO).getTotalShares() * maxBurnAmountPerRunBasisPoints) / MAX_BASIS_POINTS;

        if (memCoverSharesBurnRequested > 0) {
            uint256 sharesToBurnNowForCover = Math.min(maxSharesToBurnNow, memCoverSharesBurnRequested);

            totalCoverSharesBurnt += sharesToBurnNowForCover;
            uint256 stETHToBurnNowForCover = ILido(LIDO).getPooledEthByShares(sharesToBurnNowForCover);
            emit StETHBurnt(true /* isCover */, stETHToBurnNowForCover, sharesToBurnNowForCover);

            coverSharesBurnRequested -= sharesToBurnNowForCover;

            // early return if at least one of the conditions is TRUE:
            // - we have reached a capacity per single run already
            // - there are no pending non-cover requests
            if ((sharesToBurnNowForCover == maxSharesToBurnNow) || (memNonCoverSharesBurnRequested == 0)) {
                ILido(LIDO).burnShares(address(this), sharesToBurnNowForCover);
                return;
            }
        }

        // we're here only if memNonCoverSharesBurnRequested > 0
        uint256 sharesToBurnNowForNonCover = Math.min(
            maxSharesToBurnNow - memCoverSharesBurnRequested,
            memNonCoverSharesBurnRequested
        );

        totalNonCoverSharesBurnt += sharesToBurnNowForNonCover;
        uint256 stETHToBurnNowForNonCover = ILido(LIDO).getPooledEthByShares(sharesToBurnNowForNonCover);
        emit StETHBurnt(false /* isCover */, stETHToBurnNowForNonCover, sharesToBurnNowForNonCover);
        nonCoverSharesBurnRequested -= sharesToBurnNowForNonCover;

        ILido(LIDO).burnShares(address(this), memCoverSharesBurnRequested + sharesToBurnNowForNonCover);
    }

    /**
      * Returns the total cover shares ever burnt.
      */
    function getCoverSharesBurnt() external view virtual override returns (uint256) {
        return totalCoverSharesBurnt;
    }

    /**
      * Returns the total non-cover shares ever burnt.
      */
    function getNonCoverSharesBurnt() external view virtual override returns (uint256) {
        return totalNonCoverSharesBurnt;
    }

    /**
      * Returns the max amount of shares allowed to burn per single run
      */
    function getBurnAmountPerRunQuota() external view returns (uint256) {
        return maxBurnAmountPerRunBasisPoints;
    }

    /**
      * Returns the stETH amount belonging to the burner contract address but not marked for burning.
      */
    function getExcessStETH() public view returns (uint256)  {
        uint256 sharesBurnRequested = (coverSharesBurnRequested + nonCoverSharesBurnRequested);
        uint256 totalShares = ILido(LIDO).sharesOf(address(this));

        // sanity check, don't revert
        if (totalShares <= sharesBurnRequested) {
            return 0;
        }

        return ILido(LIDO).getPooledEthByShares(totalShares - sharesBurnRequested);
    }

    function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
        return (
            _interfaceId == type(IBeaconReportReceiver).interfaceId
            || _interfaceId == type(ISelfOwnedStETHBurner).interfaceId
            || super.supportsInterface(_interfaceId)
        );
    }

    function _requestBurnMyStETH(uint256 _stETH2Burn, bool _isCover) private {
        require(_stETH2Burn > 0, "ZERO_BURN_AMOUNT");
        require(msg.sender == VOTING, "MSG_SENDER_MUST_BE_VOTING");
        require(IERC20(LIDO).transferFrom(msg.sender, address(this), _stETH2Burn));

        uint256 sharesAmount = ILido(LIDO).getSharesByPooledEth(_stETH2Burn);

        emit StETHBurnRequested(_isCover, msg.sender, _stETH2Burn, sharesAmount);

        if (_isCover) {
            coverSharesBurnRequested += sharesAmount;
        } else {
            nonCoverSharesBurnRequested += sharesAmount;
        }
    }
}

File 2 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 4 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 5 of 10 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 6 of 10 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 7 of 10 : IBeaconReportReceiver.sol
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>

// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.9;

/**
  * @title Interface defining a callback that the quorum will call on every quorum reached
  */
interface IBeaconReportReceiver {
    /**
      * @notice Callback to be called by the oracle contract upon the quorum is reached
      * @param _postTotalPooledEther total pooled ether on Lido right after the quorum value was reported
      * @param _preTotalPooledEther total pooled ether on Lido right before the quorum value was reported
      * @param _timeElapsed time elapsed in seconds between the last and the previous quorum
      */
    function processLidoOracleReport(uint256 _postTotalPooledEther,
                                     uint256 _preTotalPooledEther,
                                     uint256 _timeElapsed) external;
}

File 8 of 10 : ISelfOwnedStETHBurner.sol
// SPDX-FileCopyrightText: 2022 Lido <[email protected]>

// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.9;

/**
  * @title Interface defining a "client-side" of the `SelfOwnedStETHBurner` contract.
  */
interface ISelfOwnedStETHBurner {
    /**
      * Returns the total cover shares ever burnt.
      */
    function getCoverSharesBurnt() external view returns (uint256);

    /**
      * Returns the total non-cover shares ever burnt.
      */
    function getNonCoverSharesBurnt() external view returns (uint256);
}

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

pragma solidity ^0.8.0;

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

File 10 of 10 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"address","name":"_lido","type":"address"},{"internalType":"address","name":"_voting","type":"address"},{"internalType":"uint256","name":"_totalCoverSharesBurnt","type":"uint256"},{"internalType":"uint256","name":"_totalNonCoverSharesBurnt","type":"uint256"},{"internalType":"uint256","name":"_maxBurnAmountPerRunBasisPoints","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxBurnAmountPerRunBasisPoints","type":"uint256"}],"name":"BurnAmountPerRunQuotaChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"requestedBy","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"requestedBy","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"requestedBy","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesAmount","type":"uint256"}],"name":"ExcessStETHRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"isCover","type":"bool"},{"indexed":true,"internalType":"address","name":"requestedBy","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesAmount","type":"uint256"}],"name":"StETHBurnRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"isCover","type":"bool"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesAmount","type":"uint256"}],"name":"StETHBurnt","type":"event"},{"inputs":[],"name":"LIDO","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VOTING","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBurnAmountPerRunQuota","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCoverSharesBurnt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExcessStETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNonCoverSharesBurnt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"processLidoOracleReport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"recoverERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"recoverExcessStETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stETH2Burn","type":"uint256"}],"name":"requestBurnMyStETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stETH2Burn","type":"uint256"}],"name":"requestBurnMyStETHForCover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxBurnAmountPerRunBasisPoints","type":"uint256"}],"name":"setBurnAmountPerRunQuota","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e0604052600480553480156200001557600080fd5b5060405162001a8f38038062001a8f83398101604081905262000038916200022b565b6001600160a01b038616620000945760405162461bcd60e51b815260206004820152601560248201527f54524541535552595f5a45524f5f41444452455353000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b038516620000e05760405162461bcd60e51b81526020600482015260116024820152704c49444f5f5a45524f5f4144445245535360781b60448201526064016200008b565b6001600160a01b038416620001385760405162461bcd60e51b815260206004820152601360248201527f564f54494e475f5a45524f5f414444524553530000000000000000000000000060448201526064016200008b565b600081116200018a5760405162461bcd60e51b815260206004820152601860248201527f5a45524f5f4255524e5f414d4f554e545f5045525f52554e000000000000000060448201526064016200008b565b612710811115620001de5760405162461bcd60e51b815260206004820152601d60248201527f544f4f5f4c415247455f4255524e5f414d4f554e545f5045525f52554e00000060448201526064016200008b565b6001600160a01b0395861660a0529385166080529190931660c05260029290925560039190915560045562000291565b80516001600160a01b03811681146200022657600080fd5b919050565b60008060008060008060c087890312156200024557600080fd5b62000250876200020e565b955062000260602088016200020e565b945062000270604088016200020e565b9350606087015192506080870151915060a087015190509295509295509295565b60805160a05160c0516117506200033f6000396000818161018a01528181610dd201526110540152600081816101d6015281816104b501528181610b790152610d000152600081816102c0015281816103de015281816104e40152818161059401528181610705015281816107ee015281816108f2015281816109ce01528181610ab001528181610c3101528181610ea901528181610f3f015281816110df015261118501526117506000f3fe6080604052600436106100ec5760003560e01c8063819d4cc61161008a578063d12176b611610059578063d12176b6146102f7578063ed694dfe14610317578063ef5d201d1461032c578063fef6b16d1461034c57600080fd5b8063819d4cc61461026e5780638980f11f1461028e5780638b21f170146102ae578063d03601f0146102e257600080fd5b806332b976f3116100c657806332b976f3146101f857806334212e5f1461020f5780635d0162681461022f5780637763bca61461024f57600080fd5b806301ffc9a714610143578063269e1d1a146101785780632d2c5565146101c457600080fd5b3661013e5760405162461bcd60e51b815260206004820152601960248201527f494e434f4d494e475f4554485f49535f464f5242494444454e0000000000000060448201526064015b60405180910390fd5b600080fd5b34801561014f57600080fd5b5061016361015e36600461150d565b610361565b60405190151581526020015b60405180910390f35b34801561018457600080fd5b506101ac7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161016f565b3480156101d057600080fd5b506101ac7f000000000000000000000000000000000000000000000000000000000000000081565b34801561020457600080fd5b5061020d6103b3565b005b34801561021b57600080fd5b5061020d61022a366004611537565b61056e565b34801561023b57600080fd5b5061020d61024a366004611563565b610b11565b34801561025b57600080fd5b506003545b60405190815260200161016f565b34801561027a57600080fd5b5061020d610289366004611591565b610b1c565b34801561029a57600080fd5b5061020d6102a9366004611591565b610be8565b3480156102ba57600080fd5b506101ac7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102ee57600080fd5b50600254610260565b34801561030357600080fd5b5061020d610312366004611563565b610d25565b34801561032357600080fd5b50610260610e73565b34801561033857600080fd5b5061020d610347366004611563565b610fe3565b34801561035857600080fd5b50600454610260565b60006001600160e01b031982166334212e5f60e01b148061039257506001600160e01b031982166353aadeab60e11b145b806103ad57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006103bd610e73565b9050801561056b57604051631920845160e01b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063192084519060240160206040518083038186803b15801561042857600080fd5b505afa15801561043c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046091906115bd565b604080518481526020810183905291925033917fea28a36ccbf8c2eba827a529927f2e445c651d9a04a393ea79d71ea29c508483910160405180910390a260405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b15801561052857600080fd5b505af115801561053c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056091906115d6565b61056957600080fd5b505b50565b600080546001549091610581828461160e565b90508061059057505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663833b1fce6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105eb57600080fd5b505afa1580156105ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106239190611626565b9050336001600160a01b03821614806106bd5750806001600160a01b031663b24806036040518163ffffffff1660e01b815260040160206040518083038186803b15801561067057600080fd5b505afa158015610684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a89190611626565b6001600160a01b0316336001600160a01b0316145b6106fb5760405162461bcd60e51b815260206004820152600f60248201526e10541417d055551217d19052531151608a1b6044820152606401610135565b60006127106004547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d5002f2e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561075c57600080fd5b505afa158015610770573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079491906115bd565b61079e9190611643565b6107a89190611662565b905084156109875760006107bc8287610fee565b905080600260008282546107d0919061160e565b9091555050604051630f451f7160e31b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637a28fb889060240160206040518083038186803b15801561083857600080fd5b505afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087091906115bd565b60408051828152602081018590529192506001917f8959e4c88e5192ecbc28d08be97f24786bf591eb1d1848ce23e17e1b2271e863910160405180910390a2816000808282546108c09190611684565b9091555050818314806108d1575085155b1561098457604051633b9e9f0160e21b8152306004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ee7a7c04906044015b602060405180830381600087803b15801561093f57600080fd5b505af1158015610953573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097791906115bd565b5050505050505050505050565b50505b600061099c6109968784611684565b86610fee565b905080600360008282546109b0919061160e565b9091555050604051630f451f7160e31b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637a28fb889060240160206040518083038186803b158015610a1857600080fd5b505afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5091906115bd565b60408051828152602081018590529192506000917f8959e4c88e5192ecbc28d08be97f24786bf591eb1d1848ce23e17e1b2271e863910160405180910390a28160016000828254610aa19190611684565b90915550506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663ee7a7c0430610ae0858b61160e565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401610925565b61056b816000611006565b6040518181526001600160a01b0383169033907f6a30e6784464f0d1f4158aa4cb65ae9239b0fa87c7f2c083ee6dde44ba97b5e69060200160405180910390a36040516323b872dd60e01b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152604482018390528316906323b872dd90606401600060405180830381600087803b158015610bcc57600080fd5b505af1158015610be0573d6000803e3d6000fd5b505050505050565b60008111610c2f5760405162461bcd60e51b815260206004820152601460248201527316915493d7d49150d3d591549657d05353d5539560621b6044820152606401610135565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415610cb15760405162461bcd60e51b815260206004820152601860248201527f53544554485f5245434f5645525f57524f4e475f46554e4300000000000000006044820152606401610135565b6040518181526001600160a01b0383169033907faca8fb252cde442184e5f10e0f2e6e4029e8cd7717cae63559079610702436aa9060200160405180910390a36105696001600160a01b0383167f000000000000000000000000000000000000000000000000000000000000000083611288565b60008111610d755760405162461bcd60e51b815260206004820152601860248201527f5a45524f5f4255524e5f414d4f554e545f5045525f52554e00000000000000006044820152606401610135565b612710811115610dc75760405162461bcd60e51b815260206004820152601d60248201527f544f4f5f4c415247455f4255524e5f414d4f554e545f5045525f52554e0000006044820152606401610135565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e3b5760405162461bcd60e51b81526020600482015260196024820152784d53475f53454e4445525f4d5553545f42455f564f54494e4760381b6044820152606401610135565b6040518181527f0c2215eb7a22d75c1e3bac8cab81ef4f6af4311f14e2db2c255a07dc280e4d4a9060200160405180910390a1600455565b600080600154600054610e86919061160e565b604051633d7ad0b760e21b81523060048201529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f5eb42dc9060240160206040518083038186803b158015610eeb57600080fd5b505afa158015610eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2391906115bd565b9050818111610f355760009250505090565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016637a28fb88610f6e8484611684565b6040518263ffffffff1660e01b8152600401610f8c91815260200190565b60206040518083038186803b158015610fa457600080fd5b505afa158015610fb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdc91906115bd565b9250505090565b61056b816001611006565b6000818310610ffd5781610fff565b825b9392505050565b600082116110495760405162461bcd60e51b815260206004820152601060248201526f16915493d7d095549397d05353d5539560821b6044820152606401610135565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110bd5760405162461bcd60e51b81526020600482015260196024820152784d53475f53454e4445525f4d5553545f42455f564f54494e4760381b6044820152606401610135565b6040516323b872dd60e01b8152336004820152306024820152604481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd90606401602060405180830381600087803b15801561112b57600080fd5b505af115801561113f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116391906115d6565b61116c57600080fd5b604051631920845160e01b8152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063192084519060240160206040518083038186803b1580156111cf57600080fd5b505afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120791906115bd565b60408051858152602081018390529192503391841515917fd2282bfa24f3803076af0953f1ed987d0e45edacdc20d6dce52337b1c4588cdb910160405180910390a3811561126b5780600080828254611260919061160e565b909155506112839050565b806001600082825461127d919061160e565b90915550505b505050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65649084015261128392869291600091611318918516908490611395565b805190915015611283578080602001905181019061133691906115d6565b6112835760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610135565b60606113a484846000856113ac565b949350505050565b60608247101561140d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610135565b843b61145b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610135565b600080866001600160a01b0316858760405161147791906116cb565b60006040518083038185875af1925050503d80600081146114b4576040519150601f19603f3d011682016040523d82523d6000602084013e6114b9565b606091505b50915091506114c98282866114d4565b979650505050505050565b606083156114e3575081610fff565b8251156114f35782518084602001fd5b8160405162461bcd60e51b815260040161013591906116e7565b60006020828403121561151f57600080fd5b81356001600160e01b031981168114610fff57600080fd5b60008060006060848603121561154c57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561157557600080fd5b5035919050565b6001600160a01b038116811461056b57600080fd5b600080604083850312156115a457600080fd5b82356115af8161157c565b946020939093013593505050565b6000602082840312156115cf57600080fd5b5051919050565b6000602082840312156115e857600080fd5b81518015158114610fff57600080fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115611621576116216115f8565b500190565b60006020828403121561163857600080fd5b8151610fff8161157c565b600081600019048311821515161561165d5761165d6115f8565b500290565b60008261167f57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611696576116966115f8565b500390565b60005b838110156116b657818101518382015260200161169e565b838111156116c5576000848401525b50505050565b600082516116dd81846020870161169b565b9190910192915050565b602081526000825180602084015261170681604085016020870161169b565b601f01601f1916919091016040019291505056fea264697066735822122022716b134ee1ee3d7ce1167c1c620d5b434b7070021e5af7add98e8964f90acc64736f6c634300080900330000000000000000000000003e40d73eb977dc6a537af587d48316fee66e9c8c000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe840000000000000000000000002e59a20f205bb85a89c53f1936454680651e618e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001be1c69f1fd9c84300000000000000000000000000000000000000000000000000000000000000004

Deployed Bytecode

0x6080604052600436106100ec5760003560e01c8063819d4cc61161008a578063d12176b611610059578063d12176b6146102f7578063ed694dfe14610317578063ef5d201d1461032c578063fef6b16d1461034c57600080fd5b8063819d4cc61461026e5780638980f11f1461028e5780638b21f170146102ae578063d03601f0146102e257600080fd5b806332b976f3116100c657806332b976f3146101f857806334212e5f1461020f5780635d0162681461022f5780637763bca61461024f57600080fd5b806301ffc9a714610143578063269e1d1a146101785780632d2c5565146101c457600080fd5b3661013e5760405162461bcd60e51b815260206004820152601960248201527f494e434f4d494e475f4554485f49535f464f5242494444454e0000000000000060448201526064015b60405180910390fd5b600080fd5b34801561014f57600080fd5b5061016361015e36600461150d565b610361565b60405190151581526020015b60405180910390f35b34801561018457600080fd5b506101ac7f0000000000000000000000002e59a20f205bb85a89c53f1936454680651e618e81565b6040516001600160a01b03909116815260200161016f565b3480156101d057600080fd5b506101ac7f0000000000000000000000003e40d73eb977dc6a537af587d48316fee66e9c8c81565b34801561020457600080fd5b5061020d6103b3565b005b34801561021b57600080fd5b5061020d61022a366004611537565b61056e565b34801561023b57600080fd5b5061020d61024a366004611563565b610b11565b34801561025b57600080fd5b506003545b60405190815260200161016f565b34801561027a57600080fd5b5061020d610289366004611591565b610b1c565b34801561029a57600080fd5b5061020d6102a9366004611591565b610be8565b3480156102ba57600080fd5b506101ac7f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8481565b3480156102ee57600080fd5b50600254610260565b34801561030357600080fd5b5061020d610312366004611563565b610d25565b34801561032357600080fd5b50610260610e73565b34801561033857600080fd5b5061020d610347366004611563565b610fe3565b34801561035857600080fd5b50600454610260565b60006001600160e01b031982166334212e5f60e01b148061039257506001600160e01b031982166353aadeab60e11b145b806103ad57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006103bd610e73565b9050801561056b57604051631920845160e01b8152600481018290526000907f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b03169063192084519060240160206040518083038186803b15801561042857600080fd5b505afa15801561043c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046091906115bd565b604080518481526020810183905291925033917fea28a36ccbf8c2eba827a529927f2e445c651d9a04a393ea79d71ea29c508483910160405180910390a260405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000003e40d73eb977dc6a537af587d48316fee66e9c8c81166004830152602482018490527f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84169063a9059cbb90604401602060405180830381600087803b15801561052857600080fd5b505af115801561053c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056091906115d6565b61056957600080fd5b505b50565b600080546001549091610581828461160e565b90508061059057505050505050565b60007f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b031663833b1fce6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105eb57600080fd5b505afa1580156105ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106239190611626565b9050336001600160a01b03821614806106bd5750806001600160a01b031663b24806036040518163ffffffff1660e01b815260040160206040518083038186803b15801561067057600080fd5b505afa158015610684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a89190611626565b6001600160a01b0316336001600160a01b0316145b6106fb5760405162461bcd60e51b815260206004820152600f60248201526e10541417d055551217d19052531151608a1b6044820152606401610135565b60006127106004547f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b031663d5002f2e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561075c57600080fd5b505afa158015610770573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079491906115bd565b61079e9190611643565b6107a89190611662565b905084156109875760006107bc8287610fee565b905080600260008282546107d0919061160e565b9091555050604051630f451f7160e31b8152600481018290526000907f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b031690637a28fb889060240160206040518083038186803b15801561083857600080fd5b505afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087091906115bd565b60408051828152602081018590529192506001917f8959e4c88e5192ecbc28d08be97f24786bf591eb1d1848ce23e17e1b2271e863910160405180910390a2816000808282546108c09190611684565b9091555050818314806108d1575085155b1561098457604051633b9e9f0160e21b8152306004820152602481018390527f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b03169063ee7a7c04906044015b602060405180830381600087803b15801561093f57600080fd5b505af1158015610953573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097791906115bd565b5050505050505050505050565b50505b600061099c6109968784611684565b86610fee565b905080600360008282546109b0919061160e565b9091555050604051630f451f7160e31b8152600481018290526000907f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b031690637a28fb889060240160206040518083038186803b158015610a1857600080fd5b505afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5091906115bd565b60408051828152602081018590529192506000917f8959e4c88e5192ecbc28d08be97f24786bf591eb1d1848ce23e17e1b2271e863910160405180910390a28160016000828254610aa19190611684565b90915550506001600160a01b037f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe841663ee7a7c0430610ae0858b61160e565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401610925565b61056b816000611006565b6040518181526001600160a01b0383169033907f6a30e6784464f0d1f4158aa4cb65ae9239b0fa87c7f2c083ee6dde44ba97b5e69060200160405180910390a36040516323b872dd60e01b81523060048201526001600160a01b037f0000000000000000000000003e40d73eb977dc6a537af587d48316fee66e9c8c81166024830152604482018390528316906323b872dd90606401600060405180830381600087803b158015610bcc57600080fd5b505af1158015610be0573d6000803e3d6000fd5b505050505050565b60008111610c2f5760405162461bcd60e51b815260206004820152601460248201527316915493d7d49150d3d591549657d05353d5539560621b6044820152606401610135565b7f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b0316826001600160a01b03161415610cb15760405162461bcd60e51b815260206004820152601860248201527f53544554485f5245434f5645525f57524f4e475f46554e4300000000000000006044820152606401610135565b6040518181526001600160a01b0383169033907faca8fb252cde442184e5f10e0f2e6e4029e8cd7717cae63559079610702436aa9060200160405180910390a36105696001600160a01b0383167f0000000000000000000000003e40d73eb977dc6a537af587d48316fee66e9c8c83611288565b60008111610d755760405162461bcd60e51b815260206004820152601860248201527f5a45524f5f4255524e5f414d4f554e545f5045525f52554e00000000000000006044820152606401610135565b612710811115610dc75760405162461bcd60e51b815260206004820152601d60248201527f544f4f5f4c415247455f4255524e5f414d4f554e545f5045525f52554e0000006044820152606401610135565b336001600160a01b037f0000000000000000000000002e59a20f205bb85a89c53f1936454680651e618e1614610e3b5760405162461bcd60e51b81526020600482015260196024820152784d53475f53454e4445525f4d5553545f42455f564f54494e4760381b6044820152606401610135565b6040518181527f0c2215eb7a22d75c1e3bac8cab81ef4f6af4311f14e2db2c255a07dc280e4d4a9060200160405180910390a1600455565b600080600154600054610e86919061160e565b604051633d7ad0b760e21b81523060048201529091506000906001600160a01b037f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84169063f5eb42dc9060240160206040518083038186803b158015610eeb57600080fd5b505afa158015610eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2391906115bd565b9050818111610f355760009250505090565b6001600160a01b037f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8416637a28fb88610f6e8484611684565b6040518263ffffffff1660e01b8152600401610f8c91815260200190565b60206040518083038186803b158015610fa457600080fd5b505afa158015610fb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdc91906115bd565b9250505090565b61056b816001611006565b6000818310610ffd5781610fff565b825b9392505050565b600082116110495760405162461bcd60e51b815260206004820152601060248201526f16915493d7d095549397d05353d5539560821b6044820152606401610135565b336001600160a01b037f0000000000000000000000002e59a20f205bb85a89c53f1936454680651e618e16146110bd5760405162461bcd60e51b81526020600482015260196024820152784d53475f53454e4445525f4d5553545f42455f564f54494e4760381b6044820152606401610135565b6040516323b872dd60e01b8152336004820152306024820152604481018390527f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b0316906323b872dd90606401602060405180830381600087803b15801561112b57600080fd5b505af115801561113f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116391906115d6565b61116c57600080fd5b604051631920845160e01b8152600481018390526000907f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b03169063192084519060240160206040518083038186803b1580156111cf57600080fd5b505afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120791906115bd565b60408051858152602081018390529192503391841515917fd2282bfa24f3803076af0953f1ed987d0e45edacdc20d6dce52337b1c4588cdb910160405180910390a3811561126b5780600080828254611260919061160e565b909155506112839050565b806001600082825461127d919061160e565b90915550505b505050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65649084015261128392869291600091611318918516908490611395565b805190915015611283578080602001905181019061133691906115d6565b6112835760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610135565b60606113a484846000856113ac565b949350505050565b60608247101561140d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610135565b843b61145b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610135565b600080866001600160a01b0316858760405161147791906116cb565b60006040518083038185875af1925050503d80600081146114b4576040519150601f19603f3d011682016040523d82523d6000602084013e6114b9565b606091505b50915091506114c98282866114d4565b979650505050505050565b606083156114e3575081610fff565b8251156114f35782518084602001fd5b8160405162461bcd60e51b815260040161013591906116e7565b60006020828403121561151f57600080fd5b81356001600160e01b031981168114610fff57600080fd5b60008060006060848603121561154c57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561157557600080fd5b5035919050565b6001600160a01b038116811461056b57600080fd5b600080604083850312156115a457600080fd5b82356115af8161157c565b946020939093013593505050565b6000602082840312156115cf57600080fd5b5051919050565b6000602082840312156115e857600080fd5b81518015158114610fff57600080fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115611621576116216115f8565b500190565b60006020828403121561163857600080fd5b8151610fff8161157c565b600081600019048311821515161561165d5761165d6115f8565b500290565b60008261167f57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611696576116966115f8565b500390565b60005b838110156116b657818101518382015260200161169e565b838111156116c5576000848401525b50505050565b600082516116dd81846020870161169b565b9190910192915050565b602081526000825180602084015261170681604085016020870161169b565b601f01601f1916919091016040019291505056fea264697066735822122022716b134ee1ee3d7ce1167c1c620d5b434b7070021e5af7add98e8964f90acc64736f6c63430008090033

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

0000000000000000000000003e40d73eb977dc6a537af587d48316fee66e9c8c000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe840000000000000000000000002e59a20f205bb85a89c53f1936454680651e618e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001be1c69f1fd9c84300000000000000000000000000000000000000000000000000000000000000004

-----Decoded View---------------
Arg [0] : _treasury (address): 0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c
Arg [1] : _lido (address): 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
Arg [2] : _voting (address): 0x2e59A20f205bB85a89C53f1936454680651E618e
Arg [3] : _totalCoverSharesBurnt (uint256): 0
Arg [4] : _totalNonCoverSharesBurnt (uint256): 32145684728326685744
Arg [5] : _maxBurnAmountPerRunBasisPoints (uint256): 4

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000003e40d73eb977dc6a537af587d48316fee66e9c8c
Arg [1] : 000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84
Arg [2] : 0000000000000000000000002e59a20f205bb85a89c53f1936454680651e618e
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 000000000000000000000000000000000000000000000001be1c69f1fd9c8430
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000004


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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