IGhoToken
The interface of the GhoToken
.
The IGhoToken
interface inherits the IERC20Burnable
, IERC20Mintable
, and IERC20
interfaces.
This page shows the structs, events, and write, view and pure methods within the IGhoToken
interface. The source code is available on GitHub.
Structs
Facilitator
struct Facilitator {
uint128 bucketCapacity;
uint128 bucketLevel;
string label;
}
A Facilitator
can trustlessly generate (and burn) GHO tokens.
Name | Type | Description |
---|---|---|
bucketCapacity | uint128 | The capacity of the bucket assigned to a specific Facilitator |
bucketLevel | uint128 | The bucket level |
label | string | The label of the Facilitator bucket |
Events
FacilitatorAdded
event FacilitatorAdded(
address indexed facilitatorAddress,
bytes32 indexed label,
uint256 bucketCapacity
)
Emitted when a new Facilitator is added.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitatorAddress | address | The address of the new Facilitator |
label | bytes32 | A hashed human readable identifier for the Facilitator |
bucketCapacity | uint256 | The initial capacity of the Facilitator’s bucket |
FacilitatorRemoved
event FacilitatorRemoved(address indexed facilitatorAddress)
Emitted when a Facilitator is removed.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitatorAddress | address | The address of the removed Facilitator |
FacilitatorBucketCapacityUpdated
event FacilitatorBucketCapacityUpdated(
address indexed facilitatorAddress,
uint256 oldCapacity,
uint256 newCapacity
)
Emitted when the bucket capacity of a Facilitator is updated.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitatorAddress | address | The address of the Facilitator whose bucket capacity is being changed |
oldCapacity | uint256 | The old capacity of the bucket |
newCapacity | uint256 | The new capacity of the bucket |
FacilitatorBucketLevelUpdated
event FacilitatorBucketLevelUpdated(
address indexed facilitatorAddress,
uint256 oldLevel,
uint256 newLevel
)
Emitted when the bucket level has changed. This occurs when tokens have been minted and burned.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitatorAddress | address | The address of the Facilitator whose bucket level is being changed |
oldLevel | uint256 | The old level of the bucket |
newLevel | uint256 | The new level of the bucket |
Write Methods
addFacilitator
function addFacilitator(
address facilitatorAddress,
string calldata facilitatorLabel,
uint128 bucketCapacity
) external
Adds the Facilitator passed with the parameters to the Facilitators list.
Only accounts with FACILITATOR_MANAGER_ROLE
role can call this function.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitatorAddress | address | The address of the Facilitator to add |
facilitatorLabel | string | A human readable identifier for the facilitator |
bucketCapacity | uint128 | The upward limit of GHO can be minted by the facilitator |
removeFacilitator
function removeFacilitator(address facilitatorAddress) external
Remove the Facilitator from the Facilitators list.
Only accounts with FACILITATOR_MANAGER_ROLE
role can call this function.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitatorAddress | address | The address of the Facilitator to remove |
setFacilitatorBucketCapacity
function setFacilitatorBucketCapacity(address facilitator, uint128 newCapacity) external
Set the bucket capacity of the facilitator
.
Only accounts with BUCKET_MANAGER_ROLE
role can call this function.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitator | address | The address of the Facilitator |
newCapacity | uint128 | The new capacity of the bucket |
View Methods
getFacilitator
function getFacilitator(address facilitator) external view returns (Facilitator memory)
Returns the facilitator
data.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitator | address | The address of the Facilitator |
Return Values:
Type | Description |
---|---|
facilitator | The Facilitator configuration |
getFacilitatorBucket
function getFacilitatorBucket(address facilitator) external view returns (uint256, uint256)
Returns the bucket configuration of the facilitator
.
Input Parameters:
Name | Type | Description |
---|---|---|
facilitator | address | The address of the Facilitator |
Return Values:
Type | Description |
---|---|
uint256 | The capacity of the Facilitator’s bucket |
uint256 | The level of the Facilitator’s bucket |
getFacilitatorsList
function getFacilitatorsList() external view returns (address[] memory)
Returns the list of addresses of the active Facilitators.
Return Values:
Type | Description |
---|---|
address[] | The list of the Facilitators addresses |
Pure Methods
FACILITATOR_MANAGER_ROLE
function FACILITATOR_MANAGER_ROLE() external pure returns (bytes32)
Returns the identifier of the Facilitator Manager Role.
Return Values:
Type | Description |
---|---|
bytes32 | The bytes32 id hash of the FacilitatorManager role |
BUCKET_MANAGER_ROLE
function BUCKET_MANAGER_ROLE() external pure returns (bytes32)
Returns the identifier of the Bucket Manager Role.
Return Values:
Type | Description |
---|---|
bytes32 | The bytes32 id hash of the BucketManager role |