all files / interfaces/ IFacadeAct.sol

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51                                                                                                     
// SPDX-License-Identifier: BlueOak-1.0.0
pragma solidity 0.8.17;
 
import "../p1/RToken.sol";
 
/**
 * @title IFacadeAct
 * @notice A calldata-preparer, useful to MEV searchers and off-chain bots looking to progress an
 *   RToken. 
 *
 * - @custom:static-call - Use ethers callStatic() in order to get result after update
v */
interface IFacadeAct {
    /// Returns the next call a keeper of MEV searcher should make in order to progress the system
    /// Returns zero bytes to indicate no action should be made
    /// @dev Don't actually execute this!
    /// @custom:static-call
    function getActCalldata(RTokenP1 rToken) external returns (address to, bytes memory calldata_);
 
    /// Claims rewards from all places they can accrue.
    function claimRewards(RTokenP1 rToken) external;
 
    /// To use this, call via callStatic.
    /// @return canStart true iff a recollateralization auction can be started
    /// @custom:static-call
    function canRunRecollateralizationAuctions(IBackingManager bm) external returns (bool canStart);
 
    /// To use this, call via callStatic.
    /// @return toStart The ERC20s that have auctions that can be started
    /// @custom:static-call
    function getRevenueAuctionERC20s(IRevenueTrader revenueTrader)
        external
        returns (IERC20[] memory toStart);
 
    /// To use this, first call:
    ///   - FacadeRead.auctionsSettleable(revenueTrader)
    ///   - getRevenueAuctionERC20s(revenueTrader)
    /// If either arrays returned are non-empty, then can call this function.
    /// Logic:
    ///   For each ERC20 in `toSettle`:
    ///     - Settle any open ERC20 trades
    ///   For each ERC20 in `toStart`:
    ///     - Transfer any revenue for that ERC20 from the backingManager to revenueTrader
    ///     - Call `revenueTrader.manageToken(ERC20)` to start an auction, if possible
    function runRevenueAuctions(
        IRevenueTrader revenueTrader,
        IERC20[] memory toSettle,
        IERC20[] memory toStart
    ) external;
}