1

I was wondering what happens when a user wants to create a new instance of a contract. Is a copy of the contract created from the contract that was first created on the blockchain, but given a different address and is stored as a new contract on the blockchain? Does something change with the initial contract deployed on the blockchain?

0

Two deployments of the same contract code are unrelated.

It's analogous to installing Microsoft Word on two different computers. The same code is running in two places, but that's the extent of the connection.

  • So let's say that there is a contract for an auction already in the blockchain. If a user would like to create his own auction, he would still call the constructor from the initially deployed contract and create a copy of that contract but with his address? – anonuser1 Mar 5 '18 at 8:53
  • No, he would copy the code, paste it into Remix or the like, compile it, and deploy it. He would not interact with the other contract at all. – smarx Mar 5 '18 at 8:55
  • Ok interesting. Is it possible to make a smart contract work in a way that every user with an address uses the same contract. Like for the auction example, can a user create an auction and the auction he created is mapped to his particular address, and when another user creates an auction it is mapped to his address, without the need of creating new contracts? – anonuser1 Mar 5 '18 at 9:13
  • Yes, the EVM is Turing complete, so you can write whatever code you want in a contract. – smarx Mar 5 '18 at 9:20

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.