UA

Unit of Account (UA) is a USDC-backed token used as the unit of account accross Increment

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

EMERGENCY_ADMIN

function EMERGENCY_ADMIN() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

GOVERNANCE

function GOVERNANCE() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

addReserveToken

function addReserveToken(contract IERC20Metadata newReserveToken, uint256 tokenMintCap) external nonpayable

Parameters

Name
Type
Description

newReserveToken

contract IERC20Metadata

undefined

tokenMintCap

uint256

undefined

allowance

function allowance(address, address) external view returns (uint256)

Parameters

Name
Type
Description

_0

address

undefined

_1

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

approve

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

Name
Type
Description

spender

address

undefined

amount

uint256

undefined

Returns

Name
Type
Description

_0

bool

undefined

balanceOf

function balanceOf(address) external view returns (uint256)

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

changeReserveTokenMaxMintCap

function changeReserveTokenMaxMintCap(contract IERC20Metadata token, uint256 newMintCap) external nonpayable

Parameters

Name
Type
Description

token

contract IERC20Metadata

undefined

newMintCap

uint256

undefined

decimals

function decimals() external view returns (uint8)

Returns

Name
Type
Description

_0

uint8

undefined

getNumReserveTokens

function getNumReserveTokens() external view returns (uint256)

Return the number of reserve tokens

Returns

Name
Type
Description

_0

uint256

Number of reserve tokens

getReserveToken

function getReserveToken(uint256 tokenIdx) external view returns (struct IUA.ReserveToken)

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

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

Name
Type
Description

role

bytes32

undefined

Returns

Name
Type
Description

_0

bytes32

undefined

grantRole

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

Name
Type
Description

role

bytes32

undefined

account

address

undefined

hasRole

function hasRole(bytes32 role, address account) external view returns (bool)

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

function initialReserveToken() external view returns (contract IERC20Metadata)

Returns

Name
Type
Description

_0

contract IERC20Metadata

undefined

isEmergencyAdmin

function isEmergencyAdmin(address account) external view returns (bool)

Parameters

Name
Type
Description

account

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

isGovernor

function isGovernor(address account) external view returns (bool)

Parameters

Name
Type
Description

account

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

mintWithReserve

function mintWithReserve(contract IERC20Metadata token, uint256 amount) external nonpayable

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

function name() external view returns (string)

Returns

Name
Type
Description

_0

string

undefined

pause

function pause() external nonpayable

paused

function paused() external view returns (bool)

Returns true if the contract is paused, and false otherwise.

Returns

Name
Type
Description

_0

bool

undefined

renounceRole

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

Name
Type
Description

role

bytes32

undefined

account

address

undefined

revokeRole

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

Name
Type
Description

role

bytes32

undefined

account

address

undefined

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

See {IERC165-supportsInterface}.

Parameters

Name
Type
Description

interfaceId

bytes4

undefined

Returns

Name
Type
Description

_0

bool

undefined

symbol

function symbol() external view returns (string)

Returns

Name
Type
Description

_0

string

undefined

totalSupply

function totalSupply() external view returns (uint256)

Returns

Name
Type
Description

_0

uint256

undefined

transfer

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

Name
Type
Description

to

address

undefined

amount

uint256

undefined

Returns

Name
Type
Description

_0

bool

undefined

transferFrom

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

Name
Type
Description

from

address

undefined

to

address

undefined

amount

uint256

undefined

Returns

Name
Type
Description

_0

bool

undefined

unpause

function unpause() external nonpayable

withdraw

function withdraw(contract IERC20Metadata token, uint256 amount) external nonpayable

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

event Approval(address indexed owner, address indexed spender, uint256 value)

Parameters

Name
Type
Description

owner indexed

address

undefined

spender indexed

address

undefined

value

uint256

undefined

Paused

event Paused(address account)

Parameters

Name
Type
Description

account

address

undefined

ReserveTokenAdded

event ReserveTokenAdded(contract IERC20Metadata indexed newToken, uint256 numReserveTokens)

Emitted when new reserve token is added

Parameters

Name
Type
Description

newToken indexed

contract IERC20Metadata

undefined

numReserveTokens

uint256

undefined

ReserveTokenMaxMintCapUpdated

event ReserveTokenMaxMintCapUpdated(contract IERC20Metadata indexed token, uint256 newMintCap)

Emitted when the max mint cap of a reserve token is updated

Parameters

Name
Type
Description

token indexed

contract IERC20Metadata

undefined

newMintCap

uint256

undefined

RoleAdminChanged

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Parameters

Name
Type
Description

role indexed

bytes32

undefined

previousAdminRole indexed

bytes32

undefined

newAdminRole indexed

bytes32

undefined

RoleGranted

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

Name
Type
Description

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

RoleRevoked

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

Name
Type
Description

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

Transfer

event Transfer(address indexed from, address indexed to, uint256 value)

Parameters

Name
Type
Description

from indexed

address

undefined

to indexed

address

undefined

value

uint256

undefined

Unpaused

event Unpaused(address account)

Parameters

Name
Type
Description

account

address

undefined

Errors

UA_ExcessiveTokenMintCapReached

error UA_ExcessiveTokenMintCapReached()

Emitted when the UA amount to mint with the token exceed the max cap of this token

UA_ReserveTokenAlreadyAssigned

error UA_ReserveTokenAlreadyAssigned()

Emitted when the proposed reserve token is already registered

UA_ReserveTokenZeroAddress

error UA_ReserveTokenZeroAddress()

Emitted when the proposed reserve token address is equal to the zero address

UA_UnsupportedReserveToken

error UA_UnsupportedReserveToken()

Emitted when the token provided isn't supported by UA as a reserve token

Last updated