IPowerToken

Git Source

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

NameTypeDescription
name_stringThe name of the token.
symbol_stringThe symbol of the token.
admin_addressThe 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

NameTypeDescription
usersaddress[]The addresses of the users to migrate.
feedIdsbytes32[]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

NameTypeDescription
toaddressThe account to receive the token points.
amountuint256The 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

NameTypeDescription
amountuint256The amount of token points to send. It can be empty.
toaddressThe address to send the token points. It can be empty.
feedIdbytes32The 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

NameTypeDescription
toaddressThe address who receives the tokens.
feedIdbytes32The amount belongs to the feedId.

balanceOfByFeed

Return the balance of the feedId

function balanceOfByFeed(bytes32 feedId) external view returns (uint256);

Parameters

NameTypeDescription
feedIdbytes32The feed id

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
owneraddressThe address of the owner

Returns

NameTypeDescription
<none>uint256The amount of the balance