2 ms·
Start here https://remix.ethereum.org https://remix.ethereum.org. This IDE lets you test smrt contracts in an emulator. You can get a quick overview of solidity
by charcircuit 4y ago
Start here https://remix.ethereum.org https://remix.ethereum.org. This IDE lets you test smrt contracts in an emulator. You can get a quick overview of solidity here https://learnxinyminutes.com/docs/solidity/ https://learnxinyminutes.com/docs/solidity/ and the docs are here https://docs.soliditylang.org/en/latest/ https://docs.soliditylang.org/en/latest/
>alice and bob contract to sell 100 watermelons for 1 BTC and sarah is the arbitrator in case they have a problem... something like this
You create an owner variable that is used to show who can withdraw from the smart contract and is set to 0 at the start. You add 2 methods. The first is a method that is only usable by Sarah that lets her change the owner variable. The second is a withdraw function that is only usable by the owner. You can even enforce that the owner can only be set to Alice or Bob if you want.
Bob deposits 1 wrapped BTC. If Alice gives him the watermolens Sarah sets Alice as the owner. If Alice doesn't Sarah sets Bob as the owner.
>a smart contract to validate a sale of a house for 2 BTC.
You don't need a smart contract for that. Every transaction already gets validated by the network.
>a partnership deed for a business between alice and bob with 3 clauses
This depends on the clauses but you would put all the company assets into the smart contract and then write methods that let you spend those assets while not violating those clauses.