IPowerToken
Functions
initialize
Initializes the contract. Setup token name, symbol and account with APP_ADMIN_ROLE.
function initialize(string calldata name_, string calldata symbol_, address admin_) external;
Parameters
Name | Type | Description |
---|---|---|
name_ | string | The name of the token. |
symbol_ | string | The symbol of the token. |
admin_ | address | The account to be granted with APP_ADMIN_ROLE. |
migrate
Migrates the token points of users.
The caller must have the APP_ADMIN_ROLE.
function migrate(address[] calldata users, bytes32[] calldata feedIds) external;
Parameters
Name | Type | Description |
---|---|---|
users | address[] | The addresses of the users to migrate. |
feedIds | bytes32[] | The feed ids of the feeds to migrate. |
mint
Mints new token points.
The caller must have the APP_ADMIN_ROLE.
function mint(address to, uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
to | address | The account to receive the token points. |
amount | uint256 | The amount of token points to mint. |
tip
Tips with token points. If token points are not enough, it will try the balance.
The to and feedId are optional, but at least one of them must be provided.
If both are provided, the to
will be used.
function tip(uint256 amount, address to, bytes32 feedId) external;
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of token points to send. It can be empty. |
to | address | The address to send the token points. It can be empty. |
feedId | bytes32 | The feed id. It can be empty. |
withdrawByFeedId
Withdraws tokens by feedId. to
is supposed to be the true owner of the feedId.
The caller must have the APP_ADMIN_ROLE.
function withdrawByFeedId(address to, bytes32 feedId) external;
Parameters
Name | Type | Description |
---|---|---|
to | address | The address who receives the tokens. |
feedId | bytes32 | The amount belongs to the feedId. |
balanceOfByFeed
Return the balance of the feedId
function balanceOfByFeed(bytes32 feedId) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
feedId | bytes32 | The feed id |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of the balance |
balanceOfPoints
Return the balance of points, aka the inactive tokens, of the owner
function balanceOfPoints(address owner) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
owner | address | The address of the owner |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of the balance |