3

When different people use the same contract functionality, do they send to the same contract address? Or do they create their own new copies of the contract at a different address? If they use the same address, how does the network distinguish the different parallel usages?

1 Answer 1

2

It depends on what the contract does.

If a contract is library-like and reusable, all senders could use the same contract: a trivial example is a contract that converts temperature (between Celsius and Fahrenheit). In this example, there's no issue about parallel usage because there is no shared state: everyone will get the answer they expect. When shared state is involved, the transactions are processed in an order determined by the miner, for an illustration see: What happens when a smart contract gets several similar calls in the same block?

But for a contract like a wallet, everyone would want to create and send to their own instance of the contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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