Module IStrategy

Source
Expand description

Generated by the following Solidity interface…

interface IStrategy {
    error BalanceExceedsMaxTotalDeposits();
    error MaxPerDepositExceedsMax();
    error NewSharesZero();
    error OnlyStrategyManager();
    error OnlyUnderlyingToken();
    error TotalSharesExceedsMax();
    error WithdrawalAmountExceedsTotalDeposits();

    event ExchangeRateEmitted(uint256 rate);
    event StrategyTokenSet(address token, uint8 decimals);

    function deposit(address token, uint256 amount) external returns (uint256);
    function explanation() external view returns (string memory);
    function shares(address user) external view returns (uint256);
    function sharesToUnderlying(uint256 amountShares) external returns (uint256);
    function sharesToUnderlyingView(uint256 amountShares) external view returns (uint256);
    function totalShares() external view returns (uint256);
    function underlyingToShares(uint256 amountUnderlying) external returns (uint256);
    function underlyingToSharesView(uint256 amountUnderlying) external view returns (uint256);
    function underlyingToken() external view returns (address);
    function userUnderlying(address user) external returns (uint256);
    function userUnderlyingView(address user) external view returns (uint256);
    function version() external view returns (string memory);
    function withdraw(address recipient, address token, uint256 amountShares) external;
}

…which was generated by the following JSON ABI:

[
  {
    "type": "function",
    "name": "deposit",
    "inputs": [
      {
        "name": "token",
        "type": "address",
        "internalType": "contract IERC20"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "explanation",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "shares",
    "inputs": [
      {
        "name": "user",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "sharesToUnderlying",
    "inputs": [
      {
        "name": "amountShares",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "sharesToUnderlyingView",
    "inputs": [
      {
        "name": "amountShares",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "totalShares",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "underlyingToShares",
    "inputs": [
      {
        "name": "amountUnderlying",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "underlyingToSharesView",
    "inputs": [
      {
        "name": "amountUnderlying",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "underlyingToken",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IERC20"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "userUnderlying",
    "inputs": [
      {
        "name": "user",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "userUnderlyingView",
    "inputs": [
      {
        "name": "user",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "version",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "string",
        "internalType": "string"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "withdraw",
    "inputs": [
      {
        "name": "recipient",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "token",
        "type": "address",
        "internalType": "contract IERC20"
      },
      {
        "name": "amountShares",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "ExchangeRateEmitted",
    "inputs": [
      {
        "name": "rate",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "StrategyTokenSet",
    "inputs": [
      {
        "name": "token",
        "type": "address",
        "indexed": false,
        "internalType": "contract IERC20"
      },
      {
        "name": "decimals",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "BalanceExceedsMaxTotalDeposits",
    "inputs": []
  },
  {
    "type": "error",
    "name": "MaxPerDepositExceedsMax",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NewSharesZero",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OnlyStrategyManager",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OnlyUnderlyingToken",
    "inputs": []
  },
  {
    "type": "error",
    "name": "TotalSharesExceedsMax",
    "inputs": []
  },
  {
    "type": "error",
    "name": "WithdrawalAmountExceedsTotalDeposits",
    "inputs": []
  }
]

Structs§

BalanceExceedsMaxTotalDeposits
Custom error with signature BalanceExceedsMaxTotalDeposits() and selector 0xd86bae67. solidity error BalanceExceedsMaxTotalDeposits();
ExchangeRateEmitted
Event with signature ExchangeRateEmitted(uint256) and selector 0xd2494f3479e5da49d386657c292c610b5b01df313d07c62eb0cfa49924a31be8. solidity event ExchangeRateEmitted(uint256 rate);
IStrategyInstance
A IStrategy instance.
MaxPerDepositExceedsMax
Custom error with signature MaxPerDepositExceedsMax() and selector 0x14ac1edc. solidity error MaxPerDepositExceedsMax();
NewSharesZero
Custom error with signature NewSharesZero() and selector 0x18725da6. solidity error NewSharesZero();
OnlyStrategyManager
Custom error with signature OnlyStrategyManager() and selector 0x48da714f. solidity error OnlyStrategyManager();
OnlyUnderlyingToken
Custom error with signature OnlyUnderlyingToken() and selector 0xc4aaf740. solidity error OnlyUnderlyingToken();
StrategyTokenSet
Event with signature StrategyTokenSet(address,uint8) and selector 0x1c540707b00eb5427b6b774fc799d756516a54aee108b64b327acc55af557507. solidity event StrategyTokenSet(address token, uint8 decimals);
TotalSharesExceedsMax
Custom error with signature TotalSharesExceedsMax() and selector 0x5e29d146. solidity error TotalSharesExceedsMax();
WithdrawalAmountExceedsTotalDeposits
Custom error with signature WithdrawalAmountExceedsTotalDeposits() and selector 0xb469df30. solidity error WithdrawalAmountExceedsTotalDeposits();
depositCall
Function with signature deposit(address,uint256) and selector 0x47e7ef24. solidity function deposit(address token, uint256 amount) external returns (uint256);
depositReturn
Container type for the return parameters of the deposit(address,uint256) function.
explanationCall
Function with signature explanation() and selector 0xab5921e1. solidity function explanation() external view returns (string memory);
explanationReturn
Container type for the return parameters of the explanation() function.
sharesCall
Function with signature shares(address) and selector 0xce7c2ac2. solidity function shares(address user) external view returns (uint256);
sharesReturn
Container type for the return parameters of the shares(address) function.
sharesToUnderlyingCall
Function with signature sharesToUnderlying(uint256) and selector 0xf3e73875. solidity function sharesToUnderlying(uint256 amountShares) external returns (uint256);
sharesToUnderlyingReturn
Container type for the return parameters of the sharesToUnderlying(uint256) function.
sharesToUnderlyingViewCall
Function with signature sharesToUnderlyingView(uint256) and selector 0x7a8b2637. solidity function sharesToUnderlyingView(uint256 amountShares) external view returns (uint256);
sharesToUnderlyingViewReturn
Container type for the return parameters of the sharesToUnderlyingView(uint256) function.
totalSharesCall
Function with signature totalShares() and selector 0x3a98ef39. solidity function totalShares() external view returns (uint256);
totalSharesReturn
Container type for the return parameters of the totalShares() function.
underlyingToSharesCall
Function with signature underlyingToShares(uint256) and selector 0x8c871019. solidity function underlyingToShares(uint256 amountUnderlying) external returns (uint256);
underlyingToSharesReturn
Container type for the return parameters of the underlyingToShares(uint256) function.
underlyingToSharesViewCall
Function with signature underlyingToSharesView(uint256) and selector 0xe3dae51c. solidity function underlyingToSharesView(uint256 amountUnderlying) external view returns (uint256);
underlyingToSharesViewReturn
Container type for the return parameters of the underlyingToSharesView(uint256) function.
underlyingTokenCall
Function with signature underlyingToken() and selector 0x2495a599. solidity function underlyingToken() external view returns (address);
underlyingTokenReturn
Container type for the return parameters of the underlyingToken() function.
userUnderlyingCall
Function with signature userUnderlying(address) and selector 0x8f6a6240. solidity function userUnderlying(address user) external returns (uint256);
userUnderlyingReturn
Container type for the return parameters of the userUnderlying(address) function.
userUnderlyingViewCall
Function with signature userUnderlyingView(address) and selector 0x553ca5f8. solidity function userUnderlyingView(address user) external view returns (uint256);
userUnderlyingViewReturn
Container type for the return parameters of the userUnderlyingView(address) function.
versionCall
Function with signature version() and selector 0x54fd4d50. solidity function version() external view returns (string memory);
versionReturn
Container type for the return parameters of the version() function.
withdrawCall
Function with signature withdraw(address,address,uint256) and selector 0xd9caed12. solidity function withdraw(address recipient, address token, uint256 amountShares) external;
withdrawReturn
Container type for the return parameters of the withdraw(address,address,uint256) function.

Enums§

IStrategyCalls
Container for all the IStrategy function calls.
IStrategyErrors
Container for all the IStrategy custom errors.
IStrategyEvents
Container for all the IStrategy events.

Statics§

BYTECODE
The creation / init bytecode of the contract.
DEPLOYED_BYTECODE
The runtime bytecode of the contract, as deployed on the network.

Functions§

deploy
Deploys this contract using the given provider and constructor arguments, if any.
deploy_builder
Creates a RawCallBuilder for deploying this contract using the given provider and constructor arguments, if any.
new
Creates a new wrapper around an on-chain IStrategy contract instance.