eos icon indicating copy to clipboard operation
eos copied to clipboard

How to setup a action that adopt multisig with a random account and my account

Open y001j opened this issue 8 years ago • 3 comments

I am working on a contract programing. but I need to apply multi-signature for execution of an action. How can I set the action that need one or more users to authorize it and multisig with my own account, and then the action will finally be executed.

y001j avatar Aug 20 '18 03:08 y001j

you can try use void require_auth( account_name name );

firesWu avatar Aug 20 '18 05:08 firesWu

Thx, but void require_auth( account_name name ); does not resolve my problem. I expect user authorize the action first or propose the action. then I use my own account to authorize the action to make it executed. I know that we can use cleos multisig delegate authorization to propose multi-sig action, but if we can implement it in a contract action code?

y001j avatar Aug 20 '18 06:08 y001j

There're couple of possible solutions:

a) in your action you can call "require_auth" for different user names. In this case you need to use close multisig to propose an action and let users to approve it before you can execute it.

b) If the action you want to execute is also within your contract, you can make another action say "approve" to store the approving user into your multi_index table. Then when your real action is executed, you can validate which user has approved from your multi_index table.

taokayan avatar Aug 20 '18 08:08 taokayan