Closed DenisCarriere closed 8 months ago
Adding a return value to indicate the amount of RAM purchased (which is very useful when using the quantity
field) would be a welcome addition too!
I think we talked about that for the modifications to buyram
as well. It could just mirror that.
quantity
as param, keep it consistent with buyram
/**
* The buyramself action is designed to enhance the permission security by allowing an account to purchase RAM exclusively for itself.
* This action prevents the potential risk associated with standard actions like buyram and buyrambytes,
* which can transfer EOS tokens out of the account, acting as a proxy for eosio.token::transfer.
*
* @param account - the ram buyer and receiver,
* @param quantity - the quantity of tokens to buy ram with.
*/
[[eosio::action]]
void buyramself( const name& account, const asset& quantity );
closed with PR
Purpose
Create
buyramself
ACTION where you can’tbuyram
for someone else.Allows a smart contract to
linkauth
permission tobuyramself
thus preventing sending RAM outside of the custody of the smart contract or personal account, it would only be able to purchase RAM for itself.buyram
andbuyrambytes
can be a risk for contracts since it allows to transfer EOS outside of the account, essentially acting as a proxy foreosio.token::transfer
.Feedback provided by
buyramself
ACTIONPreconditions
require_auth(owner)
quantity
orbytes
bytes
is provided, internally usebuyrambytes
actionquantity
is provided, internally usebuyram
action