Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "Log System Fee" ACTION #122

Closed
5 tasks
Tracked by #128 ...
DenisCarriere opened this issue Mar 22, 2024 · 1 comment
Closed
5 tasks
Tracked by #128 ...

Implement "Log System Fee" ACTION #122

DenisCarriere opened this issue Mar 22, 2024 · 1 comment
Labels

Comments

@DenisCarriere
Copy link
Contributor

DenisCarriere commented Mar 22, 2024

Purpose

Create logsystemfee ACTION to be used for logging system fees (RAM, Name Bids, Powerup CPU & NET).

Analytics platforms can use this action to track system fees and provide insights to users.

Currently the only way to calculate fees is to parse each action and calculate the fees based on the action type.

Feedback provided by

logsystemfee ACTION

/**
 * Logging for actions resulting in system fees.
 * Notifies the "eosio.fee" account of the fees collected.
 *
 * @param protocol - name of protocol fees were earned from.
 * @param fee - the amount of fees collected by system.
 * @param memo - (optional) the memo associated with the action.
 */
[[eosio::action]]
void logsystemfee( const name& protocol, const asset& fee, const std::string& memo );

JSON payload examples

[
  {
    "protocol":"eosio.ram",
    "fee": "0.5000 EOS",
    "memo": "buy ram"
  },
  {
    "protocol":"eosio.ram",
    "fee": "0.1000 EOS",
    "memo": "sell ram"
  },
  {
    "protocol":"eosio.names",
    "fee": "50.0000 EOS",
    "memo": "buy name"
  },
  {
    "protocol":"eosio.powup",
    "fee": "1.0000 EOS",
    "memo": "buy powerup"
  },
  {
    "protocol":"eosio.rex",
    "fee": "0.2000 EOS",
    "memo": "buy rex"
  }
]

Preconditions

  • require_auth(get_self())
  • require_recipient("eosio.fee"_n)

References

Note: changes should be pushed to Antelope Reference contracts https://github.com/AntelopeIO/reference-contracts

@DenisCarriere
Copy link
Contributor Author

Implemented via: AntelopeIO/reference-contracts#71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants