1

Can I have a main smart contrast that has many subcontracts that can be executed once they are called by other people? And the subcontracts can update the status of the main one if some conditions are satisfied?

0

I'm not quite sure what you mean by "subcontracts".

A contract can call functions on other contracts, so you can create the "subcontracts" and call their functions from the main contract, and return data if needed. The contracts that you call can also call back into the main contract to change things, and you can add any access control you'd like to this so only the "subcontracts" can update the main contracts state.

| improve this answer | |
  • Assume u have a contract that contain list of sellers. Inside this contract, we need to have another child contract that can be initialized with deposit payment from buyers and another function that validate whether the sellers provide an accurate preimage of a certain hash value. If okay, sellers will have the buyers deposit. And the number of payments of the seller can be increased in the main contact. – Mohamed Feb 22 '19 at 20:04

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.