user30815: I'm not sure whether people answers question on Ethereum here as well but just in case...

Once my smart contract is active on the Ethereum, what prevents me from modifying the contract for my own benefit? Let's say I created a crowfunding dapp which users can use on my site www.crownfunding.com. Once users are using that dapp, as a malicious guy, I could link a new smart contract to that site sending investor's money to my own account instead of using that money for the crownfunded project?
It is true? If so, what are the safeguards?
Could you tell me, in very plain words please, whether once I have created my contract code and "sent" it to the Ethereum network, I can update it? or do I have to write a new program and send it to the network (the oldest one then "dying" out of gas).


user85: Step back for a second and look at the big picture. You want my money. If I'm just willing to trust you to do the right thing with it, we don't need smart contracts. The case for smart contracts is where I'm not willing to send my money just anywhere -- I won't send it except under conditions where I am provided assurances that the money will be used as I expect it to be used.
If people trust you with their money, you can steal it. You don't need a smart contract for that. But if the sender doesn't trust you, he will insist on sending his money to a smart contract he trusts.

1 - Once my smart contract is active on the Ethereum, what prevents me from modifying the contract for my own benefit?

There is no such thing as "modifying the contract". You would just be creating some other new contract. Anyone can do that at any time, and you can do that. The trick is how you convince people to send money to the new contract.

Let's say I created a crowfunding dapp which users can use on my site www.crownfunding.com. Once users are using that dapp, as a malicious guy, I could link a new smart contract to that site sending investor's money to my own account instead of using that money for the crownfunded project? It is true? If so, what are the safeguards?

You can't send other people's money anywhere at all. Other people send their money where they want to send it. Of course if you could get people to send money anywhere you want then you can steal their money. But in that case, why use a smart contract? The whole point of a smart contract is that you can't just convince people to send money wherever you want them to, and they insist on using a smart contract to guarantee the money goes where they want.

2 - Could you tell me, in very plain words please, whether once I have created my contract code and "sent" it to the Ethereum network, I can update it? or do I have to write a new program and send it to the network (the oldest one then "dying" out of gas).

You can design a contract whose sole purpose is to decide what contract actually executes and it can use whatever rules you want make that decision. However, again, you are assuming that an attacker can get people to send money wherever he wants. If that's true, he doesn't need a smart contract to steal their money.
The whole point of smart contracts is that other people won't send money where you want them to, they'll send money only where they want to send it. And you need to provide a secure smart contract they trust for them to send money, otherwise they won't do it.

user23361: While @David's answer is correct, there is a caveat.
The likelihood is that anything other than a trivial DApp will be made of multiple co-operating contracts. Specifically, the logic and the data will live in separate contracts. This is to permit the logic contract to be logically updated (actually replaced as David explains) without losing the data. Any DAO architected this way, is effectively modifiable. 

30815: <p>I'm not sure whether people answers question on Ethereum here as well but just in case...</p>

<ol>
<li><p>Once my smart contract is active on the Ethereum, what prevents me from modifying the contract for my own benefit? Let's say I created a crowfunding dapp which users can use on my site www.crownfunding.com. Once users are using that dapp, as a malicious guy, I could link a new smart contract to that site sending investor's money to my own account instead of using that money for the crownfunded project?
It is true? If so, what are the safeguards?</p></li>
<li><p>Could you tell me, in very plain words please, whether once I have created my contract code and "sent" it to the Ethereum network, I can update it? or do I have to write a new program and send it to the network (the oldest one then "dying" out of gas).</p></li>
</ol>
 85: <p>Step back for a second and look at the big picture. You want my money. If I'm just willing to trust you to do the right thing with it, we don't need smart contracts. The case for smart contracts is where I'm not willing to send my money just anywhere -- I won't send it except under conditions where I am provided assurances that the money will be used as I expect it to be used.</p>

<p>If people trust you with their money, you can steal it. You don't need a smart contract for that. But if the sender doesn't trust you, <em>he</em> will insist on sending <em>his</em> money to a smart contract <em>he</em> trusts.</p>

<blockquote>
  <p>1 - Once my smart contract is active on the Ethereum, what prevents me from modifying the contract for my own benefit?</p>
</blockquote>

<p>There is no such thing as "modifying the contract". You would just be creating some other new contract. Anyone can do that at any time, and you can do that. The trick is how you convince people to send money to the new contract.</p>

<blockquote>
  <p>Let's say I created a crowfunding dapp which users can use on my site www.crownfunding.com. Once users are using that dapp, as a malicious guy, I could link a new smart contract to that site sending investor's money to my own account instead of using that money for the crownfunded project? It is true? If so, what are the safeguards?</p>
</blockquote>

<p>You can't send other people's money anywhere at all. Other people send their money where they want to send it. Of course if you could get people to send money anywhere you want then you can steal their money. But in that case, why use a smart contract? The whole point of a smart contract is that you can't just convince people to send money wherever you want them to, and <em>they</em> insist on using a smart contract to guarantee the money goes where <em>they</em> want.</p>

<blockquote>
  <p>2 - Could you tell me, in very plain words please, whether once I have created my contract code and "sent" it to the Ethereum network, I can update it? or do I have to write a new program and send it to the network (the oldest one then "dying" out of gas).</p>
</blockquote>

<p>You can design a contract whose sole purpose is to decide what contract actually executes and it can use whatever rules you want make that decision. However, again, you are assuming that an attacker can get people to send money wherever he wants. If that's true, he doesn't need a smart contract to steal their money.</p>

<p>The whole point of smart contracts is that other people <em>won't</em> send money where you want them to, they'll send money only where <em>they</em> want to send it. And you need to provide a secure smart contract they trust for them to send money, otherwise they won't do it.</p>
 23361: <p>While @David's answer is correct, there is a caveat.</p>

<p>The likelihood is that anything other than a trivial DApp will be made of multiple co-operating contracts. Specifically, the logic and the data will live in separate contracts. This is to permit the logic contract to be logically updated (actually replaced as David explains) without losing the data. Any DAO architected this way, is effectively modifiable. </p>
