Re:Learn Ethereum smart contract programming
by anilshanbhag on Monday July 24, 2017 @08:48AM
(#14837961)
I would suggest you read the white paper (https://github.com/ethereum/wiki/wiki/White-Paper)
The short answer is contracts are accounts. Just like your normal ethereum accounts. When you invoke a method marked as payment, you are essentially transferring some ether from your account to the contract. If someone wrote contract from which you can't withdraw and you send ether to it, thats stupidity - even fiat can be destroyed by stupidity.
I see, thank you :)
Stupidity? Doesn't Ethereum want to prevent all money getting locked up somewhere?
I believe there are times when it is favorable to "burn" ether or another cryptocurrency, i.e. lock up the money in an unowned account. For example, the decentralized market place OpenBazaar discusses proof-of-burn to establish a user's reputation (https://blog.openbazaar.org/proof-of-burn-and-reputation-ple...). Burning coins allows a user to show they are invested in their reputation on the platform, without being forced to pay money to a central party.
Does this mean I will be "charged" right in the moment I "store" money in the contract?
Or does it mean I'll be charged when the contract gets "destroyed" and the money "in the contract" is sent to some address?
I'm asking because both sides have problems.
If I don't get charged when storing money in the cotract, I could spend it elsewhere until the contract resolves.
If I get charged when storing money, someone could write contracts that never resolve to purge money.