I have some questions about the account and smart contract:

  • From google and my research, I found that one account can have only one smart contract, why?
  • It seems you can't have the same action name defined in different smart contract, does it correct?
  • When you push an action, you push the action to the account, instead of the smart contract, this look strange

I think the document in the developer side does not explain the concepts well, is there any good document recommended?

up vote 0 down vote accepted

This questions are related to each other.

1) Yes, an account can only hold 0 to 1 smart contracts. This is a design decision which makes identifying and billing for RAM, Bandwidth and CPU easier.

2) This is not correct. Two distinct accounts can have smart contracts with the same action name. However this is related to answer 1). Because if you would have two smart contracts with the same action on the same account, it would result in problems if they are not further identified.

3) This is correct. Pushing actions to an account instead of an smart contract is also a design descision. An advantage of this solution is that you can use the account's address which can be human readable like an URL. This can result in better user experience and verifying. Another point is that two accounts can deploy the same smart contract under different identities and share the code base.

Further documentation can be found in this thread or feel free to ask another question.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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