mulit_index class has three methods (emplace, modify, erase) to update a table.

emplace and modify methods need to select ram_payer. But erase method doesn't need to select it.

I think these methods need it because these change table. So why don't need ram_payer for erase method in mulit_index class?

up vote 1 down vote accepted

The emplace and modify methods need to know who is paying for the row that is being added/modified so that their accounts can be charged. When you call erase, however, you aren't storing anything. Instead, you are removing a row. In this case, EOS already knows who paid for that row and simply refunds the RAM cost to that account when the data is erased.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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