I have deployed a contract. and I am confused about the fees:

Do I still need to pay for resources such as RAM and CPU for actions like emplace and modify after I deployed a contract? Or can I just let it go and let the players to deal with the RAM things?

  • No need to excuse yourself for being new :-) Could you please tidy up your question? You can structure your question with bold headers like "Background", "Question", "Update",.. but usually not for several sentences. – friedger Oct 25 '18 at 7:56

Depends on code if you have set ram payer for multi_indexed table as self then you need to pay for that ram(whenever emplace implemented, No RAM for modifying) and if you have set players as RAM payer then you don't need to pay for RAM.

For example in code

in this case you became payer of RAM.

orders.emplace( self, [&]( auto& o ) {
  o.id = 1;
  o.expiration = 300;
  o.owner = N(dan);

in this case player will become payer of RAM.

orders.emplace(_user , [&]( auto& o ) {
  o.id = 1;
  o.expiration = 300;
  o.owner = N(dan);
| improve this answer | |
  • thanks! thanks! one more question, here is what i think: i can initial like this [ gameTable(receiver,receiver.value) ] when some player calling the function transfer, i can redefine the payer like: ``` gameTable.emplace(from, [&](auto &p) { p.key = _currentbets.available_primary_key(); ... }); ``` im i right ? – liu Rick Oct 25 '18 at 7:57
  • 1
    @Mr.Y It is not true that the scope of the table defines who is paying RAM. It is about the payer argument in emplace, modify methods. See here: eosio.stackexchange.com/questions/594/… – friedger Oct 25 '18 at 8:39
  • edited my answer and this is from eos's official doc – Mr.Y Oct 25 '18 at 8:44
  • @friedger Scope has nothing to do with RAM payments, see eosio.stackexchange.com/questions/3534/… – Phillip Hamnett - EOS42 Dec 22 '18 at 9:50
  • @PhillipHamnett-EOS42 This is what I wanted to say. The payer argument is the relevant part. – friedger Dec 23 '18 at 10:04

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.