0

when is smart contract constructor triggered for the first time? I know it is triggered every time action is pushed, but what if i want something to be triggered when smart contract is deployed for the first time? Do I need separate action for that and to keep constructor as simple as possible?

Cheers

1

I believe it is triggered when they are deployed using "set contract" on cleos.

Since there are no gas fees in EOS, it might not be a bad idea to add an initiation action for safety. However, it would require you making sure that there are no security risks and you set the right authority check in-line. They did it this way for eosbetcasino

https://gitlab.com/EOSBetCasino/eosbetdice_public/blob/master/EOSBetDice.cpp

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.