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 "Buy RAM Burn" ACTION #121

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

Implement "Buy RAM Burn" ACTION #121

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

Comments

@DenisCarriere
Copy link
Contributor

Purpose

Create buyramburn ACTION where any account can buy RAM and immediately burn the RAM bytes received.

Currently, the only way to purchase & buy RAM is to:

  1. Buy RAM
  2. Listen for inline action logbuyram to know how much bytes were purchased
  3. Burn RAM bytes

Or

  1. Compute buy RAM bytes
  2. Buy RAM with EOS
  3. Burn RAM based on pre-computed bytes

This buyramburn ACTION would eliminate the requirement of listening on logbuyram or pre-computing the Bancor RAM buying output.

Feedback provided by

buyramburn ACTION

/**
 * Buy RAM and immediately burn RAM.
 * An inline transfer from payer to system contract of tokens will be executed.
 *
 * @param payer - the payer of buy RAM & burn.
 * @param quantity - the quantity of tokens to buy RAM & burn with.
 * @param memo - the memo string to accompany the transaction.
 */
[[eosio::action]]
void buyramburn( const name& payer, const asset& quantity, const std::string& memo );

Preconditions

  • require_auth(payer)
  • must provide quantity above 0 amount
  • returns action_return_buyram
  • no additional logging requirements since actions can be covered by logbuyram & logramchange

References

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

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