Say a contract has money stored in it and has already been uploaded to the blockchain. If I somehow get the source code to that contract and want to deploy that myself will the money that is stored in that contract be "shared" ?



When you deploy the contract, it will get a new address (it doesn't matter here that the bytecode is the same), and therefore a new account state with its own balance.

If you ever manage to attempt to create a contract with an address that already exist, for example with the CREATE2 OPCODE from EIP-1014. EIP-684 states that the tx throws immediately. This is to ensure that one account is handled by one bytecode only and that no overwriting is possible.

Different addresses mean different account, so balance will never be shared by default. You may define a contract that explicitly delegates funds to other known contracts, but that will require some code.

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.