UA
Unit of Account (UA) is a USDC-backed token used as the unit of account accross Increment
Methods
DEFAULT_ADMIN_ROLE
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
EMERGENCY_ADMIN
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
GOVERNANCE
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
addReserveToken
Parameters
Name | Type | Description |
---|---|---|
newReserveToken | contract IERC20Metadata | undefined |
tokenMintCap | uint256 | undefined |
allowance
Parameters
Name | Type | Description |
---|---|---|
_0 | address | undefined |
_1 | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
approve
Sets amount
as the allowance of spender
over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.
Parameters
Name | Type | Description |
---|---|---|
spender | address | undefined |
amount | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
balanceOf
Parameters
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
changeReserveTokenMaxMintCap
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC20Metadata | undefined |
newMintCap | uint256 | undefined |
decimals
Returns
Name | Type | Description |
---|---|---|
_0 | uint8 | undefined |
getNumReserveTokens
Return the number of reserve tokens
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | Number of reserve tokens |
getReserveToken
Get details of a reserve token
Parameters
Name | Type | Description |
---|---|---|
tokenIdx | uint256 | Index of the reserve token to get details from |
Returns
Name | Type | Description |
---|---|---|
_0 | IUA.ReserveToken | undefined |
getRoleAdmin
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
grantRole
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role. May emit a {RoleGranted} event.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
hasRole
Returns true
if account
has been granted role
.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
initialReserveToken
Returns
Name | Type | Description |
---|---|---|
_0 | contract IERC20Metadata | undefined |
isEmergencyAdmin
Parameters
Name | Type | Description |
---|---|---|
account | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
isGovernor
Parameters
Name | Type | Description |
---|---|---|
account | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
mintWithReserve
Mint UA with a whitelisted token
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC20Metadata | Address of the reserve token to mint UA with |
amount | uint256 | Amount of reserve token. Might not be 18 decimals |
name
Returns
Name | Type | Description |
---|---|---|
_0 | string | undefined |
pause
paused
Returns true if the contract is paused, and false otherwise.
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
renounceRole
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
. May emit a {RoleRevoked} event.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
revokeRole
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role. May emit a {RoleRevoked} event.
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
supportsInterface
See {IERC165-supportsInterface}.
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
symbol
Returns
Name | Type | Description |
---|---|---|
_0 | string | undefined |
totalSupply
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
transfer
Moves amount
tokens from the caller's account to to
. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
Parameters
Name | Type | Description |
---|---|---|
to | address | undefined |
amount | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
transferFrom
Moves amount
tokens from from
to to
using the allowance mechanism. amount
is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
Parameters
Name | Type | Description |
---|---|---|
from | address | undefined |
to | address | undefined |
amount | uint256 | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
unpause
withdraw
Burn UA in exchange of a whitelisted token
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC20Metadata | Address of whitelisted reserve token to withdraw in |
amount | uint256 | UA amount. 18 decimals |
Events
Approval
Parameters
Name | Type | Description |
---|---|---|
owner | address | undefined |
spender | address | undefined |
value | uint256 | undefined |
Paused
Parameters
Name | Type | Description |
---|---|---|
account | address | undefined |
ReserveTokenAdded
Emitted when new reserve token is added
Parameters
Name | Type | Description |
---|---|---|
newToken | contract IERC20Metadata | undefined |
numReserveTokens | uint256 | undefined |
ReserveTokenMaxMintCapUpdated
Emitted when the max mint cap of a reserve token is updated
Parameters
Name | Type | Description |
---|---|---|
token | contract IERC20Metadata | undefined |
newMintCap | uint256 | undefined |
RoleAdminChanged
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
previousAdminRole | bytes32 | undefined |
newAdminRole | bytes32 | undefined |
RoleGranted
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
sender | address | undefined |
RoleRevoked
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
sender | address | undefined |
Transfer
Parameters
Name | Type | Description |
---|---|---|
from | address | undefined |
to | address | undefined |
value | uint256 | undefined |
Unpaused
Parameters
Name | Type | Description |
---|---|---|
account | address | undefined |
Errors
UA_ExcessiveTokenMintCapReached
Emitted when the UA amount to mint with the token exceed the max cap of this token
UA_ReserveTokenAlreadyAssigned
Emitted when the proposed reserve token is already registered
UA_ReserveTokenZeroAddress
Emitted when the proposed reserve token address is equal to the zero address
UA_UnsupportedReserveToken
Emitted when the token provided isn't supported by UA as a reserve token
Last updated