4

In the eosio.token contract, the transfer action makes the sender pay for the RAM if a new account has to be created for the receiver. I would like to make a contract where is the issuer of the token the one that always pays. What permissions would the issuer need to set in order to allow the table emplace method call to receive her as ram payer albeit her not being involved in the current transaction?

1

Looks like the 3rd party must be signing the transaction, there is no way to delegate the permission if I'm reading this right

https://github.com/EOSIO/eos/blob/3016381ec3a899e19623377d92bd63af534cacfe/libraries/chain/apply_context.cpp#L354

  • hello, but I see in the token contract, when I transfer token to others, it will call to_acnts.modify( to, 0, [&]( auto& a ) { a.balance += value; }); the payer 0 may represent the receiver, but the receiver didn't authorize the transfer, how does it work? – Jimmy Guo Jul 12 '18 at 7:01
  • github.com/EOSIO/eos/blob/v1.0.8/libraries/chain/… is it because the modify will not add the usage, so we don't need the receiver's permission? – Jimmy Guo Jul 12 '18 at 7:21
  • Exactly. The net RAM usage won’t change – Ariel Scarpinelli Jul 13 '18 at 12:56
  • oh, it's really tricky – Jimmy Guo Jul 13 '18 at 13:09
0

So either one of the accounts which have a signature in transaction can pay for RAM (see Ariel's answer), or contract account itself can pay for it. Source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.