CompoundUSDCPortfolio
function DOMAIN_SEPARATOR() external view returns (bytes32)
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
function PERMIT_TYPEHASH() external view returns (bytes32)
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
function allowance(address, address) external view returns (uint256)
Name | Type | Description |
---|---|---|
_0 | address | undefined |
_1 | address | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function approve(address, uint256) external pure returns (bool)
transferFrom
disabled on Portfolio tokens.Name | Type | Description |
---|---|---|
_0 | address | undefined |
_1 | uint256 | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function asset() external view returns (address)
Name | Type | Description |
---|---|---|
_0 | address | undefined |
function authority() external view returns (contract RolesAuthority)
The contract used to source permissions for accounts targeting this contract.
Name | Type | Description |
---|---|---|
_0 | contract RolesAuthority | undefined |
function balanceOf(address) external view returns (uint256)
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function callAsPortfolio(address _target, uint256 _value, bytes _data) external payable returns (bytes)
Permissioned method that allows Endaoment admin to make arbitrary calls acting as this Portfolio.
Name | Type | Description |
---|---|---|
_target | address | The address to which the call will be made. |
_value | uint256 | The ETH value that should be forwarded with the call. |
_data | bytes | The calldata that will be sent with the call. |
Name | Type | Description |
---|---|---|
_0 | bytes | _return The data returned by the call. |
function cap() external view returns (uint256)
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function compoundExchangeRateCurrent() external view returns (uint256)
Returns the current Compound exchange rate.
Compound does not provide a way to get this data as a view method, so we implement it ourselves.
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function convertToAssets(uint256 _shares) external view returns (uint256)
The amount of assets that the Portfolio should exchange for the amount of shares provided.
Rounding down in both of these favors the portfolio, so the user gets slightly less and the portfolio gets slightly more, that way it prevents a situation where the user is owed x but the vault only has x - epsilon, where epsilon is some tiny number due to rounding error.
Name | Type | Description |
---|---|---|
_shares | uint256 | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function convertToShares(uint256 _assets) external view returns (uint256)
The amount of shares that the Portfolio should exchange for the amount of assets provided.
Rounding down in both of these favors the portfolio, so the user gets slightly less and the portfolio gets slightly more, that way it prevents a situation where the user is owed x but the vault only has x - epsilon, where epsilon is some tiny number due to rounding error.
Name | Type | Description |
---|---|---|
_assets | uint256 | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function convertToUsdc(uint256 _cUsdcAmount) external view returns (uint256)
Converts a quantity of cUSDC to USDC
Name | Type | Description |
---|---|---|
_cUsdcAmount | uint256 | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function cusdc() external view returns (contract ICErc20)
Name | Type | Description |
---|---|---|
_0 | contract ICErc20 | undefined |
function decimals() external view returns (uint8)
Name | Type | Description |
---|---|---|
_0 | uint8 | undefined |
function deposit(uint256 _amountBaseToken, bytes) external nonpayable returns (uint256)
Exchange
_amountBaseToken
for some amount of Portfolio shares.Deposit the specified number of base token assets, subtract a fee, and deposit into Compound. The
_data
parameter is unused.Name | Type | Description |
---|---|---|
_amountBaseToken | uint256 | The amount of the Entity's baseToken to deposit. |
_1 | bytes | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | The amount of shares that this deposit yields to the Entity. |
function depositFee() external view returns (uint256)
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function initialize(contract RolesAuthority _authority, bytes20 _specialTarget) external nonpayable
One time method to be called at deployment to configure the contract. Required so EndaomentAuth contracts can be deployed as minimal proxies (clones).
Name | Type | Description |
---|---|---|
_authority | contract RolesAuthority | Contract that will be used to source permissions for accounts targeting this contract. |
_specialTarget | bytes20 | The bytes that this contract will pass as the "target" when looking up permissions from the authority. If set to empty bytes, this contract will pass its own address instead. |
function name() external view returns (string)
Name | Type | Description |
---|---|---|
_0 | string | undefined |
function nonces(address) external view returns (uint256)
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable
Name | Type | Description |
---|---|---|
owner | address | undefined |
spender | address | undefined |
value | uint256 | undefined |
deadline | uint256 | undefined |
v | uint8 | undefined |
r | bytes32 | undefined |
s | bytes32 | undefined |
function redeem(uint256 _amountShares, bytes) external nonpayable returns (uint256)
Exchange
_amountShares
for some amount of baseToken.Redeem the specified number of shares to get back the underlying base token assets, which are withdrawn from Compound. If the utilization of the Compound market is too high, there may be insufficient funds to redeem and this method will revert. The
_data
parameter is unused.Name | Type | Description |
---|---|---|
_amountShares | uint256 | The amount of the Entity's portfolio shares to exchange. |
_1 | bytes | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | The amount of baseToken that this redemption yields to the Entity. |
function redemptionFee() external view returns (uint256)
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function registry() external view returns (contract Registry)
Name | Type | Description |
---|---|---|
_0 | contract Registry | undefined |
function setCap(uint256 _amount) external nonpayable
Set the Portfolio cap.
Name | Type | Description |
---|---|---|
_amount | uint256 | Amount, denominated in baseToken. |
function setDepositFee(uint256 _pct) external nonpayable
Set deposit fee.
Name | Type | Description |
---|---|---|
_pct | uint256 | Percentage as ZOC (e.g. 1000 = 10%). |
function setRedemptionFee(uint256 _pct) external nonpayable
Set redemption fee.
Name | Type | Description |
---|---|---|
_pct | uint256 | Percentage as ZOC (e.g. 1000 = 10%). |
function specialTarget() external view returns (bytes20)
If set to a non-zero value, this contract will pass these byes as the target contract to the RolesAuthority's
canCall
method, rather than its own contract. This allows a single RolesAuthority permission to manage permissions simultaneously for a group of contracts that identify themselves as a certain type. For example: set a permission for all "entity" contracts.Name | Type | Description |
---|---|---|
_0 | bytes20 | undefined |
function symbol() external view returns (string)
Name | Type | Description |
---|---|---|
_0 | string | undefined |
function sync() external nonpayable
Deposits stray USDC for the benefit of everyone else
function takeFees(uint256 _amountAssets) external nonpayable
Takes some amount of assets from this portfolio as assets under management fee.
Name | Type | Description |
---|---|---|
_amountAssets | uint256 | Amount of assets to take. |
function totalAssets() external view returns (uint256)
Returns the USDC value of all cUSDC held by this contract.
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function totalSupply() external view returns (uint256)
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function transfer(address, uint256) external pure returns (bool)
transfer
disabled on Portfolio tokens.Name | Type | Description |
---|---|---|
_0 | address | undefined |
_1 | uint256 | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function transferFrom(address, address, uint256) external pure returns (bool)
transferFrom
disabled on Portfolio tokens.Name | Type | Description |
---|---|---|
_0 | address | undefined |
_1 | address | undefined |
_2 | uint256 | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function usdc() external view returns (contract ERC20)
Name | Type | Description |
---|---|---|
_0 | contract ERC20 | undefined |
event Approval(address indexed owner, address indexed spender, uint256 amount)
Name | Type | Description |
---|---|---|
owner indexed | address | undefined |
spender indexed | address | undefined |
amount | uint256 | undefined |
event CapSet(uint256 cap)
Event emitted when
cap
is set.Name | Type | Description |
---|---|---|
cap | uint256 | undefined |
event Deposit(address indexed sender, address indexed receiver, uint256 assets, uint256 shares)