A 3-minute Smart Contract and Delphi — Part 1

  1. Alice has zero Bitcoin
  2. Bob has 1 Bitcoin
  3. Bob transfers 1 Bitcoin to Alice
  4. Alice has 1 Bitcoin
  5. Bob has zero Bitcoin

Code is law

Smart Contracts are written in a Turing complete programming language called Solidity. By contrast, Bitcoin is not Turing complete. If you want to do something a hundred times on the Bitcoin blockchain, you would have to copy and paste a transaction a hundred times, while in Ethereum you could just write it once and tell the computer to execute it in a loop.

Remix

In this article, we will develop our first Smart Contract using Remix.

https://remix.ethereum.org

Delphi

We will now turn our attention to Delphi. Before we begin, we need to clone a few GitHub repositories.

git clone https://github.com/svanas/DelphiBigNumbers
git clone https://github.com/Xor-el/SimpleBaseLib4Pascal
git clone https://github.com/Xor-el/HashLib4Pascal
git clone https://github.com/Xor-el/CryptoLib4Pascal
git clone https://github.com/svanas/delphereum
  1. replace the URL in the example above with your Infura endpoint. If you are unsure what an Infura endpoint is, then please refer to this article.
  2. replace the smart contract address in the example above with your own smart contract address (copied to your clipboard in step #22 above).

Read more

  1. Connecting Delphi to a local (in-memory) blockchain
  2. Connecting Delphi to the Ethereum main net
  3. Connecting Delphi to Smart Contracts
  4. Generating an Ethereum-signed message signature in Delphi
  5. Transferring Ether with Delphi
  6. Transferring ERC-20 tokens with Delphi
  7. Delphi and Ethereum Name Service (ENS)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Stefan

Stefan

Delphi/Rust/Go developer. Ethereum consultant. Embarcadero MVP. Ex-Adobe, Macromedia. Helped build 1Password.