eos icon indicating copy to clipboard operation
eos copied to clipboard

Is it possible to get other contract's table in smart contract?

Open co1ingue opened this issue 8 years ago • 1 comments

contract A define a multi-indexed table , is there any way i can get it in contract B?

co1ingue avatar Oct 11 '18 08:10 co1ingue

yes, as long as you define exact the same struct. then in the constructor you need to specifies the name of other contract to replace "_self". for example table t(_self, scope) will be table t(other_contract, scope). Please also note that you can only read the data but not modify the data.

taokayan avatar Oct 11 '18 09:10 taokayan