Skip to content

storing and getting structs #445

Discussion options

You must be logged in to vote

if the struct is stored in caller - move_to(caller, Config { admin: caller_addr });, how is it retreived from module address? let config = borrow_global(@aptogotchi);. Are caller/module address same? in that case, isn't admin just aptogotchi??

init_module is called on publishing of a module, with the publisher's signer. The publisher's address is the same address as the module (in this case aptogotchi), so they are the same address.

And yes, in this case admin is @aptogotchi, but it could be changed to something else.

why does Config has copy, drop, shouldn't it have key as it is stored in an address?

This one should most certainly have key, I'm guessing it was inconsistent cc @0xaptosj

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@0xaptosj
Comment options

Answer selected by enderNakamoto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants