SingleTokenPortfolio
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 baseToken() external view returns (contract ERC20)
Name | Type | Description |
---|---|---|
_0 | contract ERC20 | 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 convertToAssets(uint256 _amount) 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 |
---|---|---|
_amount | uint256 | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function convertToShares(uint256 _amount) 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 |
---|---|---|
_amount | uint256 | undefined |
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function decimals() external view returns (uint8)
Name | Type | Description |
---|---|---|
_0 | uint8 | undefined |
function deposit(uint256 _amountBaseToken, bytes _data) external nonpayable returns (uint256)
Exchange
_amountBaseToken
for some amount of Portfolio shares.We convert
baseToken
to asset
via a swap wrapper. _data
should be a packed swap wrapper address concatenated with the bytes payload your swap wrapper expects. i.e. bytes.concat(abi.encodePacked(address swapWrapper), SWAP_WRAPPER_BYTES)
. To determine if this deposit exceeds the cap, we get the asset/baseToken exchange rate and multiply it by totalAssets
.Name | Type | Description |
---|---|---|
_amountBaseToken | uint256 | The amount of the Entity's baseToken to deposit. |
_data | bytes | Data that the portfolio needs to make the deposit. In some cases, this will be swap parameters. |
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 exchangeRate() 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 _data) external nonpayable returns (uint256)
Exchange
_amountShares
for some amount of baseToken.After converting
shares
to assets
, we convert assets
to baseToken
via a swap wrapper. _data
should be a packed swap wrapper address concatenated with the bytes payload your swap wrapper expects. i.e. bytes.concat(abi.encodePacked(address swapWrapper), SWAP_WRAPPER_BYTES)
.Name | Type | Description |
---|---|---|
_amountShares | uint256 | The amount of the Entity's portfolio shares to exchange. |
_data | bytes | Data that the portfolio needs to make the redemption. In some cases, this will be swap parameters. |
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 takeFees(uint256 _amountAssets) external nonpayable
Takes some amount of assets from this portfolio as assets under management fee.
Importantly, updates exchange rate to change the shares/assets calculations.
Name | Type | Description |
---|---|---|
_amountAssets | uint256 | Amount of assets to take. |
function totalAssets() external view returns (uint256)
Total amount of the underlying asset that is managed by the Portfolio.
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 |
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)
sender
has exchanged assets
for shares
, and transferred those shares
to receiver
.Name | Type | Description |
---|---|---|
sender indexed | address | undefined |
receiver indexed | address | undefined |
assets | uint256 | undefined |
shares | uint256 | undefined |
event DepositFeeSet(uint256 fee)
Event emitted when
depositFee
is set.Name | Type | Description |
---|---|---|
fee | uint256 | undefined |
event FeesTaken(uint256 amount)