Skip to main content

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.

NameTypeDescription
bucketCapacityuint128The capacity of the bucket assigned to a specific Facilitator
bucketLeveluint128The bucket level
labelstringThe 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:

NameTypeDescription
facilitatorAddressaddressThe address of the new Facilitator
labelbytes32A hashed human readable identifier for the Facilitator
bucketCapacityuint256The initial capacity of the Facilitator’s bucket

FacilitatorRemoved

event FacilitatorRemoved(address indexed facilitatorAddress)

Emitted when a Facilitator is removed.

Input Parameters:

NameTypeDescription
facilitatorAddressaddressThe 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:

NameTypeDescription
facilitatorAddressaddressThe address of the Facilitator whose bucket capacity is being changed
oldCapacityuint256The old capacity of the bucket
newCapacityuint256The 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:

NameTypeDescription
facilitatorAddressaddressThe address of the Facilitator whose bucket level is being changed
oldLeveluint256The old level of the bucket
newLeveluint256The 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.

info

Only accounts with FACILITATOR_MANAGER_ROLE role can call this function.

Input Parameters:

NameTypeDescription
facilitatorAddressaddressThe address of the Facilitator to add
facilitatorLabelstringA human readable identifier for the facilitator
bucketCapacityuint128The upward limit of GHO can be minted by the facilitator

removeFacilitator

function removeFacilitator(address facilitatorAddress) external

Remove the Facilitator from the Facilitators list.

info

Only accounts with FACILITATOR_MANAGER_ROLE role can call this function.

Input Parameters:

NameTypeDescription
facilitatorAddressaddressThe address of the Facilitator to remove

setFacilitatorBucketCapacity

function setFacilitatorBucketCapacity(address facilitator, uint128 newCapacity) external

Set the bucket capacity of the facilitator.

info

Only accounts with BUCKET_MANAGER_ROLE role can call this function.

Input Parameters:

NameTypeDescription
facilitatoraddressThe address of the Facilitator
newCapacityuint128The new capacity of the bucket

View Methods

getFacilitator

function getFacilitator(address facilitator) external view returns (Facilitator memory)

Returns the facilitator data.

Input Parameters:

NameTypeDescription
facilitatoraddress The address of the Facilitator

Return Values:

TypeDescription
facilitatorThe Facilitator configuration

getFacilitatorBucket

function getFacilitatorBucket(address facilitator) external view returns (uint256, uint256)

Returns the bucket configuration of the facilitator.

Input Parameters:

NameTypeDescription
facilitatoraddressThe address of the Facilitator

Return Values:

TypeDescription
uint256The capacity of the Facilitator’s bucket
uint256The 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:

TypeDescription
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:

TypeDescription
bytes32The 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:

TypeDescription
bytes32The bytes32 id hash of the BucketManager role