mirror of
https://github.com/th30d4y/OpenLearnX.git
synced 2026-05-27 19:56:29 +00:00
Fix .gitignore: stop tracking ignored files
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC1155/IERC1155.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155MetadataURI.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC1155/extensions/IERC1155MetadataURI.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155Receiver.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC1155/IERC1155Receiver.sol";
|
||||
@@ -0,0 +1,19 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev Interface of the ERC1271 standard signature validation method for
|
||||
* contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
|
||||
*
|
||||
* _Available since v4.1._
|
||||
*/
|
||||
interface IERC1271 {
|
||||
/**
|
||||
* @dev Should return whether the signature provided is valid for the provided data
|
||||
* @param hash Hash of the data to be signed
|
||||
* @param signature Signature byte array associated with _data
|
||||
*/
|
||||
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1363.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "./IERC20.sol";
|
||||
import "./IERC165.sol";
|
||||
|
||||
/**
|
||||
* @dev Interface of an ERC1363 compliant contract, as defined in the
|
||||
* https://eips.ethereum.org/EIPS/eip-1363[EIP].
|
||||
*
|
||||
* Defines a interface for ERC20 tokens that supports executing recipient
|
||||
* code after `transfer` or `transferFrom`, or spender code after `approve`.
|
||||
*/
|
||||
interface IERC1363 is IERC165, IERC20 {
|
||||
/*
|
||||
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
|
||||
* 0xb0202a11 ===
|
||||
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
|
||||
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
|
||||
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
|
||||
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
|
||||
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
|
||||
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
|
||||
*/
|
||||
|
||||
/**
|
||||
* @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
|
||||
* @param to address The address which you want to transfer to
|
||||
* @param amount uint256 The amount of tokens to be transferred
|
||||
* @return true unless throwing
|
||||
*/
|
||||
function transferAndCall(address to, uint256 amount) external returns (bool);
|
||||
|
||||
/**
|
||||
* @dev Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
|
||||
* @param to address The address which you want to transfer to
|
||||
* @param amount uint256 The amount of tokens to be transferred
|
||||
* @param data bytes Additional data with no specified format, sent in call to `to`
|
||||
* @return true unless throwing
|
||||
*/
|
||||
function transferAndCall(address to, uint256 amount, bytes memory data) external returns (bool);
|
||||
|
||||
/**
|
||||
* @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver
|
||||
* @param from address The address which you want to send tokens from
|
||||
* @param to address The address which you want to transfer to
|
||||
* @param amount uint256 The amount of tokens to be transferred
|
||||
* @return true unless throwing
|
||||
*/
|
||||
function transferFromAndCall(address from, address to, uint256 amount) external returns (bool);
|
||||
|
||||
/**
|
||||
* @dev Transfer tokens from one address to another and then call `onTransferReceived` on receiver
|
||||
* @param from address The address which you want to send tokens from
|
||||
* @param to address The address which you want to transfer to
|
||||
* @param amount uint256 The amount of tokens to be transferred
|
||||
* @param data bytes Additional data with no specified format, sent in call to `to`
|
||||
* @return true unless throwing
|
||||
*/
|
||||
function transferFromAndCall(address from, address to, uint256 amount, bytes memory data) external returns (bool);
|
||||
|
||||
/**
|
||||
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
|
||||
* and then call `onApprovalReceived` on spender.
|
||||
* @param spender address The address which will spend the funds
|
||||
* @param amount uint256 The amount of tokens to be spent
|
||||
*/
|
||||
function approveAndCall(address spender, uint256 amount) external returns (bool);
|
||||
|
||||
/**
|
||||
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
|
||||
* and then call `onApprovalReceived` on spender.
|
||||
* @param spender address The address which will spend the funds
|
||||
* @param amount uint256 The amount of tokens to be spent
|
||||
* @param data bytes Additional data with no specified format, sent in call to `spender`
|
||||
*/
|
||||
function approveAndCall(address spender, uint256 amount, bytes memory data) external returns (bool);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1363Receiver.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev Interface for any contract that wants to support {IERC1363-transferAndCall}
|
||||
* or {IERC1363-transferFromAndCall} from {ERC1363} token contracts.
|
||||
*/
|
||||
interface IERC1363Receiver {
|
||||
/*
|
||||
* Note: the ERC-165 identifier for this interface is 0x88a7ca5c.
|
||||
* 0x88a7ca5c === bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))
|
||||
*/
|
||||
|
||||
/**
|
||||
* @notice Handle the receipt of ERC1363 tokens
|
||||
* @dev Any ERC1363 smart contract calls this function on the recipient
|
||||
* after a `transfer` or a `transferFrom`. This function MAY throw to revert and reject the
|
||||
* transfer. Return of other than the magic value MUST result in the
|
||||
* transaction being reverted.
|
||||
* Note: the token contract address is always the message sender.
|
||||
* @param operator address The address which called `transferAndCall` or `transferFromAndCall` function
|
||||
* @param from address The address which are token transferred from
|
||||
* @param amount uint256 The amount of tokens transferred
|
||||
* @param data bytes Additional data with no specified format
|
||||
* @return `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))` unless throwing
|
||||
*/
|
||||
function onTransferReceived(
|
||||
address operator,
|
||||
address from,
|
||||
uint256 amount,
|
||||
bytes memory data
|
||||
) external returns (bytes4);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1363Spender.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev Interface for any contract that wants to support {IERC1363-approveAndCall}
|
||||
* from {ERC1363} token contracts.
|
||||
*/
|
||||
interface IERC1363Spender {
|
||||
/*
|
||||
* Note: the ERC-165 identifier for this interface is 0x7b04a2d0.
|
||||
* 0x7b04a2d0 === bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))
|
||||
*/
|
||||
|
||||
/**
|
||||
* @notice Handle the approval of ERC1363 tokens
|
||||
* @dev Any ERC1363 smart contract calls this function on the recipient
|
||||
* after an `approve`. This function MAY throw to revert and reject the
|
||||
* approval. Return of other than the magic value MUST result in the
|
||||
* transaction being reverted.
|
||||
* Note: the token contract address is always the message sender.
|
||||
* @param owner address The address which called `approveAndCall` function
|
||||
* @param amount uint256 The amount of tokens to be spent
|
||||
* @param data bytes Additional data with no specified format
|
||||
* @return `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))`unless throwing
|
||||
*/
|
||||
function onApprovalReceived(address owner, uint256 amount, bytes memory data) external returns (bytes4);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../utils/introspection/IERC165.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Implementer.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../utils/introspection/IERC1820Implementer.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Registry.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../utils/introspection/IERC1820Registry.sol";
|
||||
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
|
||||
*
|
||||
* _Available since v4.8.3._
|
||||
*/
|
||||
interface IERC1967 {
|
||||
/**
|
||||
* @dev Emitted when the implementation is upgraded.
|
||||
*/
|
||||
event Upgraded(address indexed implementation);
|
||||
|
||||
/**
|
||||
* @dev Emitted when the admin account has changed.
|
||||
*/
|
||||
event AdminChanged(address previousAdmin, address newAdmin);
|
||||
|
||||
/**
|
||||
* @dev Emitted when the beacon is changed.
|
||||
*/
|
||||
event BeaconUpgraded(address indexed beacon);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC20/IERC20.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20Metadata.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC20/extensions/IERC20Metadata.sol";
|
||||
@@ -0,0 +1,21 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.8.0) (interfaces/IERC2309.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev ERC-2309: ERC-721 Consecutive Transfer Extension.
|
||||
*
|
||||
* _Available since v4.8._
|
||||
*/
|
||||
interface IERC2309 {
|
||||
/**
|
||||
* @dev Emitted when the tokens from `fromTokenId` to `toTokenId` are transferred from `fromAddress` to `toAddress`.
|
||||
*/
|
||||
event ConsecutiveTransfer(
|
||||
uint256 indexed fromTokenId,
|
||||
uint256 toTokenId,
|
||||
address indexed fromAddress,
|
||||
address indexed toAddress
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2612.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC20/extensions/IERC20Permit.sol";
|
||||
|
||||
interface IERC2612 is IERC20Permit {}
|
||||
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../utils/introspection/IERC165.sol";
|
||||
|
||||
/**
|
||||
* @dev Interface for the NFT Royalty Standard.
|
||||
*
|
||||
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
|
||||
* support for royalty payments across all NFT marketplaces and ecosystem participants.
|
||||
*
|
||||
* _Available since v4.5._
|
||||
*/
|
||||
interface IERC2981 is IERC165 {
|
||||
/**
|
||||
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
|
||||
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
|
||||
*/
|
||||
function royaltyInfo(
|
||||
uint256 tokenId,
|
||||
uint256 salePrice
|
||||
) external view returns (address receiver, uint256 royaltyAmount);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "./IERC3156FlashBorrower.sol";
|
||||
import "./IERC3156FlashLender.sol";
|
||||
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC3156FlashBorrower.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev Interface of the ERC3156 FlashBorrower, as defined in
|
||||
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
|
||||
*
|
||||
* _Available since v4.1._
|
||||
*/
|
||||
interface IERC3156FlashBorrower {
|
||||
/**
|
||||
* @dev Receive a flash loan.
|
||||
* @param initiator The initiator of the loan.
|
||||
* @param token The loan currency.
|
||||
* @param amount The amount of tokens lent.
|
||||
* @param fee The additional amount of tokens to repay.
|
||||
* @param data Arbitrary data structure, intended to contain user-defined parameters.
|
||||
* @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan"
|
||||
*/
|
||||
function onFlashLoan(
|
||||
address initiator,
|
||||
address token,
|
||||
uint256 amount,
|
||||
uint256 fee,
|
||||
bytes calldata data
|
||||
) external returns (bytes32);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156FlashLender.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "./IERC3156FlashBorrower.sol";
|
||||
|
||||
/**
|
||||
* @dev Interface of the ERC3156 FlashLender, as defined in
|
||||
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
|
||||
*
|
||||
* _Available since v4.1._
|
||||
*/
|
||||
interface IERC3156FlashLender {
|
||||
/**
|
||||
* @dev The amount of currency available to be lended.
|
||||
* @param token The loan currency.
|
||||
* @return The amount of `token` that can be borrowed.
|
||||
*/
|
||||
function maxFlashLoan(address token) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @dev The fee to be charged for a given loan.
|
||||
* @param token The loan currency.
|
||||
* @param amount The amount of tokens lent.
|
||||
* @return The amount of `token` to be charged for the loan, on top of the returned principal.
|
||||
*/
|
||||
function flashFee(address token, uint256 amount) external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @dev Initiate a flash loan.
|
||||
* @param receiver The receiver of the tokens in the loan, and the receiver of the callback.
|
||||
* @param token The loan currency.
|
||||
* @param amount The amount of tokens lent.
|
||||
* @param data Arbitrary data structure, intended to contain user-defined parameters.
|
||||
*/
|
||||
function flashLoan(
|
||||
IERC3156FlashBorrower receiver,
|
||||
address token,
|
||||
uint256 amount,
|
||||
bytes calldata data
|
||||
) external returns (bool);
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4626.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC20/IERC20.sol";
|
||||
import "../token/ERC20/extensions/IERC20Metadata.sol";
|
||||
|
||||
/**
|
||||
* @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in
|
||||
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
|
||||
*
|
||||
* _Available since v4.7._
|
||||
*/
|
||||
interface IERC4626 is IERC20, IERC20Metadata {
|
||||
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
|
||||
|
||||
event Withdraw(
|
||||
address indexed sender,
|
||||
address indexed receiver,
|
||||
address indexed owner,
|
||||
uint256 assets,
|
||||
uint256 shares
|
||||
);
|
||||
|
||||
/**
|
||||
* @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
|
||||
*
|
||||
* - MUST be an ERC-20 token contract.
|
||||
* - MUST NOT revert.
|
||||
*/
|
||||
function asset() external view returns (address assetTokenAddress);
|
||||
|
||||
/**
|
||||
* @dev Returns the total amount of the underlying asset that is “managed” by Vault.
|
||||
*
|
||||
* - SHOULD include any compounding that occurs from yield.
|
||||
* - MUST be inclusive of any fees that are charged against assets in the Vault.
|
||||
* - MUST NOT revert.
|
||||
*/
|
||||
function totalAssets() external view returns (uint256 totalManagedAssets);
|
||||
|
||||
/**
|
||||
* @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
|
||||
* scenario where all the conditions are met.
|
||||
*
|
||||
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
|
||||
* - MUST NOT show any variations depending on the caller.
|
||||
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
|
||||
* - MUST NOT revert.
|
||||
*
|
||||
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
|
||||
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
|
||||
* from.
|
||||
*/
|
||||
function convertToShares(uint256 assets) external view returns (uint256 shares);
|
||||
|
||||
/**
|
||||
* @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
|
||||
* scenario where all the conditions are met.
|
||||
*
|
||||
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
|
||||
* - MUST NOT show any variations depending on the caller.
|
||||
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
|
||||
* - MUST NOT revert.
|
||||
*
|
||||
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
|
||||
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
|
||||
* from.
|
||||
*/
|
||||
function convertToAssets(uint256 shares) external view returns (uint256 assets);
|
||||
|
||||
/**
|
||||
* @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
|
||||
* through a deposit call.
|
||||
*
|
||||
* - MUST return a limited value if receiver is subject to some deposit limit.
|
||||
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
|
||||
* - MUST NOT revert.
|
||||
*/
|
||||
function maxDeposit(address receiver) external view returns (uint256 maxAssets);
|
||||
|
||||
/**
|
||||
* @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
|
||||
* current on-chain conditions.
|
||||
*
|
||||
* - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
|
||||
* call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
|
||||
* in the same transaction.
|
||||
* - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
|
||||
* deposit would be accepted, regardless if the user has enough tokens approved, etc.
|
||||
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
|
||||
* - MUST NOT revert.
|
||||
*
|
||||
* NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
|
||||
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
|
||||
*/
|
||||
function previewDeposit(uint256 assets) external view returns (uint256 shares);
|
||||
|
||||
/**
|
||||
* @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
|
||||
*
|
||||
* - MUST emit the Deposit event.
|
||||
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
|
||||
* deposit execution, and are accounted for during deposit.
|
||||
* - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
|
||||
* approving enough underlying tokens to the Vault contract, etc).
|
||||
*
|
||||
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
|
||||
*/
|
||||
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
|
||||
|
||||
/**
|
||||
* @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
|
||||
* - MUST return a limited value if receiver is subject to some mint limit.
|
||||
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
|
||||
* - MUST NOT revert.
|
||||
*/
|
||||
function maxMint(address receiver) external view returns (uint256 maxShares);
|
||||
|
||||
/**
|
||||
* @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
|
||||
* current on-chain conditions.
|
||||
*
|
||||
* - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
|
||||
* in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
|
||||
* same transaction.
|
||||
* - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
|
||||
* would be accepted, regardless if the user has enough tokens approved, etc.
|
||||
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
|
||||
* - MUST NOT revert.
|
||||
*
|
||||
* NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
|
||||
* share price or some other type of condition, meaning the depositor will lose assets by minting.
|
||||
*/
|
||||
function previewMint(uint256 shares) external view returns (uint256 assets);
|
||||
|
||||
/**
|
||||
* @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
|
||||
*
|
||||
* - MUST emit the Deposit event.
|
||||
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
|
||||
* execution, and are accounted for during mint.
|
||||
* - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
|
||||
* approving enough underlying tokens to the Vault contract, etc).
|
||||
*
|
||||
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
|
||||
*/
|
||||
function mint(uint256 shares, address receiver) external returns (uint256 assets);
|
||||
|
||||
/**
|
||||
* @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
|
||||
* Vault, through a withdraw call.
|
||||
*
|
||||
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
|
||||
* - MUST NOT revert.
|
||||
*/
|
||||
function maxWithdraw(address owner) external view returns (uint256 maxAssets);
|
||||
|
||||
/**
|
||||
* @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
|
||||
* given current on-chain conditions.
|
||||
*
|
||||
* - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
|
||||
* call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
|
||||
* called
|
||||
* in the same transaction.
|
||||
* - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
|
||||
* the withdrawal would be accepted, regardless if the user has enough shares, etc.
|
||||
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
|
||||
* - MUST NOT revert.
|
||||
*
|
||||
* NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
|
||||
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
|
||||
*/
|
||||
function previewWithdraw(uint256 assets) external view returns (uint256 shares);
|
||||
|
||||
/**
|
||||
* @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
|
||||
*
|
||||
* - MUST emit the Withdraw event.
|
||||
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
|
||||
* withdraw execution, and are accounted for during withdraw.
|
||||
* - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
|
||||
* not having enough shares, etc).
|
||||
*
|
||||
* Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
|
||||
* Those methods should be performed separately.
|
||||
*/
|
||||
function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);
|
||||
|
||||
/**
|
||||
* @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
|
||||
* through a redeem call.
|
||||
*
|
||||
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
|
||||
* - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
|
||||
* - MUST NOT revert.
|
||||
*/
|
||||
function maxRedeem(address owner) external view returns (uint256 maxShares);
|
||||
|
||||
/**
|
||||
* @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
|
||||
* given current on-chain conditions.
|
||||
*
|
||||
* - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
|
||||
* in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
|
||||
* same transaction.
|
||||
* - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
|
||||
* redemption would be accepted, regardless if the user has enough shares, etc.
|
||||
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
|
||||
* - MUST NOT revert.
|
||||
*
|
||||
* NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
|
||||
* share price or some other type of condition, meaning the depositor will lose assets by redeeming.
|
||||
*/
|
||||
function previewRedeem(uint256 shares) external view returns (uint256 assets);
|
||||
|
||||
/**
|
||||
* @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
|
||||
*
|
||||
* - MUST emit the Withdraw event.
|
||||
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
|
||||
* redeem execution, and are accounted for during redeem.
|
||||
* - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
|
||||
* not having enough shares, etc).
|
||||
*
|
||||
* NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
|
||||
* Those methods should be performed separately.
|
||||
*/
|
||||
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "./IERC165.sol";
|
||||
import "./IERC721.sol";
|
||||
|
||||
/// @title EIP-721 Metadata Update Extension
|
||||
interface IERC4906 is IERC165, IERC721 {
|
||||
/// @dev This event emits when the metadata of a token is changed.
|
||||
/// So that the third-party platforms such as NFT market could
|
||||
/// timely update the images and related attributes of the NFT.
|
||||
event MetadataUpdate(uint256 _tokenId);
|
||||
|
||||
/// @dev This event emits when the metadata of a range of tokens is changed.
|
||||
/// So that the third-party platforms such as NFT market could
|
||||
/// timely update the images and related attributes of the NFTs.
|
||||
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
interface IERC5267 {
|
||||
/**
|
||||
* @dev MAY be emitted to signal that the domain could have changed.
|
||||
*/
|
||||
event EIP712DomainChanged();
|
||||
|
||||
/**
|
||||
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
|
||||
* signature.
|
||||
*/
|
||||
function eip712Domain()
|
||||
external
|
||||
view
|
||||
returns (
|
||||
bytes1 fields,
|
||||
string memory name,
|
||||
string memory version,
|
||||
uint256 chainId,
|
||||
address verifyingContract,
|
||||
bytes32 salt,
|
||||
uint256[] memory extensions
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5313.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev Interface for the Light Contract Ownership Standard.
|
||||
*
|
||||
* A standardized minimal interface required to identify an account that controls a contract
|
||||
*
|
||||
* _Available since v4.9._
|
||||
*/
|
||||
interface IERC5313 {
|
||||
/**
|
||||
* @dev Gets the address of the owner.
|
||||
*/
|
||||
function owner() external view returns (address);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5805.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../governance/utils/IVotes.sol";
|
||||
import "./IERC6372.sol";
|
||||
|
||||
interface IERC5805 is IERC6372, IVotes {}
|
||||
@@ -0,0 +1,17 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC6372.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
interface IERC6372 {
|
||||
/**
|
||||
* @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).
|
||||
*/
|
||||
function clock() external view returns (uint48);
|
||||
|
||||
/**
|
||||
* @dev Description of the clock
|
||||
*/
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function CLOCK_MODE() external view returns (string memory);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC721/IERC721.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC721/extensions/IERC721Enumerable.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Metadata.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC721/extensions/IERC721Metadata.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC721/IERC721Receiver.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC777.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC777/IERC777.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Recipient.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC777/IERC777Recipient.sol";
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Sender.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "../token/ERC777/IERC777Sender.sol";
|
||||
@@ -0,0 +1,73 @@
|
||||
= Interfaces
|
||||
|
||||
[.readme-notice]
|
||||
NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/interfaces
|
||||
|
||||
== List of standardized interfaces
|
||||
These interfaces are available as `.sol` files, and also as compiler `.json` ABI files (through the npm package). These
|
||||
are useful to interact with third party contracts that implement them.
|
||||
|
||||
- {IERC20}
|
||||
- {IERC20Metadata}
|
||||
- {IERC165}
|
||||
- {IERC721}
|
||||
- {IERC721Receiver}
|
||||
- {IERC721Enumerable}
|
||||
- {IERC721Metadata}
|
||||
- {IERC777}
|
||||
- {IERC777Recipient}
|
||||
- {IERC777Sender}
|
||||
- {IERC1155}
|
||||
- {IERC1155Receiver}
|
||||
- {IERC1155MetadataURI}
|
||||
- {IERC1271}
|
||||
- {IERC1363}
|
||||
- {IERC1363Receiver}
|
||||
- {IERC1363Spender}
|
||||
- {IERC1820Implementer}
|
||||
- {IERC1820Registry}
|
||||
- {IERC1822Proxiable}
|
||||
- {IERC2612}
|
||||
- {IERC2981}
|
||||
- {IERC3156FlashLender}
|
||||
- {IERC3156FlashBorrower}
|
||||
- {IERC4626}
|
||||
- {IERC4906}
|
||||
- {IERC5267}
|
||||
- {IERC5313}
|
||||
- {IERC5805}
|
||||
- {IERC6372}
|
||||
|
||||
== Detailed ABI
|
||||
|
||||
{{IERC1271}}
|
||||
|
||||
{{IERC1363}}
|
||||
|
||||
{{IERC1363Receiver}}
|
||||
|
||||
{{IERC1363Spender}}
|
||||
|
||||
{{IERC1820Implementer}}
|
||||
|
||||
{{IERC1820Registry}}
|
||||
|
||||
{{IERC1822Proxiable}}
|
||||
|
||||
{{IERC2612}}
|
||||
|
||||
{{IERC2981}}
|
||||
|
||||
{{IERC3156FlashLender}}
|
||||
|
||||
{{IERC3156FlashBorrower}}
|
||||
|
||||
{{IERC4626}}
|
||||
|
||||
{{IERC5313}}
|
||||
|
||||
{{IERC5267}}
|
||||
|
||||
{{IERC5805}}
|
||||
|
||||
{{IERC6372}}
|
||||
@@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
/**
|
||||
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
|
||||
* proxy whose upgrades are fully controlled by the current implementation.
|
||||
*/
|
||||
interface IERC1822Proxiable {
|
||||
/**
|
||||
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
|
||||
* address.
|
||||
*
|
||||
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
|
||||
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
|
||||
* function revert if invoked through a proxy.
|
||||
*/
|
||||
function proxiableUUID() external view returns (bytes32);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/draft-IERC2612.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
// EIP-2612 is Final as of 2022-11-01. This file is deprecated.
|
||||
|
||||
import "./IERC2612.sol";
|
||||
Reference in New Issue
Block a user