ETH Price: $3,482.26 (-1.01%)
Gas: 2 Gwei

Contract

0x03b298D27b0426758cb70c4ADd6523927bD7cC8e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

TokenTracker

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Update Strategy ...167204132023-02-27 15:26:35511 days ago1677511595IN
0x03b298D2...27bD7cC8e
0 ETH0.0010740230.01993288
Update Strategy ...167204122023-02-27 15:26:23511 days ago1677511583IN
0x03b298D2...27bD7cC8e
0 ETH0.0010248930.96169719
Update Strategy ...166204942023-02-13 14:40:23525 days ago1676299223IN
0x03b298D2...27bD7cC8e
0 ETH0.0024265566.34108294
Update Strategy ...162826862022-12-28 10:34:59572 days ago1672223699IN
0x03b298D2...27bD7cC8e
0 ETH0.0005853614.13894011
Update Strategy ...162826732022-12-28 10:32:23572 days ago1672223543IN
0x03b298D2...27bD7cC8e
0 ETH0.0008142813.92209196
Update Strategy ...161764012022-12-13 14:34:23587 days ago1670942063IN
0x03b298D2...27bD7cC8e
0 ETH0.0010367928.34563693
Accept Governanc...155748572022-09-20 13:02:11671 days ago1663678931IN
0x03b298D2...27bD7cC8e
0 ETH0.0006343621.50688707
Set Guardian154706382022-09-04 8:39:24687 days ago1662280764IN
0x03b298D2...27bD7cC8e
0 ETH0.0005843519.36668383
Set Governance154706312022-09-04 8:38:07687 days ago1662280687IN
0x03b298D2...27bD7cC8e
0 ETH0.0006032920.93461061
Update Strategy ...152368752022-07-29 10:37:02724 days ago1659091022IN
0x03b298D2...27bD7cC8e
0 ETH0.000357458.63395923
Update Strategy ...152368532022-07-29 10:33:28724 days ago1659090808IN
0x03b298D2...27bD7cC8e
0 ETH0.0003847210.74625718
Update Strategy ...152368472022-07-29 10:32:22724 days ago1659090742IN
0x03b298D2...27bD7cC8e
0 ETH0.000426411.91053012
Update Strategy ...152368462022-07-29 10:31:53724 days ago1659090713IN
0x03b298D2...27bD7cC8e
0 ETH0.0003889910.86559707
Update Strategy ...152368422022-07-29 10:30:52724 days ago1659090652IN
0x03b298D2...27bD7cC8e
0 ETH0.0006365610.88121327
Update Strategy ...152356352022-07-29 5:57:23724 days ago1659074243IN
0x03b298D2...27bD7cC8e
0 ETH0.000410211.46552855
Update Strategy ...152356332022-07-29 5:56:33724 days ago1659074193IN
0x03b298D2...27bD7cC8e
0 ETH0.000365279.98634959
Update Strategy ...152258732022-07-27 17:32:06726 days ago1658943126IN
0x03b298D2...27bD7cC8e
0 ETH0.0012639830.53034182
Update Strategy ...152241712022-07-27 11:04:34726 days ago1658919874IN
0x03b298D2...27bD7cC8e
0 ETH0.000271136.54905296
Update Strategy ...152182242022-07-26 12:55:52727 days ago1658840152IN
0x03b298D2...27bD7cC8e
0 ETH0.0007186917.3593983
Update Strategy ...152176692022-07-26 10:48:53727 days ago1658832533IN
0x03b298D2...27bD7cC8e
0 ETH0.0006218815.02105897
Add Strategy To ...149978232022-06-20 17:41:44763 days ago1655746904IN
0x03b298D2...27bD7cC8e
0 ETH0.0038095336.87055462
Remove Strategy ...149978212022-06-20 17:40:53763 days ago1655746853IN
0x03b298D2...27bD7cC8e
0 ETH0.0025086232.65716147
Add Strategy149978192022-06-20 17:40:31763 days ago1655746831IN
0x03b298D2...27bD7cC8e
0 ETH0.0075913636.21384162
Update Strategy ...149978002022-06-20 17:36:37763 days ago1655746597IN
0x03b298D2...27bD7cC8e
0 ETH0.0021466451.84998407
Update Strategy ...149875922022-06-18 23:11:36765 days ago1655593896IN
0x03b298D2...27bD7cC8e
0 ETH0.0021072850.89947786
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x6a01bC74...3d99aac85
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Vyper_contract

Compiler Version
vyper:0.2.8

Optimization Enabled:
N/A

Other Settings:
GNU AGPLv3 license

Contract Source Code (Vyper language format)

# @version 0.2.8
"""
@title Vault
@license GNU AGPLv3
@author yearn.finance (original) & gro protocol (modified)
@notice
Modified version of Yearn Token Vault v.0.3.2
"""
API_VERSION: constant(String[28]) = "0.3.2"

from vyper.interfaces import ERC20

interface DetailedERC20:
    def name() -> String[42]: view
    def symbol() -> String[20]: view
    def decimals() -> uint256: view


interface Strategy:
    def want() -> address: view
    def vault() -> address: view
    def isActive() -> bool: view
    def estimatedTotalAssets() -> uint256: view
    def withdraw(_amount: uint256) -> uint256: nonpayable
    def migrate(_newStrategy: address): nonpayable


interface GuestList:
    def authorized(guest: address, amount: uint256) -> bool: view

event Transfer:
    sender: indexed(address)
    receiver: indexed(address)
    value: uint256


event Approval:
    owner: indexed(address)
    spender: indexed(address)
    value: uint256


name: public(String[64])
symbol: public(String[32])
decimals: public(uint256)

balanceOf: public(HashMap[address, uint256])
allowance: public(HashMap[address, HashMap[address, uint256]])

token: public(ERC20)
governance: public(address)
management: public(address)
guardian: public(address)
pendingGovernance: address
guestList: public(GuestList)
vaultAdapter: public(address)

struct StrategyParams:
    activation: uint256  # Activation block.timestamp
    debtRatio: uint256  # Maximum borrow amount (in BPS of total assets)
    minDebtPerHarvest: uint256  # Lower limit on the increase of debt since last harvest
    maxDebtPerHarvest: uint256  # Upper limit on the increase of debt since last harvest
    lastReport: uint256  # block.timestamp of the last time a report occured
    totalDebt: uint256  # Total outstanding debt that Strategy has
    totalGain: uint256  # Total returns that Strategy has realized for Vault
    totalLoss: uint256  # Total losses that Strategy has realized for Vault


event StrategyAdded:
    strategy: indexed(address)
    debtRatio: uint256  # Maximum borrow amount (in BPS of total assets)
    minDebtPerHarvest: uint256  # Lower limit on the increase of debt since last harvest
    maxDebtPerHarvest: uint256  # Upper limit on the increase of debt since last harvest


event StrategyReported:
    strategy: indexed(address)
    gain: uint256
    loss: uint256
    debtPaid: uint256
    totalGain: uint256
    totalLoss: uint256
    totalDebt: uint256
    debtAdded: uint256
    debtRatio: uint256


event UpdateGovernance:
    governance: address # New active governance


event UpdateManagement:
    management: address # New active manager

event UpdateVaultAdapter:
    adapter: address # New governing vault adapter

event UpdateGuestList:
    guestList: address # Vault guest list address


event UpdateDepositLimit:
    depositLimit: uint256 # New active deposit limit


event UpdateGuardian:
    guardian: address # Address of the active guardian


event EmergencyShutdown:
    active: bool # New emergency shutdown state (if false, normal operation enabled)


event UpdateWithdrawalQueue:
    queue: address[MAXIMUM_STRATEGIES] # New active withdrawal queue


event StrategyUpdateDebtRatio:
    strategy: indexed(address) # Address of the strategy for the debt ratio adjustment
    debtRatio: uint256 # The new debt limit for the strategy (in BPS of total assets)


event StrategyUpdateMinDebtPerHarvest:
    strategy: indexed(address) # Address of the strategy for the rate limit adjustment
    minDebtPerHarvest: uint256  # Lower limit on the increase of debt since last harvest


event StrategyUpdateMaxDebtPerHarvest:
    strategy: indexed(address) # Address of the strategy for the rate limit adjustment
    maxDebtPerHarvest: uint256  # Upper limit on the increase of debt since last harvest

event StrategyMigrated:
    oldVersion: indexed(address) # Old version of the strategy to be migrated
    newVersion: indexed(address) # New version of the strategy


event StrategyRevoked:
    strategy: indexed(address) # Address of the strategy that is revoked


event StrategyRemovedFromQueue:
    strategy: indexed(address) # Address of the strategy that is removed from the withdrawal queue


event StrategyAddedToQueue:
    strategy: indexed(address) # Address of the strategy that is added to the withdrawal queue



# NOTE: Track the total for overhead targeting purposes
strategies: public(HashMap[address, StrategyParams])
MAXIMUM_STRATEGIES: constant(uint256) = 20

# Ordering that `withdraw` uses to determine which strategies to pull funds from
# NOTE: Does *NOT* have to match the ordering of all the current strategies that
#       exist, but it is recommended that it does or else withdrawal depth is
#       limited to only those inside the queue.
# NOTE: Ordering is determined by governance, and should be balanced according
#       to risk, slippage, and/or volatility. Can also be ordered to increase the
#       withdrawal speed of a particular Strategy.
# NOTE: The first time a ZERO_ADDRESS is encountered, it stops withdrawing
withdrawalQueue: public(address[MAXIMUM_STRATEGIES])

emergencyShutdown: public(bool)

depositLimit: public(uint256)  # Limit for totalAssets the Vault can hold
debtRatio: public(uint256)  # Debt ratio for the Vault across all strategies (in BPS, <= 10k)
totalDebt: public(uint256)  # Amount of tokens that all strategies have borrowed
lastReport: public(uint256)  # block.timestamp of last report
activation: public(uint256)  # block.timestamp of contract deployment

MAX_BPS: constant(uint256) = 10_000  # 100%, or 10k basis points
SECS_PER_YEAR: constant(uint256) = 31_557_600  # 365.25 days
# `nonces` track `permit` approvals with signature.
nonces: public(HashMap[address, uint256])
DOMAIN_SEPARATOR: public(bytes32)
DOMAIN_TYPE_HASH: constant(bytes32) = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)')
PERMIT_TYPE_HASH: constant(bytes32) = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)")


@external
def initialize(
    token: address,
    governance: address,
    nameOverride: String[64],
    guardian: address = msg.sender,
):
    """
    @notice
        Initializes the Vault, this is called only once, when the contract is
        deployed.
        The performance fee is set to 10% of yield, per Strategy.
        The management fee is set to 2%, per year.
        The initial deposit limit is set to 0 (deposits disabled); it must be
        updated after initialization.
    @dev
        If `nameOverride` is not specified, the name will be 'yearn'
        combined with the name of `token`.
    @param token The token that may be deposited into this Vault.
    @param governance The address authorized for governance interactions.
    @param nameOverride Specify a custom Vault name. Leave empty for default choice.
    @param guardian The address authorized for guardian interactions. Defaults to caller.
    """
    assert self.activation == 0  # dev: no devops199
    self.token = ERC20(token)
    if nameOverride == "":
        self.name = concat(DetailedERC20(token).symbol(), " yVault")
    else:
        self.name = nameOverride
    self.decimals = DetailedERC20(token).decimals()
    self.governance = governance
    log UpdateGovernance(governance)
    self.management = governance
    log UpdateManagement(governance)
    self.guardian = guardian
    log UpdateGuardian(guardian)
    self.lastReport = block.timestamp
    self.activation = block.timestamp
    # EIP-712
    self.DOMAIN_SEPARATOR = keccak256(
        concat(
            DOMAIN_TYPE_HASH,
            keccak256(convert("Yearn Vault", Bytes[11])),
            keccak256(convert(API_VERSION, Bytes[28])),
            convert(chain.id, bytes32),
            convert(self, bytes32)
        )
    )


@pure
@external
def apiVersion() -> String[28]:
    """
    @notice
        Used to track the deployed version of this contract. In practice you
        can use this version number to compare with Yearn's GitHub and
        determine which version of the source matches this deployed contract.
    @dev
        All strategies must have an `apiVersion()` that matches the Vault's
        `API_VERSION`.
    @return API_VERSION which holds the current version of this contract.
    """
    return API_VERSION


@external
def setName(name: String[42]):
    """
    @notice
        Used to change the value of `name`.

        This may only be called by governance.
    @param name The new name to use.
    """
    assert msg.sender == self.governance
    self.name = name


# 2-phase commit for a change in governance
@external
def setGovernance(governance: address):
    """
    @notice
        Nominate a new address to use as governance.

        The change does not go into effect immediately. This function sets a
        pending change, and the governance address is not updated until
        the proposed governance address has accepted the responsibility.

        This may only be called by the current governance address.
    @param governance The address requested to take over Vault governance.
    """
    assert msg.sender == self.governance
    self.pendingGovernance = governance

@external
def acceptGovernance():
    """
    @notice
        Once a new governance address has been proposed using setGovernance(),
        this function may be called by the proposed address to accept the
        responsibility of taking over governance for this contract.

        This may only be called by the proposed governance address.
    @dev
        setGovernance() should be called by the existing governance address,
        prior to calling this function.
    """
    assert msg.sender == self.pendingGovernance
    self.governance = msg.sender
    log UpdateGovernance(msg.sender)

@external
def setManagement(management: address):
    """
    @notice
        Changes the management address.
        Management is able to make some investment decisions adjusting parameters.

        This may only be called by governance.
    @param management The address to use for managing.
    """
    assert msg.sender == self.governance
    self.management = management
    log UpdateManagement(management)

@external
def setVaultAdapter(adapter: address):
    """
    @notice
        Sets the vault adapter, which is the only entity that 
        can deposit into the vault.

        This may only be called by governance.
    @param adapter The address of the vault adapter.
    """
    assert msg.sender == self.governance
    self.vaultAdapter = adapter
    log UpdateVaultAdapter(adapter)

@external
def setGuestList(guestList: address):
    """
    @notice
        Used to set or change `guestList`. A guest list is another contract
        that dictates who is allowed to participate in a Vault (and transfer
        shares).

        This may only be called by governance.
    @param guestList The address of the `GuestList` contract to use.
    """
    assert msg.sender == self.governance
    self.guestList = GuestList(guestList)
    log UpdateGuestList(guestList)

@external
def setDepositLimit(limit: uint256):
    """
    @notice
        Changes the maximum amount of tokens that can be deposited in this Vault.

        Note, this is not how much may be deposited by a single depositor,
        but the maximum amount that may be deposited across all depositors.

        This may only be called by governance.
    @param limit The new deposit limit to use.
    """
    assert msg.sender == self.governance
    self.depositLimit = limit
    log UpdateDepositLimit(limit)

@external
def setGuardian(guardian: address):
    """
    @notice
        Used to change the address of `guardian`.

        This may only be called by governance or the existing guardian.
    @param guardian The new guardian address to use.
    """
    assert msg.sender in [self.guardian, self.governance]
    self.guardian = guardian
    log UpdateGuardian(guardian)


@external
def setEmergencyShutdown(active: bool):
    """
    @notice
        Activates or deactivates Vault mode where all Strategies go into full
        withdrawal.

        During Emergency Shutdown:
        1. No Users may deposit into the Vault (but may withdraw as usual.)
        2. Governance may not add new Strategies.
        3. Each Strategy must pay back their debt as quickly as reasonable to
            minimally affect their position.
        4. Only Governance may undo Emergency Shutdown.

        See contract level note for further details.

        This may only be called by governance or the guardian.
    @param active
        If true, the Vault goes into Emergency Shutdown. If false, the Vault
        goes back into Normal Operation.
    """
    if active:
        assert msg.sender in [self.guardian, self.governance]
    else:
        assert msg.sender == self.governance
    self.emergencyShutdown = active
    log EmergencyShutdown(active)


@external
def setWithdrawalQueue(queue: address[MAXIMUM_STRATEGIES]):
    """
    @notice
        Updates the withdrawalQueue to match the addresses and order specified
        by `queue`.

        There can be fewer strategies than the maximum, as well as fewer than
        the total number of strategies active in the vault. `withdrawalQueue`
        will be updated in a gas-efficient manner, assuming the input is well-
        ordered with 0x0 only at the end.

        This may only be called by governance or management.
    @dev
        This is order sensitive, specify the addresses in the order in which
        funds should be withdrawn (so `queue`[0] is the first Strategy withdrawn
        from, `queue`[1] is the second, etc.)

        This means that the least impactful Strategy (the Strategy that will have
        its core positions impacted the least by having funds removed) should be
        at `queue`[0], then the next least impactful at `queue`[1], and so on.
    @param queue
        The array of addresses to use as the new withdrawal queue. This is
        order sensitive.
    """
    assert msg.sender in [self.management, self.governance]
    # HACK: Temporary until Vyper adds support for Dynamic arrays
    for i in range(MAXIMUM_STRATEGIES):
        if queue[i] == ZERO_ADDRESS and self.withdrawalQueue[i] == ZERO_ADDRESS:
            break
        assert self.strategies[queue[i]].activation > 0
        self.withdrawalQueue[i] = queue[i]
    log UpdateWithdrawalQueue(queue)


@internal
def erc20_safe_transfer(token: address, receiver: address, amount: uint256):
    # Used only to send tokens that are not the type managed by this Vault.
    # HACK: Used to handle non-compliant tokens like USDT
    response: Bytes[32] = raw_call(
        token,
        concat(
            method_id("transfer(address,uint256)"),
            convert(receiver, bytes32),
            convert(amount, bytes32),
        ),
        max_outsize=32,
    )
    if len(response) > 0:
        assert convert(response, bool), "Transfer failed!"


@internal
def erc20_safe_transferFrom(token: address, sender: address, receiver: address, amount: uint256):
    # Used only to send tokens that are not the type managed by this Vault.
    # HACK: Used to handle non-compliant tokens like USDT
    response: Bytes[32] = raw_call(
        token,
        concat(
            method_id("transferFrom(address,address,uint256)"),
            convert(sender, bytes32),
            convert(receiver, bytes32),
            convert(amount, bytes32),
        ),
        max_outsize=32,
    )
    if len(response) > 0:
        assert convert(response, bool), "Transfer failed!"

@view
@internal
def _totalAssets() -> uint256:
    # See note on `totalAssets()`.
    return self.token.balanceOf(self) + self.totalDebt


@view
@external
def totalAssets() -> uint256:
    """
    @notice
        Returns the total quantity of all assets under control of this
        Vault, whether they're loaned out to a Strategy, or currently held in
        the Vault.
    @return The total assets under control of this Vault.
    """
    return self._totalAssets()

@external
@nonreentrant("withdraw")
def deposit(_amount: uint256 = MAX_UINT256):
    """
    @notice
        Deposits `_amount` `token`, issuing shares to `recipient`. If the
        Vault is in Emergency Shutdown, deposits will not be accepted and this
        call will fail.
    @dev
        Measuring quantity of shares to issues is based on the total
        outstanding debt that this contract has ("expected value") instead
        of the total balance sheet it has ("estimated value") has important
        security considerations, and is done intentionally. If this value were
        measured against external systems, it could be purposely manipulated by
        an attacker to withdraw more assets than they otherwise should be able
        to claim by redeeming their shares.

        On deposit, this means that shares are issued against the total amount
        that the deposited capital can be given in service of the debt that
        Strategies assume. If that number were to be lower than the "expected
        value" at some future point, depositing shares via this method could
        entitle the depositor to *less* than the deposited value once the
        "realized value" is updated from further reports by the Strategies
        to the Vaults.

        Care should be taken by integrators to account for this discrepancy,
        by using the view-only methods of this contract (both off-chain and
        on-chain) to determine if depositing into the Vault is a "good idea".
    @param _amount The quantity of tokens to deposit, defaults to all.
    """
    assert not self.emergencyShutdown  # Deposits are locked out
    assert msg.sender == self.vaultAdapter, 'Only vault adapter can deposit' 

    amount: uint256 = _amount

    # If _amount not specified, transfer the full token balance,
    # up to deposit limit
    if amount == MAX_UINT256:
        amount = min(
            self.depositLimit - self._totalAssets(),
            self.token.balanceOf(msg.sender),
        )
    else:
        # Ensure deposit limit is respected
        assert self._totalAssets() + amount <= self.depositLimit

    # Ensure we are depositing something
    assert amount > 0

    # Ensure deposit is permitted by guest list
    if self.guestList.address != ZERO_ADDRESS:
        assert self.guestList.authorized(msg.sender, amount)

    # Tokens are transferred from msg.sender (may be different from _recipient)
    self.erc20_safe_transferFrom(self.token.address, msg.sender, self, amount)

@external
@nonreentrant("withdraw")
def withdraw(
    amount: uint256 = MAX_UINT256,
    recipient: address = msg.sender,
    maxLoss: uint256 = 1,  # 0.01% [BPS]
) -> (uint256, uint256, uint256, uint256):

    
    assert msg.sender == self.vaultAdapter, 'Only vault adapter can deposit' 
    # If _shares not specified, transfer full share balance
    value: uint256 = amount
    if amount == MAX_UINT256:
        value = self._totalAssets()

    totalLoss: uint256 = 0
    if value > self.token.balanceOf(self):
        # We need to go get some from our strategies in the withdrawal queue
        # NOTE: This performs forced withdrawals from each Strategy. During
        #       forced withdrawal, a Strategy may realize a loss. That loss
        #       is reported back to the Vault, and the will affect the amount
        #       of tokens that the withdrawer receives for their shares. They
        #       can optionally specify the maximum acceptable loss (in BPS)
        #       to prevent excessive losses on their withdrawals (which may
        #       happen in certain edge cases where Strategies realize a loss)
        for strategy in self.withdrawalQueue:
            if strategy == ZERO_ADDRESS:
                break  # We've exhausted the queue

            vault_balance: uint256 = self.token.balanceOf(self)
            if value <= vault_balance:
                break  # We're done withdrawing

            amountNeeded: uint256 = value - vault_balance

            # NOTE: Don't withdraw more than the debt so that Strategy can still
            #       continue to work based on the profits it has
            # NOTE: This means that user will lose out on any profits that each
            #       Strategy in the queue would return on next harvest, benefiting others
            amountNeeded = min(amountNeeded, self.strategies[strategy].totalDebt)
            if amountNeeded == 0:
                continue  # Nothing to withdraw from this Strategy, try the next one

            # Force withdraw amount from each Strategy in the order set by governance
            loss: uint256 = Strategy(strategy).withdraw(amountNeeded)
            withdrawn: uint256 = self.token.balanceOf(self) - vault_balance

            # NOTE: Withdrawer incurs any losses from liquidation
            if loss > 0:
                value -= loss
                totalLoss += loss
                self.strategies[strategy].totalLoss += loss

            # Reduce the Strategy's debt by the amount withdrawn ("realized returns")
            # NOTE: This doesn't add to returns as it's not earned by "normal means"
            self.strategies[strategy].totalDebt -= withdrawn + loss
            self.totalDebt -= withdrawn + loss

    # NOTE: We have withdrawn everything possible out of the withdrawal queue
    #       but we still don't have enough to fully pay them back, so adjust
    #       to the total amount we've freed up through forced withdrawals
    vault_balance: uint256 = self.token.balanceOf(self)
    if value > vault_balance:
        value = vault_balance

    # NOTE: This loss protection is put in place to revert if losses from
    #       withdrawing are more than what is considered acceptable.
    assert totalLoss <= maxLoss * (value + totalLoss) / MAX_BPS

    # Withdraw remaining balance to _recipient (may be different to msg.sender) (minus fee)
    self.erc20_safe_transfer(self.token.address, recipient, value)

    # return value
    return totalLoss, maxLoss, value, MAX_BPS

@external
@nonreentrant("withdraw")
def withdrawByStrategy(
    _strategies: address[MAXIMUM_STRATEGIES],
    amount: uint256 = MAX_UINT256,
    recipient: address = msg.sender,
    maxLoss: uint256 = 1,  # 0.01% [BPS]
) -> uint256:
    """
    @notice
        Withdraws the calling account's tokens from this Vault, redeeming
        amount `_shares` for an appropriate amount of tokens.

        See note on `setWithdrawalQueue` for further details of withdrawal
        ordering and behavior.
    @dev
        Measuring the value of shares is based on the total outstanding debt
        that this contract has ("expected value") instead of the total balance
        sheet it has ("estimated value") has important security considerations,
        and is done intentionally. If this value were measured against external
        systems, it could be purposely manipulated by an attacker to withdraw
        more assets than they otherwise should be able to claim by redeeming
        their shares.

        On withdrawal, this means that shares are redeemed against the total
        amount that the deposited capital had "realized" since the point it
        was deposited, up until the point it was withdrawn. If that number
        were to be higher than the "expected value" at some future point,
        withdrawing shares via this method could entitle the depositor to
        *more* than the expected value once the "realized value" is updated
        from further reports by the Strategies to the Vaults.

        Under exceptional scenarios, this could cause earlier withdrawals to
        earn "more" of the underlying assets than Users might otherwise be
        entitled to, if the Vault's estimated value were otherwise measured
        through external means, accounting for whatever exceptional scenarios
        exist for the Vault (that aren't covered by the Vault's own design.)
    @param amount
        How many shares to try and redeem for tokens, defaults to all.
    @param recipient
        The address to issue the shares in this Vault to. Defaults to the
        caller's address.
    @param maxLoss
        The maximum acceptable loss to sustain on withdrawal. Defaults to 0.01%.
    @return The quantity of tokens redeemed for `_shares`.
    """
    assert msg.sender == self.vaultAdapter, 'Only vault adapter can withdraw' 
    # If _shares not specified, transfer full share balance
    value: uint256 = amount
    if amount == MAX_UINT256:
        value = self._totalAssets()

    totalLoss: uint256 = 0
    if value > self.token.balanceOf(self):
        # We need to go get some from our strategies in the withdrawal queue
        # NOTE: This performs forced withdrawals from each Strategy. During
        #       forced withdrawal, a Strategy may realize a loss. That loss
        #       is reported back to the Vault, and the will affect the amount
        #       of tokens that the withdrawer receives for their shares. They
        #       can optionally specify the maximum acceptable loss (in BPS)
        #       to prevent excessive losses on their withdrawals (which may
        #       happen in certain edge cases where Strategies realize a loss)
        for strategy in _strategies:
            if strategy == ZERO_ADDRESS:
                break  # We've exhausted the queue

            vault_balance: uint256 = self.token.balanceOf(self)
            if value <= vault_balance:
                break  # We're done withdrawing

            amountNeeded: uint256 = value - vault_balance

            # NOTE: Don't withdraw more than the debt so that Strategy can still
            #       continue to work based on the profits it has
            # NOTE: This means that user will lose out on any profits that each
            #       Strategy in the queue would return on next harvest, benefiting others
            amountNeeded = min(amountNeeded, self.strategies[strategy].totalDebt)
            if amountNeeded == 0:
                continue  # Nothing to withdraw from this Strategy, try the next one

            # Force withdraw amount from each Strategy in the order set by governance
            loss: uint256 = Strategy(strategy).withdraw(amountNeeded)
            withdrawn: uint256 = self.token.balanceOf(self) - vault_balance

            # NOTE: Withdrawer incurs any losses from liquidation
            if loss > 0:
                value -= loss
                totalLoss += loss
                self.strategies[strategy].totalLoss += loss

            # Reduce the Strategy's debt by the amount withdrawn ("realized returns")
            # NOTE: This doesn't add to returns as it's not earned by "normal means"
            self.strategies[strategy].totalDebt -= withdrawn + loss
            self.totalDebt -= withdrawn + loss

    # NOTE: We have withdrawn everything possible out of the withdrawal queue
    #       but we still don't have enough to fully pay them back, so adjust
    #       to the total amount we've freed up through forced withdrawals
    vault_balance: uint256 = self.token.balanceOf(self)
    if value > vault_balance:
        value = vault_balance

    # NOTE: This loss protection is put in place to revert if losses from
    #       withdrawing are more than what is considered acceptable.
    assert totalLoss <= maxLoss * (value + totalLoss) / MAX_BPS

    # Withdraw remaining balance to _recipient (may be different to msg.sender) (minus fee)
    self.erc20_safe_transfer(self.token.address, recipient, value)

    return value

@internal
def _organizeWithdrawalQueue():
    # Reorganize `withdrawalQueue` based on premise that if there is an
    # empty value between two actual values, then the empty value should be
    # replaced by the later value.
    # NOTE: Relative ordering of non-zero values is maintained.
    offset: uint256 = 0
    for idx in range(MAXIMUM_STRATEGIES):
        strategy: address = self.withdrawalQueue[idx]
        if strategy == ZERO_ADDRESS:
            offset += 1  # how many values we need to shift, always `<= idx`
        elif offset > 0:
            self.withdrawalQueue[idx - offset] = strategy
            self.withdrawalQueue[idx] = ZERO_ADDRESS


@external
def addStrategy(
    strategy: address,
    debtRatio: uint256,
    minDebtPerHarvest: uint256,
    maxDebtPerHarvest: uint256
):
    """
    @notice
        Add a Strategy to the Vault.

        This may only be called by governance.
    @dev
        The Strategy will be appended to `withdrawalQueue`, call
        `setWithdrawalQueue` to change the order.
    @param strategy The address of the Strategy to add.
    @param debtRatio
        The share of the total assets in the `vault that the `strategy` has access to.
    @param minDebtPerHarvest
        Lower limit on the increase of debt since last harvest
    @param maxDebtPerHarvest
        Upper limit on the increase of debt since last harvest
    """
    # Check if queue is full
    assert self.withdrawalQueue[MAXIMUM_STRATEGIES - 1] == ZERO_ADDRESS

    # Check calling conditions
    assert not self.emergencyShutdown
    assert msg.sender == self.governance

    # Check strategy configuration
    assert strategy != ZERO_ADDRESS
    assert self.strategies[strategy].activation == 0
    assert self == Strategy(strategy).vault()
    assert self.token.address == Strategy(strategy).want()

    # Check strategy parameters
    assert self.debtRatio + debtRatio <= MAX_BPS
    assert minDebtPerHarvest <= maxDebtPerHarvest

    # Add strategy to approved strategies
    self.strategies[strategy] = StrategyParams({
        activation: block.timestamp,
        debtRatio: debtRatio,
        minDebtPerHarvest: minDebtPerHarvest,
        maxDebtPerHarvest: maxDebtPerHarvest,
        lastReport: block.timestamp,
        totalDebt: 0,
        totalGain: 0,
        totalLoss: 0,
    })
    log StrategyAdded(strategy, debtRatio, minDebtPerHarvest, maxDebtPerHarvest)

    # Update Vault parameters
    self.debtRatio += debtRatio

    # Add strategy to the end of the withdrawal queue
    self.withdrawalQueue[MAXIMUM_STRATEGIES - 1] = strategy
    self._organizeWithdrawalQueue()


@external
def updateStrategyDebtRatio(
    strategy: address,
    debtRatio: uint256,
):
    """
    @notice
        Change the quantity of assets `strategy` may manage.

        This may be called by governance or management.
    @param strategy The Strategy to update.
    @param debtRatio The quantity of assets `strategy` may now manage.
    """
    assert msg.sender in [self.management, self.governance]
    assert self.strategies[strategy].activation > 0
    self.debtRatio -= self.strategies[strategy].debtRatio
    self.strategies[strategy].debtRatio = debtRatio
    self.debtRatio += debtRatio
    assert self.debtRatio <= MAX_BPS
    log StrategyUpdateDebtRatio(strategy, debtRatio)


@external
def updateStrategyMinDebtPerHarvest(
    strategy: address,
    minDebtPerHarvest: uint256,
):
    """
    @notice
        Change the quantity assets per block this Vault may deposit to or
        withdraw from `strategy`.

        This may only be called by governance or management.
    @param strategy The Strategy to update.
    @param minDebtPerHarvest
        Lower limit on the increase of debt since last harvest
    """
    assert msg.sender in [self.management, self.governance]
    assert self.strategies[strategy].activation > 0
    assert self.strategies[strategy].maxDebtPerHarvest >= minDebtPerHarvest
    self.strategies[strategy].minDebtPerHarvest = minDebtPerHarvest
    log StrategyUpdateMinDebtPerHarvest(strategy, minDebtPerHarvest)


@external
def updateStrategyMaxDebtPerHarvest(
    strategy: address,
    maxDebtPerHarvest: uint256,
):
    """
    @notice
        Change the quantity assets per block this Vault may deposit to or
        withdraw from `strategy`.

        This may only be called by governance or management.
    @param strategy The Strategy to update.
    @param maxDebtPerHarvest
        Upper limit on the increase of debt since last harvest
    """
    assert msg.sender in [self.management, self.governance]
    assert self.strategies[strategy].activation > 0
    assert self.strategies[strategy].minDebtPerHarvest <= maxDebtPerHarvest
    self.strategies[strategy].maxDebtPerHarvest = maxDebtPerHarvest
    log StrategyUpdateMaxDebtPerHarvest(strategy, maxDebtPerHarvest)

@internal
def _revokeStrategy(strategy: address):
    self.debtRatio -= self.strategies[strategy].debtRatio
    self.strategies[strategy].debtRatio = 0
    log StrategyRevoked(strategy)


@external
def migrateStrategy(oldVersion: address, newVersion: address):
    """
    @notice
        Migrates a Strategy, including all assets from `oldVersion` to
        `newVersion`.

        This may only be called by governance.
    @dev
        Strategy must successfully migrate all capital and positions to new
        Strategy, or else this will upset the balance of the Vault.

        The new Strategy should be "empty" e.g. have no prior commitments to
        this Vault, otherwise it could have issues.
    @param oldVersion The existing Strategy to migrate from.
    @param newVersion The new Strategy to migrate to.
    """
    assert msg.sender == self.governance
    assert newVersion != ZERO_ADDRESS
    assert self.strategies[oldVersion].activation > 0
    assert self.strategies[newVersion].activation == 0

    strategy: StrategyParams = self.strategies[oldVersion]

    self._revokeStrategy(oldVersion)
    # _revokeStrategy will lower the debtRatio
    self.debtRatio += strategy.debtRatio
    # Debt is migrated to new strategy
    self.strategies[oldVersion].totalDebt = 0

    self.strategies[newVersion] = StrategyParams({
        # NOTE: use last report for activation time, so E[R] calc works
        activation: strategy.lastReport,
        debtRatio: strategy.debtRatio,
        minDebtPerHarvest: strategy.minDebtPerHarvest,
        maxDebtPerHarvest: strategy.maxDebtPerHarvest,
        lastReport: strategy.lastReport,
        totalDebt: strategy.totalDebt,
        totalGain: 0,
        totalLoss: 0,
    })

    Strategy(oldVersion).migrate(newVersion)
    log StrategyMigrated(oldVersion, newVersion)

    for idx in range(MAXIMUM_STRATEGIES):
        if self.withdrawalQueue[idx] == oldVersion:
            self.withdrawalQueue[idx] = newVersion
            return  # Don't need to reorder anything because we swapped


@external
def revokeStrategy(strategy: address = msg.sender):
    """
    @notice
        Revoke a Strategy, setting its debt limit to 0 and preventing any
        future deposits.

        This function should only be used in the scenario where the Strategy is
        being retired but no migration of the positions are possible, or in the
        extreme scenario that the Strategy needs to be put into "Emergency Exit"
        mode in order for it to exit as quickly as possible. The latter scenario
        could be for any reason that is considered "critical" that the Strategy
        exits its position as fast as possible, such as a sudden change in market
        conditions leading to losses, or an imminent failure in an external
        dependency.

        This may only be called by governance, the guardian, or the Strategy
        itself. Note that a Strategy will only revoke itself during emergency
        shutdown.
    @param strategy The Strategy to revoke.
    """
    assert msg.sender in [strategy, self.governance, self.guardian]
    self._revokeStrategy(strategy)


@external
def addStrategyToQueue(strategy: address):
    """
    @notice
        Adds `strategy` to `withdrawalQueue`.

        This may only be called by governance or management.
    @dev
        The Strategy will be appended to `withdrawalQueue`, call
        `setWithdrawalQueue` to change the order.
    @param strategy The Strategy to add.
    """
    assert msg.sender in [self.management, self.governance]
    # Must be a current Strategy
    assert self.strategies[strategy].activation > 0
    # Check if queue is full
    assert self.withdrawalQueue[MAXIMUM_STRATEGIES - 1] == ZERO_ADDRESS
    # Can't already be in the queue
    for s in self.withdrawalQueue:
        if strategy == ZERO_ADDRESS:
            break
        assert s != strategy
    self.withdrawalQueue[MAXIMUM_STRATEGIES - 1] = strategy
    self._organizeWithdrawalQueue()
    log StrategyAddedToQueue(strategy)


@external
def removeStrategyFromQueue(strategy: address):
    """
    @notice
        Remove `strategy` from `withdrawalQueue`.

        This may only be called by governance or management.
    @dev
        We don't do this with revokeStrategy because it should still
        be possible to withdraw from the Strategy if it's unwinding.
    @param strategy The Strategy to remove.
    """
    assert msg.sender in [self.management, self.governance]
    for idx in range(MAXIMUM_STRATEGIES):
        if self.withdrawalQueue[idx] == strategy:
            self.withdrawalQueue[idx] = ZERO_ADDRESS
            self._organizeWithdrawalQueue()
            log StrategyRemovedFromQueue(strategy)
            return  # We found the right location and cleared it
    raise  # We didn't find the Strategy in the queue


@view
@internal
def _debtOutstanding(strategy: address) -> uint256:
    # See note on `debtOutstanding()`.
    strategy_debtLimit: uint256 = self.strategies[strategy].debtRatio * self._totalAssets() / MAX_BPS
    strategy_totalDebt: uint256 = self.strategies[strategy].totalDebt

    if self.emergencyShutdown:
        return strategy_totalDebt
    elif strategy_totalDebt <= strategy_debtLimit:
        return 0
    else:
        return strategy_totalDebt - strategy_debtLimit


@view
@external
def debtOutstanding(strategy: address = msg.sender) -> uint256:
    """
    @notice
        Determines if `strategy` is past its debt limit and if any tokens
        should be withdrawn to the Vault.
    @param strategy The Strategy to check. Defaults to the caller.
    @return The quantity of tokens to withdraw.
    """
    return self._debtOutstanding(strategy)


@view
@internal
def _creditAvailable(strategy: address) -> uint256:
    # See note on `creditAvailable()`.
    if self.emergencyShutdown:
        return 0

    vault_totalAssets: uint256 = self._totalAssets()
    vault_debtLimit: uint256 = self.debtRatio * vault_totalAssets / MAX_BPS
    vault_totalDebt: uint256 = self.totalDebt
    strategy_debtLimit: uint256 = self.strategies[strategy].debtRatio * vault_totalAssets / MAX_BPS
    strategy_totalDebt: uint256 = self.strategies[strategy].totalDebt
    strategy_minDebtPerHarvest: uint256 = self.strategies[strategy].minDebtPerHarvest
    strategy_maxDebtPerHarvest: uint256 = self.strategies[strategy].maxDebtPerHarvest

    # Exhausted credit line
    if strategy_debtLimit <= strategy_totalDebt or vault_debtLimit <= vault_totalDebt:
        return 0

    # Start with debt limit left for the Strategy
    available: uint256 = strategy_debtLimit - strategy_totalDebt

    # Adjust by the global debt limit left
    available = min(available, vault_debtLimit - vault_totalDebt)

    # Can only borrow up to what the contract has in reserve
    # NOTE: Running near 100% is discouraged
    available = min(available, self.token.balanceOf(self))

    # Adjust by min and max borrow limits (per harvest)
    # NOTE: min increase can be used to ensure that if a strategy has a minimum
    #       amount of capital needed to purchase a position, it's not given capital
    #       it can't make use of yet.
    # NOTE: max increase is used to make sure each harvest isn't bigger than what
    #       is authorized. This combined with adjusting min and max periods in
    #       `BaseStrategy` can be used to effect a "rate limit" on capital increase.
    if available < strategy_minDebtPerHarvest:
        return 0
    else:
        return min(available, strategy_maxDebtPerHarvest)

@view
@external
def creditAvailable(strategy: address = msg.sender) -> uint256:
    """
    @notice
        Amount of tokens in Vault a Strategy has access to as a credit line.

        This will check the Strategy's debt limit, as well as the tokens
        available in the Vault, and determine the maximum amount of tokens
        (if any) the Strategy may draw on.

        In the rare case the Vault is in emergency shutdown this will return 0.
    @param strategy The Strategy to check. Defaults to caller.
    @return The quantity of tokens available for the Strategy to draw on.
    """
    return self._creditAvailable(strategy)


@view
@internal
def _expectedReturn(strategy: address) -> uint256:
    # See note on `expectedReturn()`.
    strategy_lastReport: uint256 = self.strategies[strategy].lastReport
    timeSinceLastHarvest: uint256 = block.timestamp - strategy_lastReport
    totalHarvestTime: uint256 = strategy_lastReport - self.strategies[strategy].activation

    # NOTE: If either `timeSinceLastHarvest` or `totalHarvestTime` is 0, we can short-circuit to `0`
    if timeSinceLastHarvest > 0 and totalHarvestTime > 0 and Strategy(strategy).isActive():
        # NOTE: Unlikely to throw unless strategy accumalates >1e68 returns
        # NOTE: Calculate average over period of time where harvests have occured in the past
        return (self.strategies[strategy].totalGain * timeSinceLastHarvest) / totalHarvestTime
    else:
        return 0  # Covers the scenario when block.timestamp == activation


@view
@external
def availableDepositLimit() -> uint256:
    if self.depositLimit > self._totalAssets():
        return self.depositLimit - self._totalAssets()
    else:
        return 0


@view
@external
def expectedReturn(strategy: address = msg.sender) -> uint256:
    """
    @notice
        Provide an accurate expected value for the return this `strategy`
        would provide to the Vault the next time `report()` is called
        (since the last time it was called).
    @param strategy The Strategy to determine the expected return for. Defaults to caller.
    @return
        The anticipated amount `strategy` should make on its investment
        since its last report.
    """
    return self._expectedReturn(strategy)


@internal
def _reportLoss(strategy: address, loss: uint256):
    # Loss can only be up the amount of debt issued to strategy
    totalDebt: uint256 = self.strategies[strategy].totalDebt
    assert totalDebt >= loss
    self.strategies[strategy].totalLoss += loss
    self.strategies[strategy].totalDebt = totalDebt - loss
    self.totalDebt -= loss

@external
def report(gain: uint256, loss: uint256, _debtPayment: uint256) -> uint256:
    """
    @notice
        Reports the amount of assets the calling Strategy has free (usually in
        terms of ROI).

        The performance fee is determined here, off of the strategy's profits
        (if any), and sent to governance.

        The strategist's fee is also determined here (off of profits), to be
        handled according to the strategist on the next harvest.

        This may only be called by a Strategy managed by this Vault.
    @dev
        For approved strategies, this is the most efficient behavior.
        The Strategy reports back what it has free, then Vault "decides"
        whether to take some back or give it more. Note that the most it can
        take is `gain + _debtPayment`, and the most it can give is all of the
        remaining reserves. Anything outside of those bounds is abnormal behavior.

        All approved strategies must have increased diligence around
        calling this function, as abnormal behavior could become catastrophic.
    @param gain
        Amount Strategy has realized as a gain on it's investment since its
        last report, and is free to be given back to Vault as earnings
    @param loss
        Amount Strategy has realized as a loss on it's investment since its
        last report, and should be accounted for on the Vault's balance sheet
    @param _debtPayment
        Amount Strategy has made available to cover outstanding debt
    @return Amount of debt outstanding (if totalDebt > debtLimit or emergency shutdown).
    """

    # Only approved strategies can call this function
    assert self.strategies[msg.sender].activation > 0
    # No lying about total available to withdraw!
    assert self.token.balanceOf(msg.sender) >= gain + _debtPayment

    # We have a loss to report, do it before the rest of the calculations
    if loss > 0:
        self._reportLoss(msg.sender, loss)

    # Assess both management fee and performance fee, and issue both as shares of the vault
    # self._assessFees(msg.sender, gain)

    # Returns are always "realized gains"
    self.strategies[msg.sender].totalGain += gain

    # Outstanding debt the Strategy wants to take back from the Vault (if any)
    # NOTE: debtOutstanding <= StrategyParams.totalDebt
    debt: uint256 = self._debtOutstanding(msg.sender)
    debtPayment: uint256 = min(_debtPayment, debt)

    if debtPayment > 0:
        self.strategies[msg.sender].totalDebt -= debtPayment
        self.totalDebt -= debtPayment
        debt -= debtPayment
        # NOTE: `debt` is being tracked for later

    # Compute the line of credit the Vault is able to offer the Strategy (if any)
    credit: uint256 = self._creditAvailable(msg.sender)

    # Update the actual debt based on the full credit we are extending to the Strategy
    # or the returns if we are taking funds back
    # NOTE: credit + self.strategies[msg.sender].totalDebt is always < self.debtLimit
    # NOTE: At least one of `credit` or `debt` is always 0 (both can be 0)
    if credit > 0:
        self.strategies[msg.sender].totalDebt += credit
        self.totalDebt += credit

    # Give/take balance to Strategy, based on the difference between the reported gains
    # (if any), the debt payment (if any), the credit increase we are offering (if any),
    # and the debt needed to be paid off (if any)
    # NOTE: This is just used to adjust the balance of tokens between the Strategy and
    #       the Vault based on the Strategy's debt limit (as well as the Vault's).
    totalAvail: uint256 = gain + debtPayment
    if totalAvail < credit:  # credit surplus, give to Strategy
        self.erc20_safe_transfer(self.token.address, msg.sender, credit - totalAvail)
    elif totalAvail > credit:  # credit deficit, take from Strategy
        self.erc20_safe_transferFrom(self.token.address, msg.sender, self, totalAvail - credit)
    # else, don't do anything because it is balanced

    # Update reporting time
    self.strategies[msg.sender].lastReport = block.timestamp
    self.lastReport = block.timestamp

    log StrategyReported(
        msg.sender,
        gain,
        loss,
        debtPayment,
        self.strategies[msg.sender].totalGain,
        self.strategies[msg.sender].totalLoss,
        self.strategies[msg.sender].totalDebt,
        credit,
        self.strategies[msg.sender].debtRatio,
    )

    if self.strategies[msg.sender].debtRatio == 0 or self.emergencyShutdown:
        # Take every last penny the Strategy has (Emergency Exit/revokeStrategy)
        # NOTE: This is different than `debt` in order to extract *all* of the returns
        return Strategy(msg.sender).estimatedTotalAssets()
    else:
        # Otherwise, just return what we have as debt outstanding
        return debt


@external
def sweep(token: address, amount: uint256 = MAX_UINT256):
    """
    @notice
        Removes tokens from this Vault that are not the type of token managed
        by this Vault. This may be used in case of accidentally sending the
        wrong kind of token to this Vault.

        Tokens will be sent to `governance`.

        This will fail if an attempt is made to sweep the tokens that this
        Vault manages.

        This may only be called by governance.
    @param token The token to transfer out of this vault.
    @param amount The quantity or tokenId to transfer out.
    """
    assert msg.sender == self.governance
    # Can't be used to steal what this Vault is protecting
    assert token != self.token.address
    value: uint256 = amount
    if value == MAX_UINT256:
        value = ERC20(token).balanceOf(self)
    self.erc20_safe_transfer(token, self.governance, value)

Contract Security Audit

Contract ABI

[{"name":"Transfer","inputs":[{"type":"address","name":"sender","indexed":true},{"type":"address","name":"receiver","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false,"type":"event"},{"name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"spender","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false,"type":"event"},{"name":"StrategyAdded","inputs":[{"type":"address","name":"strategy","indexed":true},{"type":"uint256","name":"debtRatio","indexed":false},{"type":"uint256","name":"minDebtPerHarvest","indexed":false},{"type":"uint256","name":"maxDebtPerHarvest","indexed":false}],"anonymous":false,"type":"event"},{"name":"StrategyReported","inputs":[{"type":"address","name":"strategy","indexed":true},{"type":"uint256","name":"gain","indexed":false},{"type":"uint256","name":"loss","indexed":false},{"type":"uint256","name":"debtPaid","indexed":false},{"type":"uint256","name":"totalGain","indexed":false},{"type":"uint256","name":"totalLoss","indexed":false},{"type":"uint256","name":"totalDebt","indexed":false},{"type":"uint256","name":"debtAdded","indexed":false},{"type":"uint256","name":"debtRatio","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateGovernance","inputs":[{"type":"address","name":"governance","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateManagement","inputs":[{"type":"address","name":"management","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateVaultAdapter","inputs":[{"type":"address","name":"adapter","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateGuestList","inputs":[{"type":"address","name":"guestList","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateDepositLimit","inputs":[{"type":"uint256","name":"depositLimit","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateGuardian","inputs":[{"type":"address","name":"guardian","indexed":false}],"anonymous":false,"type":"event"},{"name":"EmergencyShutdown","inputs":[{"type":"bool","name":"active","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateWithdrawalQueue","inputs":[{"type":"address[20]","name":"queue","indexed":false}],"anonymous":false,"type":"event"},{"name":"StrategyUpdateDebtRatio","inputs":[{"type":"address","name":"strategy","indexed":true},{"type":"uint256","name":"debtRatio","indexed":false}],"anonymous":false,"type":"event"},{"name":"StrategyUpdateMinDebtPerHarvest","inputs":[{"type":"address","name":"strategy","indexed":true},{"type":"uint256","name":"minDebtPerHarvest","indexed":false}],"anonymous":false,"type":"event"},{"name":"StrategyUpdateMaxDebtPerHarvest","inputs":[{"type":"address","name":"strategy","indexed":true},{"type":"uint256","name":"maxDebtPerHarvest","indexed":false}],"anonymous":false,"type":"event"},{"name":"StrategyMigrated","inputs":[{"type":"address","name":"oldVersion","indexed":true},{"type":"address","name":"newVersion","indexed":true}],"anonymous":false,"type":"event"},{"name":"StrategyRevoked","inputs":[{"type":"address","name":"strategy","indexed":true}],"anonymous":false,"type":"event"},{"name":"StrategyRemovedFromQueue","inputs":[{"type":"address","name":"strategy","indexed":true}],"anonymous":false,"type":"event"},{"name":"StrategyAddedToQueue","inputs":[{"type":"address","name":"strategy","indexed":true}],"anonymous":false,"type":"event"},{"name":"initialize","outputs":[],"inputs":[{"type":"address","name":"token"},{"type":"address","name":"governance"},{"type":"string","name":"nameOverride"}],"stateMutability":"nonpayable","type":"function"},{"name":"initialize","outputs":[],"inputs":[{"type":"address","name":"token"},{"type":"address","name":"governance"},{"type":"string","name":"nameOverride"},{"type":"address","name":"guardian"}],"stateMutability":"nonpayable","type":"function"},{"name":"apiVersion","outputs":[{"type":"string","name":""}],"inputs":[],"stateMutability":"pure","type":"function","gas":4519},{"name":"setName","outputs":[],"inputs":[{"type":"string","name":"name"}],"stateMutability":"nonpayable","type":"function","gas":107017},{"name":"setGovernance","outputs":[],"inputs":[{"type":"address","name":"governance"}],"stateMutability":"nonpayable","type":"function","gas":36308},{"name":"acceptGovernance","outputs":[],"inputs":[],"stateMutability":"nonpayable","type":"function","gas":37580},{"name":"setManagement","outputs":[],"inputs":[{"type":"address","name":"management"}],"stateMutability":"nonpayable","type":"function","gas":37718},{"name":"setVaultAdapter","outputs":[],"inputs":[{"type":"address","name":"adapter"}],"stateMutability":"nonpayable","type":"function","gas":37748},{"name":"setGuestList","outputs":[],"inputs":[{"type":"address","name":"guestList"}],"stateMutability":"nonpayable","type":"function","gas":37778},{"name":"setDepositLimit","outputs":[],"inputs":[{"type":"uint256","name":"limit"}],"stateMutability":"nonpayable","type":"function","gas":37708},{"name":"setGuardian","outputs":[],"inputs":[{"type":"address","name":"guardian"}],"stateMutability":"nonpayable","type":"function","gas":39056},{"name":"setEmergencyShutdown","outputs":[],"inputs":[{"type":"bool","name":"active"}],"stateMutability":"nonpayable","type":"function","gas":39127},{"name":"setWithdrawalQueue","outputs":[],"inputs":[{"type":"address[20]","name":"queue"}],"stateMutability":"nonpayable","type":"function","gas":763683},{"name":"totalAssets","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":3643},{"name":"deposit","outputs":[],"inputs":[],"stateMutability":"nonpayable","type":"function"},{"name":"deposit","outputs":[],"inputs":[{"type":"uint256","name":"_amount"}],"stateMutability":"nonpayable","type":"function"},{"name":"withdraw","outputs":[{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""}],"inputs":[],"stateMutability":"nonpayable","type":"function"},{"name":"withdraw","outputs":[{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""}],"inputs":[{"type":"uint256","name":"amount"}],"stateMutability":"nonpayable","type":"function"},{"name":"withdraw","outputs":[{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""}],"inputs":[{"type":"uint256","name":"amount"},{"type":"address","name":"recipient"}],"stateMutability":"nonpayable","type":"function"},{"name":"withdraw","outputs":[{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""}],"inputs":[{"type":"uint256","name":"amount"},{"type":"address","name":"recipient"},{"type":"uint256","name":"maxLoss"}],"stateMutability":"nonpayable","type":"function"},{"name":"withdrawByStrategy","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address[20]","name":"_strategies"}],"stateMutability":"nonpayable","type":"function"},{"name":"withdrawByStrategy","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address[20]","name":"_strategies"},{"type":"uint256","name":"amount"}],"stateMutability":"nonpayable","type":"function"},{"name":"withdrawByStrategy","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address[20]","name":"_strategies"},{"type":"uint256","name":"amount"},{"type":"address","name":"recipient"}],"stateMutability":"nonpayable","type":"function"},{"name":"withdrawByStrategy","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address[20]","name":"_strategies"},{"type":"uint256","name":"amount"},{"type":"address","name":"recipient"},{"type":"uint256","name":"maxLoss"}],"stateMutability":"nonpayable","type":"function"},{"name":"addStrategy","outputs":[],"inputs":[{"type":"address","name":"strategy"},{"type":"uint256","name":"debtRatio"},{"type":"uint256","name":"minDebtPerHarvest"},{"type":"uint256","name":"maxDebtPerHarvest"}],"stateMutability":"nonpayable","type":"function","gas":1448661},{"name":"updateStrategyDebtRatio","outputs":[],"inputs":[{"type":"address","name":"strategy"},{"type":"uint256","name":"debtRatio"}],"stateMutability":"nonpayable","type":"function","gas":114950},{"name":"updateStrategyMinDebtPerHarvest","outputs":[],"inputs":[{"type":"address","name":"strategy"},{"type":"uint256","name":"minDebtPerHarvest"}],"stateMutability":"nonpayable","type":"function","gas":42198},{"name":"updateStrategyMaxDebtPerHarvest","outputs":[],"inputs":[{"type":"address","name":"strategy"},{"type":"uint256","name":"maxDebtPerHarvest"}],"stateMutability":"nonpayable","type":"function","gas":42228},{"name":"migrateStrategy","outputs":[],"inputs":[{"type":"address","name":"oldVersion"},{"type":"address","name":"newVersion"}],"stateMutability":"nonpayable","type":"function","gas":1105077},{"name":"revokeStrategy","outputs":[],"inputs":[],"stateMutability":"nonpayable","type":"function"},{"name":"revokeStrategy","outputs":[],"inputs":[{"type":"address","name":"strategy"}],"stateMutability":"nonpayable","type":"function"},{"name":"addStrategyToQueue","outputs":[],"inputs":[{"type":"address","name":"strategy"}],"stateMutability":"nonpayable","type":"function","gas":1196194},{"name":"removeStrategyFromQueue","outputs":[],"inputs":[{"type":"address","name":"strategy"}],"stateMutability":"nonpayable","type":"function","gas":23084106},{"name":"debtOutstanding","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function"},{"name":"debtOutstanding","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"strategy"}],"stateMutability":"view","type":"function"},{"name":"creditAvailable","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function"},{"name":"creditAvailable","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"strategy"}],"stateMutability":"view","type":"function"},{"name":"availableDepositLimit","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":8968},{"name":"expectedReturn","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function"},{"name":"expectedReturn","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"strategy"}],"stateMutability":"view","type":"function"},{"name":"report","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"uint256","name":"gain"},{"type":"uint256","name":"loss"},{"type":"uint256","name":"_debtPayment"}],"stateMutability":"nonpayable","type":"function","gas":410719},{"name":"sweep","outputs":[],"inputs":[{"type":"address","name":"token"}],"stateMutability":"nonpayable","type":"function"},{"name":"sweep","outputs":[],"inputs":[{"type":"address","name":"token"},{"type":"uint256","name":"amount"}],"stateMutability":"nonpayable","type":"function"},{"name":"name","outputs":[{"type":"string","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":8633},{"name":"symbol","outputs":[{"type":"string","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":7686},{"name":"decimals","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2291},{"name":"balanceOf","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":2536},{"name":"allowance","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"},{"type":"address","name":"arg1"}],"stateMutability":"view","type":"function","gas":2781},{"name":"token","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2381},{"name":"governance","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2411},{"name":"management","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2441},{"name":"guardian","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2471},{"name":"guestList","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2501},{"name":"vaultAdapter","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2531},{"name":"strategies","outputs":[{"type":"uint256","name":"activation"},{"type":"uint256","name":"debtRatio"},{"type":"uint256","name":"minDebtPerHarvest"},{"type":"uint256","name":"maxDebtPerHarvest"},{"type":"uint256","name":"lastReport"},{"type":"uint256","name":"totalDebt"},{"type":"uint256","name":"totalGain"},{"type":"uint256","name":"totalLoss"}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":9902},{"name":"withdrawalQueue","outputs":[{"type":"address","name":""}],"inputs":[{"type":"uint256","name":"arg0"}],"stateMutability":"view","type":"function","gas":2700},{"name":"emergencyShutdown","outputs":[{"type":"bool","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2621},{"name":"depositLimit","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2651},{"name":"debtRatio","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2681},{"name":"totalDebt","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2711},{"name":"lastReport","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2741},{"name":"activation","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2771},{"name":"nonces","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":3016},{"name":"DOMAIN_SEPARATOR","outputs":[{"type":"bytes32","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":2831}]

Deployed Bytecode

0x341561000a57600080fd5b600436101561001857613ddb565b600035601c52634571e3a6600051141561003657336101c05261006c565b6309c26fb160005114156100645760643560a01c1561005457600080fd5b602060646101c03760005061006c565b60001561042f575b60043560a01c1561007c57600080fd5b60243560a01c1561008c57600080fd5b60606044356004016101403760406044356004013511156100ac57600080fd5b601354156100b957600080fd5b600435600555600061022052610220805160208201209050610140805160208201209050141561020057600060606102c060046395d89b416102605261027c6004355afa61010657600080fd5b603f3d1161011357600080fd5b60156102c06102c05101511061012857600080fd5b6000506102e060148060208461038001018260208501600060045af15050805182019150506007610320527f20795661756c74000000000000000000000000000000000000000000000000006103405261032060078060208461038001018260208501600060045af15050805182019150508061038052610380905080600060c052602060c020602082510161012060006002818352015b826101205160200211156101d3576101f5565b61012051602002850151610120518501555b81516001018083528114156101c0575b50505050505061025b565b61014080600060c052602060c020602082510161012060006003818352015b8261012051602002111561023257610254565b61012051602002850151610120518501555b815160010180835281141561021f575b5050505050505b6020610240600463313ce5676101e0526101fc6004355afa61027c57600080fd5b601f3d1161028957600080fd5b600050610240516002556024356006556024356101e0527f8d55d160c0009eb3d739442df0a3ca089ed64378bfac017e7ddad463f9815b8760206101e0a16024356007556024356101e0527fff54978127edd34aec0f9061fb3b155fbe0ededdfa881ee3e0d541d3a1eef43860206101e0a16101c0516008556101c0516101e0527f837b9ad138a0a1839a9637afce5306a5c13e23eb63365686843a5319a243609c60206101e0a1426012554260135560007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020826105c0010152602081019050600b6104a0527f596561726e205661756c740000000000000000000000000000000000000000006104c0526104a08051602082012090506020826105c00101526020810190506005610560527f302e332e32000000000000000000000000000000000000000000000000000000610580526105608051602082012090506020826105c0010152602081019050466020826105c0010152602081019050306020826105c0010152602081019050806105c0526105c09050805160208201209050601555005b632582941060005114156104c8576005610140527f302e332e32000000000000000000000000000000000000000000000000000000610160526101408051602001806101e08284600060045af161048557600080fd5b50506101e0518061020001818260206001820306601f820103905003368237505060206101c05260406101e0510160206001820306601f82010390506101c0f350005b63c47f0027600051141561056057604a60043560040161014037602a6004356004013511156104f657600080fd5b600654331461050457600080fd5b61014080600060c052602060c020602082510161012060006003818352015b8261012051602002111561053657610558565b61012051602002850151610120518501555b8151600101808352811415610523575b505050505050005b63ab033ea960005114156105945760043560a01c1561057e57600080fd5b600654331461058c57600080fd5b600435600955005b63238efcbc60005114156105e25760095433146105b057600080fd5b3360065533610140527f8d55d160c0009eb3d739442df0a3ca089ed64378bfac017e7ddad463f9815b876020610140a1005b63d4a22bde60005114156106445760043560a01c1561060057600080fd5b600654331461060e57600080fd5b600435600755600435610140527fff54978127edd34aec0f9061fb3b155fbe0ededdfa881ee3e0d541d3a1eef4386020610140a1005b63d2ca203860005114156106a65760043560a01c1561066257600080fd5b600654331461067057600080fd5b600435600b55600435610140527f2be7041145a57f48cacf32d6274da6975c5e75252dde8d9070651c09270068046020610140a1005b630b5b78eb60005114156107085760043560a01c156106c457600080fd5b60065433146106d257600080fd5b600435600a55600435610140527f6d674c311329fb38bbc96dc33d2aad03b9bf9fcfdd8f5e5054fda291a5b3c1f86020610140a1005b63bdc8144b600051141561075a57600654331461072457600080fd5b600435600f55600435610140527fae565aab888bca5e19e25a13db7b0c9144305bf55cb0f3f4d724f730e5acdd626020610140a1005b638a0dac4a600051141561080e5760043560a01c1561077857600080fd5b600854610160526006546101805260006101405261014061012060006002818352015b6101205160200261016001513314156107b757600183526107c8565b5b815160010180835281141561079b575b505050610140516107d857600080fd5b600435600855600435610140527f837b9ad138a0a1839a9637afce5306a5c13e23eb63365686843a5319a243609c6020610140a1005b6314c6440260005114156108de5760043560011c1561082c57600080fd5b6004351561089957600854610160526006546101805260006101405261014061012060006002818352015b6101205160200261016001513314156108735760018352610884565b5b8151600101808352811415610857575b5050506101405161089457600080fd5b6108a8565b60065433146108a757600080fd5b5b600435600e55600435610140527fba40372a3a724dca3c57156128ef1e896724b65b37a17f190b1ad5de68f3a4f36020610140a1005b63941484156000511415610b23576000610120525b610120516004013560a01c1561090857600080fd5b6020610120510161012052610280610120511015610925576108f3565b600754610160526006546101805260006101405261014061012060006002818352015b6101205160200261016001513314156109645760018352610975565b5b8151600101808352811415610948575b5050506101405161098557600080fd5b61014060006014818352015b600461014051601481106109a457600080fd5b602002013515156109d25761014051601481106109c057600080fd5b600d60c052602060c0200154156109d5565b60005b156109df57610a5f565b6000600c600461014051601481106109f657600080fd5b602002013560e05260c052604060c02060c052602060c0205411610a1957600080fd5b60046101405160148110610a2c57600080fd5b60200201356101405160148110610a4257600080fd5b600d60c052602060c02001555b8151600101808352811415610991575b50506004356101405260243561016052604435610180526064356101a0526084356101c05260a4356101e05260c4356102005260e43561022052610104356102405261012435610260526101443561028052610164356102a052610184356102c0526101a4356102e0526101c435610300526101e43561032052610204356103405261022435610360526102443561038052610264356103a0527f695ac3ac73f08f2002284ffe563cefe798ee2878a5e04219522e2e99eb89d168610280610140a1005b600015610cc6575b6101a05261014052610160526101805260006004610220527fa9059cbb000000000000000000000000000000000000000000000000000000006102405261022060048060208461028001018260208501600060045af15050805182019150506101605160208261028001015260208101905061018051602082610280010152602081019050806102805261028090508051602001806103208284600060045af1610bd457600080fd5b505060206103e0610320516103406000610140515af1610bf357600080fd5b60203d80821115610c045780610c06565b815b905090506103c0526103c08051602001806101c08284600060045af1610c2b57600080fd5b505060006101c0511115610cc0576101c0806020015160008251806020901315610c5457600080fd5b8091901215610c6257600080fd5b806020036101000a820490509050905015151515610cbf576308c379a0610220526020610240526010610260527f5472616e73666572206661696c656421000000000000000000000000000000006102805261026050606461023cfd5b5b6101a051565b600015610e80575b6101c0526101405261016052610180526101a05260006004610240527f23b872dd00000000000000000000000000000000000000000000000000000000610260526102406004806020846102a001018260208501600060045af1505080518201915050610160516020826102a0010152602081019050610180516020826102a00101526020810190506101a0516020826102a0010152602081019050806102a0526102a090508051602001806103608284600060045af1610d8e57600080fd5b50506020610440610360516103806000610140515af1610dad57600080fd5b60203d80821115610dbe5780610dc0565b815b90509050610420526104208051602001806101e08284600060045af1610de557600080fd5b505060006101e0511115610e7a576101e0806020015160008251806020901315610e0e57600080fd5b8091901215610e1c57600080fd5b806020036101000a820490509050905015151515610e79576308c379a0610240526020610260526010610280527f5472616e73666572206661696c656421000000000000000000000000000000006102a05261028050606461025cfd5b5b6101c051565b600015610eed575b6101405260206101e060246370a0823161016052306101805261017c6005545afa610eb257600080fd5b601f3d11610ebf57600080fd5b6000506101e051601154818183011015610ed857600080fd5b80820190509050600052600051610140515650005b6301e1d1146000511415610f175760065801610e88565b610140526101405160005260206000f350005b63d0e30db06000511415610f4f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61014052610f75565b63b6b55f256000511415610f6d576020600461014037600050610f75565b6000156111a9575b62ffffff5415610f8457600080fd5b600162ffffff55600e5415610f9857600080fd5b600b5433141515610fe8576308c379a061016052602061018052601e6101a0527f4f6e6c79207661756c7420616461707465722063616e206465706f73697400006101c0526101a050606461017cfd5b61014051610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101605114156110aa57600f54610140516101605160065801610e88565b610180526101605261014052610180518082101561104c57600080fd5b80820390509050602061022060246370a082316101a052336101c0526101bc6005545afa61107957600080fd5b601f3d1161108657600080fd5b600050610220518082111561109b578061109d565b815b90509050610160526110f4565b600f54610140516101605160065801610e88565b61018052610160526101405261018051610160518181830110156110e157600080fd5b8082019050905011156110f357600080fd5b5b6000610160511161110457600080fd5b6000600a54181561115b5760206102206044635ed7660e61018052336101a052610160516101c05261019c600a545afa61113d57600080fd5b601f3d1161114a57600080fd5b6000506102205161115a57600080fd5b5b610140516101605160055461018052336101a052306101c052610160516101e0526101e0516101c0516101a0516101805160065801610cce565b6101605261014052600050600062ffffff55005b633ccfd60b60005114156111ec577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610140523361016052600161018052611296565b632e1a7d4d60005114156112155733610160526001610180526020600461014037600050611296565b62f714ce600051141561125057600161018052602060046101403760243560a01c1561124057600080fd5b6020602461016037600050611296565b63e63697c8600051141561128e57602060046101403760243560a01c1561127657600080fd5b60206024610160376020604461018037600050611296565b6000156117c4575b62ffffff54156112a557600080fd5b600162ffffff55600b54331415156112fc576308c379a06101a05260206101c052601e6101e0527f4f6e6c79207661756c7420616461707465722063616e206465706f7369740000610200526101e05060646101bcfd5b610140516101a0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610140511415611365576101405161016051610180516101a05160065801610e88565b6101c0526101a0526101805261016052610140526101c0516101a0525b60006101c052602061026060246370a082316101e05230610200526101fc6005545afa61139157600080fd5b601f3d1161139e57600080fd5b600050610260516101a051111561165c576102a060006014818352015b6102a051600d60c052602060c0200154610280526102805115156113de57611659565b602061036060246370a082316102e05230610300526102fc6005545afa61140457600080fd5b601f3d1161141157600080fd5b600050610360516102c0526102c0516101a05111151561143057611659565b6101a0516102c0518082101561144557600080fd5b808203905090506102e0526102e0516005600c6102805160e05260c052604060c02060c052602060c02001548082111561147f5780611481565b815b905090506102e0526102e051151561149857611649565b60206103a06024632e1a7d4d610320526102e0516103405261033c6000610280515af16114c457600080fd5b601f3d116114d157600080fd5b6000506103a0516103005260206103c060246370a0823161034052306103605261035c6005545afa61150257600080fd5b601f3d1161150f57600080fd5b6000506103c0516102c0518082101561152757600080fd5b808203905090506103205260006103005111156115bc576101a08051610300518082101561155457600080fd5b808203905090508152506101c080516103005181818301101561157657600080fd5b808201905090508152506007600c6102805160e05260c052604060c02060c052602060c020018054610300518181830110156115b157600080fd5b808201905090508155505b6005600c6102805160e05260c052604060c02060c052602060c02001805461032051610300518181830110156115f157600080fd5b808201905090508082101561160557600080fd5b8082039050905081555060118054610320516103005181818301101561162a57600080fd5b808201905090508082101561163e57600080fd5b808203905090508155505b81516001018083528114156113bb575b50505b602061028060246370a0823161020052306102205261021c6005545afa61168257600080fd5b601f3d1161168f57600080fd5b600050610280516101e0526101e0516101a05111156116b1576101e0516101a0525b610180516101a0516101c0518181830110156116cc57600080fd5b8082019050905080820282158284830414176116e757600080fd5b80905090509050612710808204905090506101c051111561170757600080fd5b6101405161016051610180516101a0516101c0516101e0516005546102005261016051610220526101a0516102405261024051610220516102005160065801610b2b565b6101e0526101c0526101a0526101805261016052610140526000506102008080806101c051815250506020810190508080610180518152505060208101905080806101a0518152505060208101905080806127108152505060809050905060c052600062ffffff5560c051610200f350600062ffffff55005b633c2a26af6000511415611807577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101405233610160526001610180526118ba565b633f88590b60005114156118315733610160526001610180526020610284610140376000506118ba565b6325fb606d6000511415611870576001610180526020610284610140376102a43560a01c1561185f57600080fd5b60206102a4610160376000506118ba565b635e4cbd5860005114156118b2576020610284610140376102a43560a01c1561189857600080fd5b60206102a46101603760206102c4610180376000506118ba565b600015611ddb575b62ffffff54156118c957600080fd5b600162ffffff556000610120525b610120516004013560a01c156118ec57600080fd5b6020610120510161012052610280610120511015611909576118d7565b600b5433141515611959576308c379a06101a05260206101c052601f6101e0527f4f6e6c79207661756c7420616461707465722063616e20776974686472617700610200526101e05060646101bcfd5b610140516101a0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101405114156119c2576101405161016051610180516101a05160065801610e88565b6101c0526101a0526101805261016052610140526101c0516101a0525b60006101c052602061026060246370a082316101e05230610200526101fc6005545afa6119ee57600080fd5b601f3d116119fb57600080fd5b600050610260516101a0511115611cb4576102a060006014818352015b60206102a051026004013561028052610280511515611a3657611cb1565b602061036060246370a082316102e05230610300526102fc6005545afa611a5c57600080fd5b601f3d11611a6957600080fd5b600050610360516102c0526102c0516101a051111515611a8857611cb1565b6101a0516102c05180821015611a9d57600080fd5b808203905090506102e0526102e0516005600c6102805160e05260c052604060c02060c052602060c020015480821115611ad75780611ad9565b815b905090506102e0526102e0511515611af057611ca1565b60206103a06024632e1a7d4d610320526102e0516103405261033c6000610280515af1611b1c57600080fd5b601f3d11611b2957600080fd5b6000506103a0516103005260206103c060246370a0823161034052306103605261035c6005545afa611b5a57600080fd5b601f3d11611b6757600080fd5b6000506103c0516102c05180821015611b7f57600080fd5b80820390509050610320526000610300511115611c14576101a080516103005180821015611bac57600080fd5b808203905090508152506101c0805161030051818183011015611bce57600080fd5b808201905090508152506007600c6102805160e05260c052604060c02060c052602060c02001805461030051818183011015611c0957600080fd5b808201905090508155505b6005600c6102805160e05260c052604060c02060c052602060c0200180546103205161030051818183011015611c4957600080fd5b8082019050905080821015611c5d57600080fd5b80820390509050815550601180546103205161030051818183011015611c8257600080fd5b8082019050905080821015611c9657600080fd5b808203905090508155505b8151600101808352811415611a18575b50505b602061028060246370a0823161020052306102205261021c6005545afa611cda57600080fd5b601f3d11611ce757600080fd5b600050610280516101e0526101e0516101a0511115611d09576101e0516101a0525b610180516101a0516101c051818183011015611d2457600080fd5b808201905090508082028215828483041417611d3f57600080fd5b80905090509050612710808204905090506101c0511115611d5f57600080fd5b6101405161016051610180516101a0516101c0516101e0516005546102005261016051610220526101a0516102405261024051610220516102005160065801610b2b565b6101e0526101c0526101a0526101805261016052610140526000506101a051600052600062ffffff5560206000f350600062ffffff55005b600015611ec8575b6101405260006101605261018060006014818352015b6101805160148110611e0a57600080fd5b600d60c052602060c02001546101a0526101a0511515611e495761016080516001818183011015611e3a57600080fd5b80820190509050815250611eaf565b6000610160511115611eae576101a051610180516101605180821015611e6e57600080fd5b8082039050905060148110611e8257600080fd5b600d60c052602060c020015560006101805160148110611ea157600080fd5b600d60c052602060c02001555b5b5b8151600101808352811415611df9575b505061014051565b630dd21b6c60005114156120d55760043560a01c15611ee657600080fd5b6013600d60c052602060c020015415611efe57600080fd5b600e5415611f0b57600080fd5b6006543314611f1957600080fd5b600060043518611f2857600080fd5b600c60043560e05260c052604060c02060c052602060c0205415611f4b57600080fd5b60206101a0600463fbfa77cf6101405261015c6004355afa611f6c57600080fd5b601f3d11611f7957600080fd5b6000506101a0513014611f8b57600080fd5b60206101a06004631f1fcd516101405261015c6004355afa611fac57600080fd5b601f3d11611fb957600080fd5b6000506101a05160055414611fcd57600080fd5b612710601054602435818183011015611fe557600080fd5b808201905090501115611ff757600080fd5b606435604435111561200857600080fd5b600c60043560e05260c052604060c02060c052602060c020428155602435600182015560443560028201556064356003820155426004820155600060058201556000600682015560006007820155506024356101405260443561016052606435610180526004357f5ec27a4fa537fc86d0d17d84e0ee3172c9d253c78cc4ab5c69ee99c5f7084f516060610140a2601080546024358181830110156120ac57600080fd5b808201905090508155506004356013600d60c052602060c020015560065801611de3565b600050005b637c6a4f2460005114156122325760043560a01c156120f357600080fd5b600754610160526006546101805260006101405261014061012060006002818352015b6101205160200261016001513314156121325760018352612143565b5b8151600101808352811415612116575b5050506101405161215357600080fd5b6000600c60043560e05260c052604060c02060c052602060c020541161217857600080fd5b601080546001600c60043560e05260c052604060c02060c052602060c0200154808210156121a557600080fd5b808203905090508155506024356001600c60043560e05260c052604060c02060c052602060c0200155601080546024358181830110156121e457600080fd5b8082019050905081555061271060105411156121ff57600080fd5b602435610140526004357fbda9398315c83ccef012bcaa318a2ff7b680f36429d36597bd4bc25ac11ead596020610140a2005b63e722befe60005114156123515760043560a01c1561225057600080fd5b600754610160526006546101805260006101405261014061012060006002818352015b61012051602002610160015133141561228f57600183526122a0565b5b8151600101808352811415612273575b505050610140516122b057600080fd5b6000600c60043560e05260c052604060c02060c052602060c02054116122d557600080fd5b6024356003600c60043560e05260c052604060c02060c052602060c020015410156122ff57600080fd5b6024356002600c60043560e05260c052604060c02060c052602060c0200155602435610140526004357f0b728ad785976532c4aaadde09b1cba5f262a7090e83c62d2377bc405678b29c6020610140a2005b634757a15660005114156124705760043560a01c1561236f57600080fd5b600754610160526006546101805260006101405261014061012060006002818352015b6101205160200261016001513314156123ae57600183526123bf565b5b8151600101808352811415612392575b505050610140516123cf57600080fd5b6000600c60043560e05260c052604060c02060c052602060c02054116123f457600080fd5b6024356002600c60043560e05260c052604060c02060c052602060c0200154111561241e57600080fd5b6024356003600c60043560e05260c052604060c02060c052602060c0200155602435610140526004357f1796a8e0760e2de5b72e7bf64fccb7666c48ceab94cb6cae7cb7eff4b6f641ab6020610140a2005b600015612507575b6101605261014052601080546001600c6101405160e05260c052604060c02060c052602060c0200154808210156124ae57600080fd5b8082039050905081555060006001600c6101405160e05260c052604060c02060c052602060c0200155610140517f4201c688d84c01154d321afa0c72f1bffe9eef53005c9de9d035074e71e9b32a60006000a261016051565b636cb56d1960005114156127f85760043560a01c1561252557600080fd5b60243560a01c1561253557600080fd5b600654331461254357600080fd5b60006024351861255257600080fd5b6000600c60043560e05260c052604060c02060c052602060c020541161257757600080fd5b600c60243560e05260c052604060c02060c052602060c020541561259a57600080fd5b610140600c60043560e05260c052604060c0208060c052602060c02054825260018160c052602060c0200154826020015260028160c052602060c0200154826040015260038160c052602060c0200154826060015260048160c052602060c0200154826080015260058160c052602060c02001548260a0015260068160c052602060c02001548260c0015260078160c052602060c02001548260e0015250506101405161016051610180516101a0516101c0516101e0516102005161022051600435610240526102405160065801612478565b61022052610200526101e0526101c0526101a05261018052610160526101405260005060108054610160518181830110156126a757600080fd5b8082019050905081555060006005600c60043560e05260c052604060c02060c052602060c0200155600c60243560e05260c052604060c02060c052602060c0206101c05181556101605160018201556101805160028201556101a05160038201556101c05160048201556101e05160058201556000600682015560006007820155506004353b61273657600080fd5b60006000602463ce5494bb610240526024356102605261025c60006004355af161275f57600080fd5b6024356004357f100b69bb6b504e1252e36b375233158edee64d071b399e2f81473a695fd1b02160006000a361024060006014818352015b60043561024051601481106127ab57600080fd5b600d60c052602060c020015414156127e35760243561024051601481106127d157600080fd5b600d60c052602060c020015560006000f35b5b8151600101808352811415612797575b5050005b63a0e4af9a6000511415612810573361014052612846565b63bb994d48600051141561283e5760043560a01c1561282e57600080fd5b6020600461014037600050612846565b6000156128d0575b61014051610180526006546101a0526008546101c05260006101605261016061012060006003818352015b61012051602002610180015133141561288d576001835261289e565b5b8151600101808352811415612871575b505050610160516128ae57600080fd5b6101405161014051610160526101605160065801612478565b61014052600050005b63f76e4caa6000511415612a255760043560a01c156128ee57600080fd5b600754610160526006546101805260006101405261014061012060006002818352015b61012051602002610160015133141561292d576001835261293e565b5b8151600101808352811415612911575b5050506101405161294e57600080fd5b6000600c60043560e05260c052604060c02060c052602060c020541161297357600080fd5b6013600d60c052602060c02001541561298b57600080fd5b61016060006014818352015b61016051600d60c052602060c02001546101405260043515156129b9576129db565b60043561014051186129ca57600080fd5b5b8151600101808352811415612997575b50506004356013600d60c052602060c020015560065801611de3565b6000506004357fa8727d412c6fa1e2497d6d6f275e2d9fe4d9318d5b793632e60ad9d38ee8f1fa60006000a2005b63b22439f56000511415612b515760043560a01c15612a4357600080fd5b600754610160526006546101805260006101405261014061012060006002818352015b610120516020026101600151331415612a825760018352612a93565b5b8151600101808352811415612a66575b50505061014051612aa357600080fd5b61014060006014818352015b6004356101405160148110612ac357600080fd5b600d60c052602060c02001541415612b375760006101405160148110612ae857600080fd5b600d60c052602060c02001556101405160065801611de3565b610140526000506004357f8e1ec3c16d6a67ea8effe2ac7adef9c2de0bc0dc47c49cdf18f6a8b0048085be60006000a260006000f35b5b8151600101808352811415612aaf575b505060006000fd005b600015612c5c575b61016052610140526001600c6101405160e05260c052604060c02060c052602060c020015461014051610160516101805160065801610e88565b6101a0526101805261016052610140526101a0518082028215828483041417612bbb57600080fd5b8090509050905061271080820490509050610180526005600c6101405160e05260c052604060c02060c052602060c02001546101a052600e5415612c0e576101a051600052600051610160515650612c5a565b610180516101a051111515612c30576000600052600051610160515650612c59565b6101a0516101805180821015612c4557600080fd5b808203905090506000526000516101605156505b5b005b63bf3759b56000511415612c74573361014052612caa565b63bdcf36bb6000511415612ca25760043560a01c15612c9257600080fd5b6020600461014037600050612caa565b600015612cda575b6101405161014051610160526101605160065801612b59565b6101c052610140526101c05160005260206000f350005b600015612f42575b6101605261014052600e5415612d015760006000526000516101605156505b61014051610160516101805160065801610e88565b6101a0526101805261016052610140526101a05161018052601054610180518082028215828483041417612d4957600080fd5b80905090509050612710808204905090506101a0526011546101c0526001600c6101405160e05260c052604060c02060c052602060c0200154610180518082028215828483041417612d9a57600080fd5b80905090509050612710808204905090506101e0526005600c6101405160e05260c052604060c02060c052602060c0200154610200526002600c6101405160e05260c052604060c02060c052602060c0200154610220526003600c6101405160e05260c052604060c02060c052602060c020015461024052610200516101e051111515612e28576001612e33565b6101c0516101a05111155b5b15612e485760006000526000516101605156505b6101e0516102005180821015612e5d57600080fd5b8082039050905061026052610260516101a0516101c05180821015612e8157600080fd5b8082039050905080821115612e965780612e98565b815b905090506102605261026051602061030060246370a0823161028052306102a05261029c6005545afa612eca57600080fd5b601f3d11612ed757600080fd5b6000506103005180821115612eec5780612eee565b815b905090506102605261022051610260511015612f17576000600052600051610160515650612f40565b610260516102405180821115612f2d5780612f2f565b815b905090506000526000516101605156505b005b63112c1f9b6000511415612f5a573361014052612f90565b63d76480136000511415612f885760043560a01c15612f7857600080fd5b6020600461014037600050612f90565b600015612fc0575b6101405161014051610160526101605160065801612ce2565b6101c052610140526101c05160005260206000f350005b60001561311b575b61016052610140526004600c6101405160e05260c052604060c02060c052602060c02001546101805242610180518082101561300357600080fd5b808203905090506101a05261018051600c6101405160e05260c052604060c02060c052602060c020548082101561303957600080fd5b808203905090506101c05260006101a051111561309f5760006101c05111156130975760206102c060046322f3e2d46102605261027c610140515afa61307e57600080fd5b601f3d1161308b57600080fd5b6000506102c05161309a565b60005b6130a2565b60005b5b1561310a576006600c6101405160e05260c052604060c02060c052602060c02001546101a05180820282158284830414176130dd57600080fd5b809050905090506101c05180806130f357600080fd5b820490509050600052600051610160515650613119565b60006000526000516101605156505b005b63153c27c4600051141561318f5760065801610e88565b6101405261014051600f54111561318157600f546101405160065801610e88565b6101605261014052610160518082101561316c57600080fd5b8082039050905060005260206000f35061318d565b600060005260206000f3505b005b63d3406abd60005114156131a75733610140526131dd565b6333586b6760005114156131d55760043560a01c156131c557600080fd5b60206004610140376000506131dd565b60001561320d575b6101405161014051610160526101605160065801612fc8565b6101c052610140526101c05160005260206000f350005b6000156132ee575b6101805261014052610160526005600c6101405160e05260c052604060c02060c052602060c02001546101a052610160516101a051101561325557600080fd5b6007600c6101405160e05260c052604060c02060c052602060c0200180546101605181818301101561328657600080fd5b808201905090508155506101a05161016051808210156132a557600080fd5b808203905090506005600c6101405160e05260c052604060c02060c052602060c02001556011805461016051808210156132de57600080fd5b8082039050905081555061018051565b63a1d9bafc60005114156137bb576000600c3360e05260c052604060c02060c052602060c020541161331f57600080fd5b60043560443581818301101561333457600080fd5b8082019050905060206101c060246370a0823161014052336101605261015c6005545afa61336157600080fd5b601f3d1161336e57600080fd5b6000506101c051101561338057600080fd5b600060243511156133ac57336101405260243561016052610160516101405160065801613215565b6000505b6006600c3360e05260c052604060c02060c052602060c0200180546004358181830110156133d957600080fd5b808201905090508155506101405133610160526101605160065801612b59565b6101c052610140526101c05161014052604435610140518082111561341e5780613420565b815b905090506101605260006101605111156134aa576005600c3360e05260c052604060c02060c052602060c020018054610160518082101561346057600080fd5b8082039050905081555060118054610160518082101561347f57600080fd5b808203905090508155506101408051610160518082101561349f57600080fd5b808203905090508152505b610140516101605161018051336101a0526101a05160065801612ce2565b6102005261018052610160526101405261020051610180526000610180511115613546576005600c3360e05260c052604060c02060c052602060c0200180546101805181818301101561351a57600080fd5b80820190509050815550601180546101805181818301101561353b57600080fd5b808201905090508155505b6004356101605181818301101561355c57600080fd5b808201905090506101a052610180516101a05110156135de576101405161016051610180516101a0516005546101c052336101e052610180516101a051808210156135a657600080fd5b8082039050905061020052610200516101e0516101c05160065801610b2b565b6101a05261018052610160526101405260005061365b565b610180516101a051111561365a576101405161016051610180516101a0516005546101c052336101e05230610200526101a051610180518082101561362257600080fd5b808203905090506102205261022051610200516101e0516101c05160065801610cce565b6101a0526101805261016052610140526000505b5b426004600c3360e05260c052604060c02060c052602060c0200155426012556004356101c0526024356101e05261016051610200526006600c3360e05260c052604060c02060c052602060c0200154610220526007600c3360e05260c052604060c02060c052602060c0200154610240526005600c3360e05260c052604060c02060c052602060c02001546102605261018051610280526001600c3360e05260c052604060c02060c052602060c02001546102a052337f67f96d2854a335a4cadb49f84fd3ca6f990744ddb3feceeb4b349d2d53d32ad36101006101c0a26001600c3360e05260c052604060c02060c052602060c02001541515613760576001613764565b600e545b5b156137ab576020610220600463efbb5cb06101c0526101dc335afa61378957600080fd5b601f3d1161379657600080fd5b6000506102205160005260206000f3506137b9565b6101405160005260206000f3505b005b6301681a6260005114156137f3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61014052613819565b636ea056a96000511415613811576020602461014037600050613819565b6000156138f9575b60043560a01c1561382957600080fd5b600654331461383757600080fd5b6005546004351861384757600080fd5b61014051610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101605114156138b957602061020060246370a0823161018052306101a05261019c6004355afa6138a057600080fd5b601f3d116138ad57600080fd5b60005061020051610160525b6101405161016051600435610180526006546101a052610160516101c0526101c0516101a0516101805160065801610b2b565b6101605261014052600050005b6306fdde0360005114156139a25760008060c052602060c020610180602082540161012060006003818352015b826101205160200211156139395761395b565b61012051850154610120516020028501525b8151600101808352811415613926575b50505050505061018051806101a001818260206001820306601f82010390500336823750506020610160526040610180510160206001820306601f8201039050610160f350005b6395d89b416000511415613a4b5760018060c052602060c020610180602082540161012060006002818352015b826101205160200211156139e257613a04565b61012051850154610120516020028501525b81516001018083528114156139cf575b50505050505061018051806101a001818260206001820306601f82010390500336823750506020610160526040610180510160206001820306601f8201039050610160f350005b63313ce5676000511415613a675760025460005260206000f350005b6370a082316000511415613aa15760043560a01c15613a8557600080fd5b600360043560e05260c052604060c0205460005260206000f350005b63dd62ed3e6000511415613af95760043560a01c15613abf57600080fd5b60243560a01c15613acf57600080fd5b600460043560e05260c052604060c02060243560e05260c052604060c0205460005260206000f350005b63fc0c546a6000511415613b155760055460005260206000f350005b635aa6e6756000511415613b315760065460005260206000f350005b6388a8d6026000511415613b4d5760075460005260206000f350005b63452a93206000511415613b695760085460005260206000f350005b6346d558756000511415613b8557600a5460005260206000f350005b634b43ac496000511415613ba157600b5460005260206000f350005b6339ebf8236000511415613ca75760043560a01c15613bbf57600080fd5b600c60043560e05260c052604060c0206101408080808460c052602060c0205481525050602081019050808060018560c052602060c020015481525050602081019050808060028560c052602060c020015481525050602081019050808060038560c052602060c020015481525050602081019050808060048560c052602060c020015481525050602081019050808060058560c052602060c020015481525050602081019050808060068560c052602060c020015481525050602081019050808060078560c052602060c0200154815250506101009050905060c05260c051610140f39050005b63c822adda6000511415613cdc5760043560148110613cc557600080fd5b600d60c052602060c020015460005260206000f350005b633403c2fc6000511415613cf857600e5460005260206000f350005b63ecf708586000511415613d1457600f5460005260206000f350005b63cea55f576000511415613d305760105460005260206000f350005b63fc7b9c186000511415613d4c5760115460005260206000f350005b63c3535b526000511415613d685760125460005260206000f350005b633629c8de6000511415613d845760135460005260206000f350005b637ecebe006000511415613dbe5760043560a01c15613da257600080fd5b601460043560e05260c052604060c0205460005260206000f350005b633644e5156000511415613dda5760155460005260206000f350005b5b60006000fd

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  ]

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.