EOS.IO Asked by josh arnet on August 20, 2021
When I try to put 2 authorities to updateauth I get this error
Error: updateauth action should only have one declared authorization
so how can I use another accounts CPU to change my keys not using bloks.io or another portal. I just want to use my accounts. On one I have resources, the other one doesn’t!
Thanks in advance
If you are doing the transaction with cleos
then you can just do this:
cleos push action CONTRACT ACTION DATA -p ACCOUNT1 -p ACCOUNT2
In this example, ACCOUNT1
will pay for the resources
Answered by Phillip Hamnett - EOS42 on August 20, 2021
You can refer to how bloks.io does. They use dummy action payforcpu
and include it as the first action of free transaction. (Transaction can have multiple actions) You can make dummy action with any name, and include signature with the account which you want to make pay resources.
eosjs may check whether dummy action exists in contract ABI, so you need to deploy contract with dummy action, or write transaction by yourself and sign manually.
actions: [{
account: "SOME_ACCOUNT",
name: "payforcpu",
authorization: [{
actor: "ACCOUNT_YOU_WANT_TO_MAKE_PAY",
permission: "active",
}],
data: {
/* ... */
},
}, {
account: "eosio",
name: "updateauth",
authorization: [{
/* ... */
}],
data: {
/* ... */
}
}]
Answered by conr2d on August 20, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP