eos icon indicating copy to clipboard operation
eos copied to clipboard

How can I change the authority of user account in contract?

Open yang24201 opened this issue 8 years ago • 1 comments

I'm trying to change the authority of user account in my contract. I found that there is an updateauth function in contract/eosio.system/native.hpp, but the definition of the function is empty. Is this function not finished yet? Is there any other method to change the authority?

yang24201 avatar Jul 19 '18 17:07 yang24201

updateauth function is a native eosio function and its implementation could be found inside libraries/chain/eosio_contract.cpp. Anything that is written inside native.hpp is the extra handler after the handler inside eosio_contract.cpp is executed. You can find the corresponding abi structure for updateauth and other native eosio function inside libraries/chain_eosio_contract_abi.cpp.

If you are using cleos, you can just use cleos set account permission ... instead since it will help you to wrap the updateauth function nicely so you don't need to construct it by yourself. Otherwise you can still use cleos push action eosio updateauth ... if you want to construct it by yourself.

andriantolie avatar Jul 20 '18 02:07 andriantolie