eos icon indicating copy to clipboard operation
eos copied to clipboard

meaning of multi_index's constructor

Open GeneSourceCode opened this issue 8 years ago • 4 comments

what is the exact meaning of the code and scope as the arguments of multi_index's constructor. Is the owner the creater of the table which is also the account which the contract is set to? what is scope for? Please inform me, thx

GeneSourceCode avatar Jun 08 '18 07:06 GeneSourceCode

Does Multi-Index Constructor help?

spartucus avatar Jun 11 '18 03:06 spartucus

@spartucus i do not understand the purpose of scope. is the scope to divide the table into several subtable? can scope be any domain even not a member of the class underlying the multi_index table.

GeneSourceCode avatar Jun 14 '18 22:06 GeneSourceCode

will the available primary keys in different scope collide with each other? if i want to move one item from one scope to the other, do i need to reassign the primary key value with available primary key?

GeneSourceCode avatar Jun 14 '18 22:06 GeneSourceCode

the tuple (code, scope, table name) is the unique identifier for the table. Code is the owner(contract account name) of the table who has permission to create/modify/delete the table. Scope can be anything of type uint64_t.

taokayan avatar Jun 25 '18 09:06 taokayan