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?


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 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.