Alert Source Discuss
⚠️ Draft Standards Track: ERC

ERC-7254: 代币收益分成

收益代币是一种为持有者分享奖励的代币。

Authors Quy Phan (@quyphandang), Quy Phan <quy.phan@cryptoviet.info>
Created 2023-06-29
Discussion Link https://ethereum-magicians.org/t/token-revenue-sharing/14872

摘要

我们的项目渴望带来独特的功能并增强 ERC-20 代币持有者的价值,旨在轻松奖励代币持有者,而无需用户锁定、质押或耕作其代币。 每当项目产生利润时,这些利润可以分配给代币持有者。

收益分享是 ERC-20 的扩展版本。 它为代币持有者提出了一种额外的支付方式。

此标准包括更新持有者的奖励并允许代币持有者提取奖励。

潜在的用例包括:

  • 公司向代币持有者分配股息。
  • 直接分享来自商业活动的收入,例如市场、自动化做市商 (AMMs) 和游戏。

规范

方法

maxTokenReward

返回最大代币奖励。

function maxTokenReward() public view returns (uint256)

informationOf

返回地址为tokenaccount的另一个帐户的帐户信息,包括:inReward、outReward 和 withdraw。

function informationOf(address token, address account) public view returns (UserInformation memory)

informationOfBatch

返回具有 account 的帐户信息的列表,包括:inReward、outReward 和 withdraw。

function informationOfBatch(address account) public view returns (UserInformation[] memory)

UserInformation

inReward: 当用户的余额减少时,inReward 将被更新 outReward: 当用户的余额增加时,outReward 将被更新 withdraw: 提取的奖励代币总额

struct UserInformation {
    uint256 inReward;
    uint256 outReward;
    uint256 withdraw;
}

tokenReward

返回代币的代币奖励地址列表。

function tokenReward() public view returns (address[] memory)

updateReward

更新代币奖励的 rewardPerShare。 rewardPerShare = rewardPerShare + amount / totalSupply()

function updateReward(address[] memory token, uint256[] memory amount) public

viewReward

返回帐户的奖励金额列表

function viewReward(address account) public view returns (uint256[] memory)

getReward

获取并返回具有代币奖励列表的奖励。

function getReward(address[] memory token) public

getRewardPerShare

返回代币奖励的每股奖励。

function getRewardPerShare(address token) public view returns (uint256)

existsTokenReward

返回代币奖励的状态。

function existsTokenReward(address token) public view returns (bool)

理由

待定

参考实现

安全考虑

需要讨论。

版权

CC0 下放弃版权及相关权利。

Citation

Please cite this document as:

Quy Phan (@quyphandang), Quy Phan <quy.phan@cryptoviet.info>, "ERC-7254: 代币收益分成 [DRAFT]," Ethereum Improvement Proposals, no. 7254, June 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7254.