Skip to content
Verified contractExact

UnifiedOwnerProxy

Address0xeda010c47aef0574fe98d02b0de3648f81daf149
Balance

0 ETH

 

Transactions

0

 

Compiler

vyper 0.4.3

 

Same code

Only this contract

 

Details

Compiler
vyper 0.4.3+commit.bff19ea2
Language
vyper
License
Not stated
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,498,926
Creation transaction
0xf13ab8ceee…ba0e2dee1d

UnifiedOwnerProxy.vy

# pragma version 0.4.3

"""
@title Unified Owner Proxy
@author Curve.Finance
@notice One owner proxy per chain for pools, gauges and lending markets. The emergency DAO acts through
        named calls; the DAO keeps full control through execute and can delegate single methods on single
        targets to controllers.
@custom:kill The DAO can remove the emergency DAO and return admin roles through execute.
"""


################################################################
#                           MODULES                            #
################################################################

from modules import amm
from modules import gauges
from modules import lending


################################################################
#                          INTERFACES                          #
################################################################

interface IOwnable:
    def accept_transfer_ownership(): nonpayable


################################################################
#                            EVENTS                            #
################################################################

event DAOCommitted:
    current: indexed(address)
    future: indexed(address)


event DAOSet:
    previous: indexed(address)
    current: indexed(address)


event EmergencyDAOSet:
    previous: indexed(address)
    current: indexed(address)


event PermissionSet:
    controller: indexed(address)
    target: indexed(address)
    selector: indexed(bytes4)
    allowed: bool


################################################################
#                          CONSTANTS                           #
################################################################

MAX_CALLDATA_SIZE: constant(uint256) = 1024
MAX_OUTSIZE: constant(uint256) = 1024


################################################################
#                           STORAGE                            #
################################################################

dao: public(address)
emergency_dao: public(address)
future_dao: public(address)

# permissions[controller][target][selector]: whether the controller may call that method on that target.
# For example, a contract that moves a TwoCrypto-NG pool's reserved profit fraction as the market
# changes, or a partner DAO such as Yield Basis tuning its own pools, each limited to what the DAO
# granted. Grants outlive changes of the DAO or the emergency DAO; revoke them explicitly.
permissions: public(HashMap[address, HashMap[address, HashMap[bytes4, bool]]])


################################################################
#                         CONSTRUCTOR                          #
################################################################

@deploy
def __init__(_dao: address, _emergency_dao: address):
    assert _dao != empty(address), "Invalid DAO"

    self.dao = _dao
    self._set_emergency_dao(_emergency_dao)


################################################################
#                      INTERNAL FUNCTIONS                      #
################################################################

@internal
def _check_authorized():
    assert msg.sender in [self.dao, self.emergency_dao], "Unauthorized"


@internal
def _set_emergency_dao(_emergency_dao: address):
    log EmergencyDAOSet(previous=self.emergency_dao, current=_emergency_dao)
    self.emergency_dao = _emergency_dao


################################################################
#                     GAUGE PROXY METHODS                      #
################################################################

@external
def set_gauge_manager(_gauge: gauges.IGauge, _manager: address):
    self._check_authorized()
    gauges._set_gauge_manager(_gauge, _manager)


@external
def set_killed(_gauge: gauges.IGauge):
    self._check_authorized()
    gauges._set_killed(_gauge)


@external
def set_reward_invalidated(_gauge: gauges.IGauge, _reward_token: address, _invalidated: bool):
    """
    @notice Leave a reward token out of a gauge's default claims, or bring it back.
    @dev For a token whose transfer reverts: claims and exits that pay rewards keep working
         for the other tokens. Only gauges from v6.2.0 on, and ChildGauge 1.2.0, have this method.
    """
    self._check_authorized()
    gauges._set_reward_invalidated(_gauge, _reward_token, _invalidated)


################################################################
#                      AMM PROXY METHODS                       #
################################################################

@external
def ramp_A(_pool: amm.IStablePool, _future_A: uint256, _future_time: uint256):
    self._check_authorized()
    amm._ramp_A(_pool, _future_A, _future_time)


@external
def stop_ramp_A(_pool: amm.IStablePool):
    self._check_authorized()
    amm._stop_ramp_A(_pool)


@external
def set_new_fee(_pool: amm.IStablePool, _new_fee: uint256, _new_offpeg_fee_multiplier: uint256):
    self._check_authorized()
    amm._set_new_fee(_pool, _new_fee, _new_offpeg_fee_multiplier)


@external
def set_ma_exp_time(_pool: amm.IStablePool, _ma_exp_time: uint256, _D_ma_time: uint256):
    self._check_authorized()
    amm._set_ma_exp_time(_pool, _ma_exp_time, _D_ma_time)


@external
def ramp_A_gamma(
    _pool: amm.ICryptoPool,
    _future_A: uint256,
    _future_gamma: uint256,
    _future_time: uint256,
):
    """
    @dev A far-future `_future_time` overflows the pool's ramp math. The pool then reverts on
         everything but balanced withdrawals, and no call can stop the ramp.
    """
    self._check_authorized()
    amm._ramp_A_gamma(_pool, _future_A, _future_gamma, _future_time)


@external
def stop_ramp_A_gamma(_pool: amm.ICryptoPool):
    self._check_authorized()
    amm._stop_ramp_A_gamma(_pool)


@external
def apply_new_parameters(
    _pool: amm.ICryptoPool,
    _new_mid_fee: uint256,
    _new_out_fee: uint256,
    _new_fee_gamma: uint256,
    _new_allowed_extra_profit: uint256,
    _new_adjustment_step: uint256,
    _new_ma_time: uint256,
):
    """
    @notice Set the parameters of a crypto pool that takes six of them.
    @dev The newest TwoCrypto pools read the fourth and fifth values as the minimum and maximum
         adjustment step, and a policy contract can override their fees: see reset_policy.
         A Tricrypto pool that commits parameters with a delay accepts this call and ignores it:
         use commit_new_parameters there.
    """
    self._check_authorized()
    amm._apply_new_parameters(
        _pool,
        _new_mid_fee,
        _new_out_fee,
        _new_fee_gamma,
        _new_allowed_extra_profit,
        _new_adjustment_step,
        _new_ma_time,
    )


@external
def apply_new_parameters_xcp(
    _pool: amm.ICryptoPoolXcp,
    _new_mid_fee: uint256,
    _new_out_fee: uint256,
    _new_fee_gamma: uint256,
    _new_allowed_extra_profit: uint256,
    _new_adjustment_step: uint256,
    _new_ma_time: uint256,
    _new_xcp_ma_time: uint256,
):
    """
    @notice Set the parameters of a crypto pool that takes seven of them.
    """
    self._check_authorized()
    amm._apply_new_parameters_xcp(
        _pool,
        _new_mid_fee,
        _new_out_fee,
        _new_fee_gamma,
        _new_allowed_extra_profit,
        _new_adjustment_step,
        _new_ma_time,
        _new_xcp_ma_time,
    )


@external
def commit_new_parameters(
    _pool: amm.ICryptoPool,
    _new_mid_fee: uint256,
    _new_out_fee: uint256,
    _new_fee_gamma: uint256,
    _new_allowed_extra_profit: uint256,
    _new_adjustment_step: uint256,
    _new_ma_time: uint256,
):
    """
    @notice Commit the parameters of a Tricrypto pool that applies them after a delay.
    @dev Anyone can apply them on the pool once its delay has passed.
    """
    self._check_authorized()
    amm._commit_new_parameters(
        _pool,
        _new_mid_fee,
        _new_out_fee,
        _new_fee_gamma,
        _new_allowed_extra_profit,
        _new_adjustment_step,
        _new_ma_time,
    )


@external
def revert_new_parameters(_pool: amm.ICryptoPool):
    self._check_authorized()
    amm._revert_new_parameters(_pool)


@external
def reset_policy(_pool: amm.ICryptoPool):
    self._check_authorized()
    amm._reset_policy(_pool)


################################################################
#                    LENDING PROXY METHODS                     #
################################################################

@external
def set_callback(_controller: lending.ILendingController, _callback: address):
    self._check_authorized()
    lending._set_callback(_controller, _callback)


@external
def set_monetary_policy(_controller: lending.ILendingController, _policy: address):
    self._check_authorized()
    lending._set_monetary_policy(_controller, _policy)


@external
def increase_loan_discount(_controller: lending.ILendingController, _new_loan_discount: uint256):
    self._check_authorized()
    lending._increase_loan_discount(_controller, _new_loan_discount)


@external
def reduce_debt_ceiling(_factory: lending.IDebtCeilingFactory, _to: address, _amount: uint256):
    self._check_authorized()
    lending._reduce_debt_ceiling(_factory, _to, _amount)


@external
def set_use_chainlink(_oracle: lending.IChainlinkOracle, _do_it: bool):
    self._check_authorized()
    lending._set_use_chainlink(_oracle, _do_it)


@external
def set_v2_monetary_policy(_controller: lending.IV2Controller, _policy: address):
    self._check_authorized()
    lending._set_v2_monetary_policy(_controller, _policy)


@external
def increase_v2_loan_discount(_controller: lending.IV2Controller, _new_loan_discount: uint256):
    self._check_authorized()
    lending._increase_v2_loan_discount(_controller, _new_loan_discount)


@external
def set_v2_price_oracle(
    _controller: lending.IV2Controller,
    _price_oracle: address,
    _max_deviation: uint256,
):
    """
    @notice Replace the price oracle of an LLv2 market whose oracle fails
    @dev The current oracle fails if price() or price_w() reverts or returns zero; the new one must
         pass. Both are checked directly: for two minutes after a trade the AMM limits price moves,
         so it can show a zero price as nonzero, or a working oracle as zero.
    @param _max_deviation Passed to the Configurator; use max_value(uint256) when the old price() fails
    """
    self._check_authorized()
    lending._set_v2_price_oracle(_controller, _price_oracle, _max_deviation)


@external
def set_v2_callback(_controller: lending.IV2Controller, _callback: address):
    self._check_authorized()
    lending._set_v2_callback(_controller, _callback)


@external
def remove_v2_custom_admin(_controller: lending.IV2Controller):
    """
    @notice Revoke an LLv2 market's custom admin; the market keeps only the default admin
    @dev There is no admin argument: this can only clear a custom admin, never set one.
    """
    self._check_authorized()
    lending._remove_v2_custom_admin(_controller)


@external
def set_v2_borrow_cap_zero(_controller: lending.IV2Controller):
    self._check_authorized()
    lending._set_v2_borrow_cap_zero(_controller)


@external
def set_v2_max_supply_zero(_vault: lending.IVault):
    self._check_authorized()
    lending._set_v2_max_supply_zero(_vault)


@external
def pause(_target: lending.IPausable):
    self._check_authorized()
    lending._pause(_target)


################################################################
#                   CONTROLLER PROXY METHODS                   #
################################################################

@external
def set_permission(_controller: address, _target: address, _selector: bytes4, _allowed: bool):
    """
    @notice Let `_controller` call the method `_selector` on `_target` through `forward`, or stop it.
    @dev Each grant covers one controller, target and method, and each call changes one grant.
         Only the DAO grants. The emergency DAO and the controller itself can revoke.
    """
    # The DAO grants and revokes. The emergency DAO can withdraw any grant at once, and a controller
    # can give up one it no longer needs.
    assert msg.sender == self.dao or (
        _allowed == False and msg.sender in [self.emergency_dao, _controller]
    ), "Unauthorized"
    self.permissions[_controller][_target][_selector] = _allowed
    log PermissionSet(controller=_controller, target=_target, selector=_selector, allowed=_allowed)


@external
def forward(_target: address, _calldata: Bytes[MAX_CALLDATA_SIZE]) -> Bytes[MAX_OUTSIZE]:
    """
    @notice Make a call the DAO permitted the caller to make.
    @dev The arguments are the controller's: a permitted method can be called with any values.
    """
    selector: bytes4 = convert(slice(_calldata, 0, 4), bytes4)
    assert self.permissions[msg.sender][_target][selector], "Unauthorized"
    return raw_call(_target, _calldata, max_outsize=MAX_OUTSIZE)


################################################################
#                    GENERIC PROXY METHODS                     #
################################################################

@external
@payable
def execute(_target: address, _calldata: Bytes[MAX_CALLDATA_SIZE]) -> Bytes[MAX_OUTSIZE]:
    assert msg.sender == self.dao, "Only DAO"
    return raw_call(_target, _calldata, value=msg.value, max_outsize=MAX_OUTSIZE)


@external
def accept_transfer_ownership(_factory: address):
    extcall IOwnable(_factory).accept_transfer_ownership()


@external
def commit_transfer_dao(_future_dao: address):
    """
    @notice Nominate a new DAO; pass zero to cancel a pending handover.
    @dev The proxy itself is refused: through execute it could accept, and no governance caller would
         remain.
    """
    assert msg.sender == self.dao, "Only DAO"
    assert _future_dao != self, "Proxy cannot be its own DAO"
    self.future_dao = _future_dao
    log DAOCommitted(current=self.dao, future=_future_dao)


@external
def accept_transfer_dao():
    future_dao: address = self.future_dao
    assert future_dao != empty(address) and msg.sender == future_dao, "Only future DAO"
    log DAOSet(previous=self.dao, current=future_dao)
    self.dao = future_dao
    self.future_dao = empty(address)


@external
def set_emergency_dao(_new_emergency_dao: address):
    assert msg.sender == self.dao, "Only DAO"
    self._set_emergency_dao(_new_emergency_dao)


@external
def remove_emergency():
    self._check_authorized()
    self._set_emergency_dao(empty(address))

modules/amm.vy

# pragma version 0.4.3

"""
@title AMM calls
@notice The calls behind the proxy's pool methods. The proxy checks the caller first; each pool applies
        its own limits to the values.
"""


################################################################
#                          INTERFACES                          #
################################################################

interface IStablePool:
    def ramp_A(_future_A: uint256, _future_time: uint256): nonpayable
    def stop_ramp_A(): nonpayable
    def set_new_fee(_new_fee: uint256, _new_offpeg_fee_multiplier: uint256): nonpayable
    def set_ma_exp_time(_ma_exp_time: uint256, _D_ma_time: uint256): nonpayable


interface ICryptoPool:
    def ramp_A_gamma(_future_A: uint256, _future_gamma: uint256, _future_time: uint256): nonpayable
    def stop_ramp_A_gamma(): nonpayable
    def apply_new_parameters(
        _new_mid_fee: uint256,
        _new_out_fee: uint256,
        _new_fee_gamma: uint256,
        _new_allowed_extra_profit: uint256,
        _new_adjustment_step: uint256,
        _new_ma_time: uint256,
    ): nonpayable
    def commit_new_parameters(
        _new_mid_fee: uint256,
        _new_out_fee: uint256,
        _new_fee_gamma: uint256,
        _new_allowed_extra_profit: uint256,
        _new_adjustment_step: uint256,
        _new_ma_time: uint256,
    ): nonpayable
    def revert_new_parameters(): nonpayable
    def set_policy_contract(_policy: address): nonpayable


interface ICryptoPoolXcp:
    def apply_new_parameters(
        _new_mid_fee: uint256,
        _new_out_fee: uint256,
        _new_fee_gamma: uint256,
        _new_allowed_extra_profit: uint256,
        _new_adjustment_step: uint256,
        _new_ma_time: uint256,
        _new_xcp_ma_time: uint256,
    ): nonpayable


################################################################
#                      INTERNAL FUNCTIONS                      #
################################################################

@internal
def _ramp_A(_pool: IStablePool, _future_A: uint256, _future_time: uint256):
    extcall _pool.ramp_A(_future_A, _future_time)


@internal
def _stop_ramp_A(_pool: IStablePool):
    extcall _pool.stop_ramp_A()


@internal
def _set_new_fee(_pool: IStablePool, _new_fee: uint256, _new_offpeg_fee_multiplier: uint256):
    extcall _pool.set_new_fee(_new_fee, _new_offpeg_fee_multiplier)


@internal
def _set_ma_exp_time(_pool: IStablePool, _ma_exp_time: uint256, _D_ma_time: uint256):
    extcall _pool.set_ma_exp_time(_ma_exp_time, _D_ma_time)


@internal
def _ramp_A_gamma(
    _pool: ICryptoPool,
    _future_A: uint256,
    _future_gamma: uint256,
    _future_time: uint256,
):
    extcall _pool.ramp_A_gamma(_future_A, _future_gamma, _future_time)


@internal
def _stop_ramp_A_gamma(_pool: ICryptoPool):
    extcall _pool.stop_ramp_A_gamma()


@internal
def _apply_new_parameters(
    _pool: ICryptoPool,
    _new_mid_fee: uint256,
    _new_out_fee: uint256,
    _new_fee_gamma: uint256,
    _new_allowed_extra_profit: uint256,
    _new_adjustment_step: uint256,
    _new_ma_time: uint256,
):
    extcall _pool.apply_new_parameters(
        _new_mid_fee,
        _new_out_fee,
        _new_fee_gamma,
        _new_allowed_extra_profit,
        _new_adjustment_step,
        _new_ma_time,
    )


@internal
def _apply_new_parameters_xcp(
    _pool: ICryptoPoolXcp,
    _new_mid_fee: uint256,
    _new_out_fee: uint256,
    _new_fee_gamma: uint256,
    _new_allowed_extra_profit: uint256,
    _new_adjustment_step: uint256,
    _new_ma_time: uint256,
    _new_xcp_ma_time: uint256,
):
    extcall _pool.apply_new_parameters(
        _new_mid_fee,
        _new_out_fee,
        _new_fee_gamma,
        _new_allowed_extra_profit,
        _new_adjustment_step,
        _new_ma_time,
        _new_xcp_ma_time,
    )


@internal
def _commit_new_parameters(
    _pool: ICryptoPool,
    _new_mid_fee: uint256,
    _new_out_fee: uint256,
    _new_fee_gamma: uint256,
    _new_allowed_extra_profit: uint256,
    _new_adjustment_step: uint256,
    _new_ma_time: uint256,
):
    extcall _pool.commit_new_parameters(
        _new_mid_fee,
        _new_out_fee,
        _new_fee_gamma,
        _new_allowed_extra_profit,
        _new_adjustment_step,
        _new_ma_time,
    )


@internal
def _revert_new_parameters(_pool: ICryptoPool):
    extcall _pool.revert_new_parameters()


@internal
def _reset_policy(_pool: ICryptoPool):
    extcall _pool.set_policy_contract(empty(address))

modules/gauges.vy

# pragma version 0.4.3

"""
@title Gauge calls
@notice The calls behind the proxy's gauge methods. The proxy checks the caller first.
"""


################################################################
#                          INTERFACES                          #
################################################################

interface IChildGaugeFactory:
    def is_valid_gauge(_gauge: address) -> bool: view


interface IGauge:
    def factory() -> address: view
    def manager() -> address: view
    def set_manager(_manager: address): nonpayable
    def set_killed(_is_killed: bool): nonpayable
    def set_reward_invalidated(_reward_token: address, _invalidated: bool): nonpayable


################################################################
#                      INTERNAL FUNCTIONS                      #
################################################################

@internal
def _set_gauge_manager(_gauge: IGauge, _manager: address):
    success: bool = raw_call(
        _gauge.address, abi_encode(_manager, method_id=method_id("set_gauge_manager(address)")),
        revert_on_failure=False,
    )
    if not success:
        # Legacy child gauges only expose set_manager. Check membership before using it.
        factory: address = staticcall _gauge.factory()
        assert staticcall IChildGaugeFactory(factory).is_valid_gauge(_gauge.address), "Unknown child gauge"
        extcall _gauge.set_manager(_manager)
    assert staticcall _gauge.manager() == _manager, "Manager not set"


@internal
def _set_killed(_gauge: IGauge):
    extcall _gauge.set_killed(True)


@internal
def _set_reward_invalidated(_gauge: IGauge, _reward_token: address, _invalidated: bool):
    extcall _gauge.set_reward_invalidated(_reward_token, _invalidated)

modules/lending.vy

# pragma version 0.4.3

"""
@title Lending calls
@notice The calls behind the proxy's lending methods, with the limits the emergency DAO is held to.
        The proxy checks the caller first.
"""


################################################################
#                          INTERFACES                          #
################################################################

interface IDebtCeilingFactory:
    def debt_ceiling(_to: address) -> uint256: view
    def set_debt_ceiling(_to: address, _amount: uint256): nonpayable


interface IConfigurator:
    def set_custom_admin(_controller: address, _admin: address): nonpayable
    def set_borrowing_discounts(_controller: address, _loan_discount: uint256, _liquidation_discount: uint256): nonpayable
    def set_monetary_policy(_controller: address, _policy: address): nonpayable
    def set_borrow_cap(_controller: address, _cap: uint256): nonpayable
    def set_callback(_controller: address, _callback: address): nonpayable
    def set_price_oracle(_controller: address, _price_oracle: address, _max_deviation: uint256): nonpayable


# An LLv1 or crvUSD mint controller, administered directly by its factory's admin.
interface ILendingController:
    def loan_discount() -> uint256: view
    def liquidation_discount() -> uint256: view
    def set_callback(_callback: address): nonpayable
    def set_monetary_policy(_policy: address): nonpayable
    def set_borrowing_discounts(_loan_discount: uint256, _liquidation_discount: uint256): nonpayable


# An LLv2 controller, administered through the Configurator it names.
interface IV2Controller:
    def configurator() -> IConfigurator: view
    def amm() -> address: view
    def loan_discount() -> uint256: view
    def liquidation_discount() -> uint256: view


interface IAMM:
    def price_oracle_contract() -> address: view


interface IVault:
    def set_max_supply(_max_supply: uint256): nonpayable


interface IPausable:
    def pause(): nonpayable


interface IChainlinkOracle:
    def set_use_chainlink(_do_it: bool): nonpayable


################################################################
#                          CONSTANTS                           #
################################################################

# Gas given to each oracle check. A call that fails within it counts as broken.
PROBE_GAS: constant(uint256) = 2_000_000
# A call receives at most 63/64 of the remaining gas, so this much must be left to pass PROBE_GAS.
PROBE_GAS_FLOOR: constant(uint256) = 2_100_000


################################################################
#                      INTERNAL FUNCTIONS                      #
################################################################

@internal
def _price_works(_oracle: address) -> bool:
    # price() is called statically, as the AMM calls it; both must return a nonzero uint256.
    success: bool = False
    response: Bytes[32] = b""

    assert msg.gas >= PROBE_GAS_FLOOR, "Not enough gas to probe"
    success, response = raw_call(_oracle, method_id("price()"), max_outsize=32, gas=PROBE_GAS,
                                 is_static_call=True, revert_on_failure=False)
    if not success or len(response) < 32 or convert(response, uint256) == 0:
        return False

    assert msg.gas >= PROBE_GAS_FLOOR, "Not enough gas to probe"
    success, response = raw_call(_oracle, method_id("price_w()"), max_outsize=32, gas=PROBE_GAS,
                                 revert_on_failure=False)
    return success and len(response) == 32 and convert(response, uint256) != 0


@internal
def _set_callback(_controller: ILendingController, _callback: address):
    extcall _controller.set_callback(_callback)


@internal
def _set_monetary_policy(_controller: ILendingController, _policy: address):
    extcall _controller.set_monetary_policy(_policy)


@internal
def _increase_loan_discount(_controller: ILendingController, _new_loan_discount: uint256):
    assert _new_loan_discount > staticcall _controller.loan_discount(), "Can only increase loan discount"
    extcall _controller.set_borrowing_discounts(
        _new_loan_discount, staticcall _controller.liquidation_discount()
    )


@internal
def _reduce_debt_ceiling(_factory: IDebtCeilingFactory, _to: address, _amount: uint256):
    assert _amount <= staticcall _factory.debt_ceiling(_to), "Can only reduce debt ceiling"
    extcall _factory.set_debt_ceiling(_to, _amount)


@internal
def _set_use_chainlink(_oracle: IChainlinkOracle, _do_it: bool):
    extcall _oracle.set_use_chainlink(_do_it)


@internal
def _set_v2_monetary_policy(_controller: IV2Controller, _policy: address):
    configurator: IConfigurator = staticcall _controller.configurator()
    extcall configurator.set_monetary_policy(_controller.address, _policy)


@internal
def _increase_v2_loan_discount(_controller: IV2Controller, _new_loan_discount: uint256):
    assert _new_loan_discount > staticcall _controller.loan_discount(), "Can only increase loan discount"
    configurator: IConfigurator = staticcall _controller.configurator()
    extcall configurator.set_borrowing_discounts(
        _controller.address, _new_loan_discount, staticcall _controller.liquidation_discount()
    )


@internal
def _set_v2_price_oracle(
    _controller: IV2Controller,
    _price_oracle: address,
    _max_deviation: uint256,
):
    amm: IAMM = IAMM(staticcall _controller.amm())
    assert not self._price_works(staticcall amm.price_oracle_contract()), "Oracle works"
    configurator: IConfigurator = staticcall _controller.configurator()
    extcall configurator.set_price_oracle(_controller.address, _price_oracle, _max_deviation)
    assert self._price_works(_price_oracle), "New oracle fails"


@internal
def _set_v2_callback(_controller: IV2Controller, _callback: address):
    configurator: IConfigurator = staticcall _controller.configurator()
    extcall configurator.set_callback(_controller.address, _callback)


@internal
def _remove_v2_custom_admin(_controller: IV2Controller):
    configurator: IConfigurator = staticcall _controller.configurator()
    extcall configurator.set_custom_admin(_controller.address, empty(address))


@internal
def _set_v2_borrow_cap_zero(_controller: IV2Controller):
    configurator: IConfigurator = staticcall _controller.configurator()
    extcall configurator.set_borrow_cap(_controller.address, 0)


@internal
def _set_v2_max_supply_zero(_vault: IVault):
    extcall _vault.set_max_supply(0)


@internal
def _pause(_target: IPausable):
    extcall _target.pause()
Compiler settingsShow
{
  "search_paths": [
    "."
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.