I'm trying to make something similar to alien worlds, how can I transfer tokens from the contract to the user but have the resource costs go to the user using EOSJS?
1 Answer
please consult this documentation page, it should answer your question: https://developers.eos.io/manuals/eosio.cdt/latest/features/resource_payer
an alternative is via noops and ONLY_BILL_FIRST_AUTHORIZER upgrade protocol feature. you can read about it here: https://cmichel.io/eosio-how-to-pay-for-users-cpu/
-
1Thanks for your answer! So that's the only way? I have actually read about it and have tried it but the testnet doesn't seem to support it yet. I actually asked about the resource payer a few weeks ago: eosio.stackexchange.com/questions/6023/… and I got to know that testnets do not support this yet so I was wondering how others handled it when resource_payer feature wasn't in yet. Thanks for the help! Commented Aug 5, 2021 at 14:43
-
1
-
1Thank you very much for your answer, I'll try it out, have an awesome day, awesome person! :) Commented Aug 6, 2021 at 2:52
-
Hi @ovi, I tried your suggestion but what I really wanted was to have the users pay for the cpu and the account in the server will transfer tokens to the user. I have tried reversing it but the problem is that I just can't get to make the signatures work together (I'm using UAL with react). Do you have some suggested resources for this? I've spent around 8+ hours trying to find a solution but I couldn't make it work, sorry for bugging you and thank you again! Commented Aug 6, 2021 at 15:45
-
hi @JesseDwight I am not sure I fully understand your problem you try to solve. I see now you are talking about UAL and client side implementation. you can try to formulate a more elaborate text for your problem and post it in the EOSIO dev telegram channel t.me/joinchat/0uhWYfXVpPlkNTA1– oviCommented Aug 9, 2021 at 11:21