Unit of Account (UA) is a USDC-backed token used as the unit of account accross Increment
Methods
DEFAULT_ADMIN_ROLE
Copy function DEFAULT_ADMIN_ROLE () external view returns ( bytes32 )
Returns
EMERGENCY_ADMIN
Copy function EMERGENCY_ADMIN () external view returns ( bytes32 )
Returns
GOVERNANCE
Copy function GOVERNANCE () external view returns ( bytes32 )
Returns
addReserveToken
Copy function addReserveToken (contract IERC20Metadata newReserveToken , uint256 tokenMintCap) external nonpayable
Parameters
allowance
Copy function allowance ( address , address ) external view returns ( uint256 )
Parameters
Returns
approve
Copy function approve ( address spender , uint256 amount) external nonpayable returns ( bool )
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
Returns
balanceOf
Copy function balanceOf ( address ) external view returns ( uint256 )
Parameters
Returns
changeReserveTokenMaxMintCap
Copy function changeReserveTokenMaxMintCap (contract IERC20Metadata token , uint256 newMintCap) external nonpayable
Parameters
decimals
Copy function decimals () external view returns ( uint8 )
Returns
getNumReserveTokens
Copy function getNumReserveTokens () external view returns ( uint256 )
Return the number of reserve tokens
Returns
getReserveToken
Copy function getReserveToken ( uint256 tokenIdx) external view returns (struct IUA . ReserveToken )
Get details of a reserve token
Parameters
Returns
getRoleAdmin
Copy function getRoleAdmin ( bytes32 role) external view returns ( bytes32 )
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
Returns
grantRole
Copy function grantRole ( bytes32 role , address account) external nonpayable
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
hasRole
Copy function hasRole ( bytes32 role , address account) external view returns ( bool )
Returns true
if account
has been granted role
.
Parameters
Returns
initialReserveToken
Copy function initialReserveToken () external view returns (contract IERC20Metadata )
Returns
isEmergencyAdmin
Copy function isEmergencyAdmin ( address account) external view returns ( bool )
Parameters
Returns
isGovernor
Copy function isGovernor ( address account) external view returns ( bool )
Parameters
Returns
mintWithReserve
Copy function mintWithReserve (contract IERC20Metadata token , uint256 amount) external nonpayable
Mint UA with a whitelisted token
Parameters
name
Copy function name () external view returns ( string )
Returns
pause
Copy function pause () external nonpayable
paused
Copy function paused () external view returns ( bool )
Returns true if the contract is paused, and false otherwise.
Returns
renounceRole
Copy function renounceRole ( bytes32 role , address account) external nonpayable
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
revokeRole
Copy function revokeRole ( bytes32 role , address account) external nonpayable
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
supportsInterface
Copy function supportsInterface ( bytes4 interfaceId) external view returns ( bool )
See {IERC165-supportsInterface}.
Parameters
Returns
symbol
Copy function symbol () external view returns ( string )
Returns
totalSupply
Copy function totalSupply () external view returns ( uint256 )
Returns
transfer
Copy function transfer ( address to , uint256 amount) external nonpayable returns ( bool )
Moves amount
tokens from the caller's account to to
. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
Parameters
Returns
transferFrom
Copy function transferFrom ( address from , address to , uint256 amount) external nonpayable returns ( bool )
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
Returns
unpause
Copy function unpause () external nonpayable
withdraw
Copy function withdraw (contract IERC20Metadata token , uint256 amount) external nonpayable
Burn UA in exchange of a whitelisted token
Parameters
Events
Approval
Copy event Approval ( address indexed owner, address indexed spender, uint256 value)
Parameters
Paused
Copy event Paused ( address account)
Parameters
ReserveTokenAdded
Copy event ReserveTokenAdded (contract IERC20Metadata indexed newToken, uint256 numReserveTokens)
Emitted when new reserve token is added
Parameters
ReserveTokenMaxMintCapUpdated
Copy event ReserveTokenMaxMintCapUpdated (contract IERC20Metadata indexed token, uint256 newMintCap)
Emitted when the max mint cap of a reserve token is updated
Parameters
RoleAdminChanged
Copy event RoleAdminChanged ( bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
Parameters
RoleGranted
Copy event RoleGranted ( bytes32 indexed role, address indexed account, address indexed sender)
Parameters
RoleRevoked
Copy event RoleRevoked ( bytes32 indexed role, address indexed account, address indexed sender)
Parameters
Transfer
Copy event Transfer ( address indexed from, address indexed to, uint256 value)
Parameters
Unpaused
Copy event Unpaused ( address account)
Parameters
Errors
UA_ExcessiveTokenMintCapReached
Copy error UA_ExcessiveTokenMintCapReached ()
Emitted when the UA amount to mint with the token exceed the max cap of this token
UA_ReserveTokenAlreadyAssigned
Copy error UA_ReserveTokenAlreadyAssigned ()
Emitted when the proposed reserve token is already registered
UA_ReserveTokenZeroAddress
Copy error UA_ReserveTokenZeroAddress ()
Emitted when the proposed reserve token address is equal to the zero address
UA_UnsupportedReserveToken
Copy error UA_UnsupportedReserveToken ()
Emitted when the token provided isn't supported by UA as a reserve token