Skip to content

Commit

Permalink
Textual corrections (ethereumbook#462)
Browse files Browse the repository at this point in the history
* Use 'third party' instead of 'third-party'

* Use 'Turing complete' instead of 'Turing-complete'

* Added missing comma

* Removed comma

* Use 'high-level language' consistently instead of 'high level language'

* Use 'side effect' consistently instead of 'side-effect'

* Added missing period

* Use 'Ethereum' instead of 'ethereum'

* Use 'Solidity' instead of 'solidity'

* Textual corrections
  • Loading branch information
drmartinberger authored and aantonop committed Apr 10, 2018
1 parent eaa4f2f commit e104ffc
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 91 deletions.
2 changes: 1 addition & 1 deletion appdx-standards-eip-erc.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ image::images/eip_workflow.png["Ethereum Improvement Proposal Workflow"]
| https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md[EIP-20] | ERC-20 Token Standard. Describes standard functions a token contract may implement to allow DApps and Wallets to handle tokens across multiple interfaces/DApps. Methods include: `totalSupply()`, `balanceOf(address)`, `transfer`, `transferFrom`, `approve`, `allowance`. Events include: `Transfer` (triggered when tokens are transferred), `Approval` (triggered when `approve` is called). | Fabian Vogelsteller, Vitalik Buterin | ERC | Final | Frontier
| https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md[EIP-55] | ERC-55 Mixed-case checksum address encoding | Vitalik Buterin | ERC | Final |
| https://github.com/ethereum/EIPs/blob/bd136e662fca4154787b44cded8d2a29b993be66/EIPS/abstraction.md[EIP-86] | Setting the stage for "abstracting out" account security, and allowing users creation of "account contracts" toward a model where in the long-term all accounts are contracts that can pay for gas, and users are free to defined their own security model (that perform any desired signature verification and nonce checks instead of using the in-protocol mechanism where ECDSA and default nonce scheme are the only "standard" way to secure an account, which is currently hard-coded into transaction processing). | Vitalik Buterin | Core | Deferred (to be replaced) | Constantinople
| https://github.com/ethereum/EIPs/pull/210[EIP-96] | Setting the Blockhash and state root refactoring to store blockhashes in the state to reduce protocol complexity and need for client implementation complexity necessary to process the `BLOCKHASH` opcode. Extends range of how far back blockhash checking may go, with the side-effect of creating direct links between blocks with very distant block numbers to facilitate much more efficient initial Light Client syncing. | Vitalik Buterin | Core | Deferred | Constantinople
| https://github.com/ethereum/EIPs/pull/210[EIP-96] | Setting the Blockhash and state root refactoring to store blockhashes in the state to reduce protocol complexity and need for client implementation complexity necessary to process the `BLOCKHASH` opcode. Extends range of how far back blockhash checking may go, with the side effect of creating direct links between blocks with very distant block numbers to facilitate much more efficient initial Light Client syncing. | Vitalik Buterin | Core | Deferred | Constantinople
| https://github.com/ethereum/EIPs/issues/100[EIP-100] | Change formula that computes the difficulty of a block (difficulty adjustment algorithm) to target mean block time and take uncles into account. | Vitalik Buterin | Core | Final | Metropolis Byzantinium
| https://github.com/ethereum/EIPs/blob/master/EIPS/eip-101.md[EIP-101] | Serenity Currency and Crypto Abstraction. Abstracting Ether up a level with the benefit of allowing Ether and sub-Tokens to be treated similarly by contracts, reducing level of indirection required for custom-policy accounts such as Multisigs, and purifying the underlying Ethereum protocol by reducing the minimal consensus implementation complexity | Vitalik Buterin | Active | Serenity feature | Serenity Casper
| https://blog.ethereum.org/2016/03/05/serenity-poc2/[EIP-105] | "Sharding scaffolding" EIP to allow Ethereum transactions to be parallelised using a binary tree sharding mechanism, and to set the stage for a later sharding scheme. Research in progress: https://github.com/ethereum/sharding | Vitalik Buterin | Active | Serenity feature | Serenity Casper
Expand Down
2 changes: 1 addition & 1 deletion clients.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ Status:: A mobile wallet and DApp browser, with support for a variety of tokens

Trust Wallet:: A mobile Ethereum, Ethereum Classic wallet that supports ERC20, and ERC223 tokens. Trust Wallet is available for iOS and Android smartphones. Find it at https://trustwalletapp.com/

Cipher Browser:: a full-featured Ethereum-enabled mobile DApp browser and wallet. Allows integration with ethereum apps and tokens.
Cipher Browser:: a full-featured Ethereum-enabled mobile DApp browser and wallet. Allows integration with Ethereum apps and tokens.

[[browser_wallets]]
=== Browser wallets
Expand Down
103 changes: 51 additions & 52 deletions contrib/angular4-truffle.asciidoc
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
== Introduction

Let's build an end to end Application using truffle ,Angular JS 4 and finally we will see
Let's build an end to end Application using Truffle, Angular JS 4 and finally we will see
everything in action.

=== Use case
=== Use case

We will create a smart Contract named `TransferToFriend` whereby:
We will create a smart contract named `TransferToFriend` whereby:

1. There are 2 friends named John and Ram.
2. We can see balance of the person(lets say John) sending money to other(lets say Ram) in Web UI.
3. Web UI should be able to have fields like the amount to be sent and address of the recipient along with Send Button.
1. There are two friends named John and Ram.
2. We can see the balance of the person (lets say John), sending money to the other (lets say Ram) in the Web UI.
3. The Web UI should be able to have fields like the amount to be sent and address of the recipient along with a Send Button.


=== Environment Pre-Requisites
=== Environment Prerequisites

1. Install latest Node version.
2. Install Truffle.
Expand Down Expand Up @@ -51,7 +51,7 @@ $ mkdir TransferToFriend
$ cd TransferToFriend
----

- Intiate a truffle project and verify it contents.
- Initiate a Truffle project and verify it contents.

----
$ truffle init
Expand All @@ -75,17 +75,17 @@ $ cd contracts\
$ touch TransferToFriend.sol
----

- Replace the below solidity code into `TransferToFriend.sol`.
- Place the below Solidity code into `TransferToFriend.sol`.

----
pragma solidity ^0.4.17;
contract TransferToFriends {
address public owner;
address public owner;
//This map stores address and friend details.
mapping(address => uint) public amountFriendMap;
//Set the owner address while creating a contract.
function TransferToFriends() public {
owner = msg.sender;
Expand All @@ -95,33 +95,33 @@ contract TransferToFriends {
event LogSentAmount(address from, uint value, address friendAddress);
//This event get dispatched once the amount is withdrwan
event LogWithDrawal(address withdrawAddress,uint value);
function sendAmount (address friendAddress) public payable {
//Verify that amount sent and friendAddress are not blank.
require(msg.value>0 && friendAddress!=address(0));
//Add the amount and friendAddress to map.
amountFriendMap[friendAddress] += msg.value;
//Send a log event
//Send a log event
LogSentAmount(msg.sender, msg.value, friendAddress);
}
//Withraw Pull pattern
function withdraw() public {
//Check if the amount is present and greater than zero for the address who intiated this function.
require(amountFriendMap[msg.sender]>0);
uint amount = amountFriendMap[msg.sender];
//Change state of contract before tranfser
amountFriendMap[msg.sender] = 0;
//Send the amount
msg.sender.transfer(amount);
//Emit event
LogWithDrawal(msg.sender,amount);
Expand All @@ -131,8 +131,8 @@ contract TransferToFriends {
----

- Now that our smart contract is completed. we need to write a migration script so that we can migrate it
using truffle. Go to migrations folder. Create a new migration script named `2_initial_migration.js`
- Now that our smart contract is completed, we need to write a migration script so that we can migrate it
using Truffle. Go to migrations folder. Create a new migration script named `2_initial_migration.js`

----
$ pwd
Expand All @@ -147,14 +147,14 @@ $touch 2_initial_migration.js
//Importing the contract
var TransferToFriends = artifacts.require("./TransferToFriends.sol");
//while we use truffle migrate we are letting it know to deploy this contract as well.
//while we use Truffle migrate we are letting it know to deploy this contract as well.
module.exports = function(deployer) {
deployer.deploy(TransferToFriends);
};
----


- Now that we wrote our contract and migration script. We are ready to deploy it into testnet or private chain.
- Now that we wrote our contract and migration script, we are ready to deploy it into testnet or private chain.
Open truffle.js and replace it with below content.

----
Expand All @@ -168,8 +168,8 @@ module.exports = {
// to customize your Truffle configuration!
networks: {
development: {
host: "0.0.0.0",//If your using truffle testnet or ganache then replace it with local ip or localhost.
port: 8545, // Port number on which the private or test net is hosted on.
host: "0.0.0.0",//If your using Truffle testnet or ganache then replace it with local ip or localhost.
port: 8545, // Port number on which the private or testnet is hosted on.
gas: 550000, //Provide necessary gas
network_id: "*" // Match any network id
}
Expand All @@ -187,8 +187,8 @@ Compiling ./contracts/TransferToFriends.sol...
Writing artifacts to ./build/contracts
----

- Now deploy the contract . In this case we will use truffle test net.Feel free to deploy to
any private or test net of your choice.
- Now deploy the contract. In this case we will use Truffle test net. Feel free to deploy to
any private or testnet of your choice.

----
$ truffle developer
Expand Down Expand Up @@ -220,14 +220,14 @@ Private Keys:
Mnemonic: candy maple cake sugar pudding cream honey rich smooth crumble sweet treat
truffle(develop)>
truffle(develop)>
----

- Truffle opens a developer console and gives us a test net at http://localhost:9545/ .Go back
and verify the host and port number in truffle.js if truffle test net is used for deploy.
- Truffle opens a developer console and gives us a testnet at http://localhost:9545. Go back
and verify the host and port number in truffle.js if Truffle testnet is used for deploy.

- Now we will deploy the contract in test net using `migrate --reset` command.A successful
deploy should look like below.
- Now we will deploy the contract in testnet using `migrate --reset` command. A successful
deployment should look as follows:

----
truffle(develop)> migrate --reset
Expand All @@ -251,9 +251,9 @@ Saving artifacts...

- Give yourself a pat as we successfully wrote and deployed our contract.

- Let's quickly test our deployed contract.
- Let's quickly test our deployed contract.

- Create three variables namely in truffle testnet and verify.
- Create three variables namely in Truffle testnet and verify.
`fromAddress` - address used to transfer ether/
`friendAddress` - destination account.
`etherToSent` - value intended to be sent.
Expand All @@ -274,15 +274,15 @@ truffle(develop)> etherToSpent
----

- Invoke the sendAmount function and send 10 ether to friendAddress and verify the LogSentAmount
that event got generated.
NOTE:The transaction object can be verified as well.
that event got generated.
NOTE: The transaction object can be verified as well.

----
truffle(develop)> TransferToFriends.deployed().then(ins => ins.sendAmount(friendAddress,{from:fromAddress,value:etherToSpent})).then(transaction => transaction.logs[0].args)
{ from: '0x627306090abab3a6e1400e9345bc60c78a8bef57',
value: BigNumber { s: 1, e: 19, c: [ 100000 ] },
friendAddress: '0xf17f52151ebef6c7334fad080c5704d77216b732' }
----
----

- Invoke the withdraw function from friendAddress and verify LogWithDrawal event.

Expand All @@ -294,15 +294,15 @@ truffle(develop)> TransferToFriends.deployed().then(ins => ins.withdraw({from:fr

- Now that we verified the functionality is working fine we will switch to angular to create UI.

- Exit from the truffle developer console. (UNIX : Press `Ctrl+C` for two times to exit)
- Exit from the Truffle developer console. (UNIX : Press `Ctrl+C` for two times to exit)

- Go Back to folder where our `TransferToFriends` folder exists. In this case it is present
under `DAPPS` folder and create a new angular app with same name `TransferToFriends`.

----
$ cd ..
$ ls
$ ls
$ TransferToFriends
$ ng new TransferToFriends
// Successful log
Expand All @@ -326,7 +326,7 @@ contracts karma.conf.js node_modules package-lock.json README.md t

----
$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/
webpack: Compiled successfully.
----
Expand All @@ -335,9 +335,9 @@ webpack: Compiled successfully.

- Open a new terminal in current path and go to `src/app` folder and open `app.component.html`.
- Create two input text boxes.
- Amount
- Amount
- Friend Address
- Create a form to wrap up above parameters along with `send()` function attached Send button.
- Create a form to wrap up above parameters along with `send()` function attached Send button.
- Once done the code for `app.component.html` should look something similar to below.

----
Expand Down Expand Up @@ -384,7 +384,7 @@ webpack: Compiled successfully.
>
</p>
</div>
<div class="field is-grouped">
<p class="control">
<button
Expand Down Expand Up @@ -443,7 +443,7 @@ the below css link.

- Wait for the browser to refresh and now you have some css look.

- Let's plumb in some type script to make our HTML functional. Open `app.component.ts`
- Let's plumb in some type script to make our HTML functional. Open `app.component.ts`
and code to receive the fields and functionality to `send()` function created.

----
Expand All @@ -464,7 +464,7 @@ export class AppComponent {
balance: number;
sendingAmount: number;
status: string;
transactionHash: string;
Expand Down Expand Up @@ -525,7 +525,7 @@ export class Web3Service {

public web3: any;

constructor() {
constructor() {
this.checkAndInstantiateWeb3();
}

Expand Down Expand Up @@ -608,15 +608,15 @@ export class TransferToFriendsService {

constructor(
private web3Ser: Web3Service,
) {
) {
// Bootstrap the TransferToFriends abstraction for Use
this.TransferToFriends.setProvider(web3Ser.web3.currentProvider);
}

send(from,amount,friend): Observable<any>{

let transfer;

return Observable.create(observer => {
this.TransferToFriends
.deployed()
Expand Down Expand Up @@ -711,7 +711,6 @@ export class AppComponent {
//TODO:While moving to DAPPS this needs to linked properly
image::/images/TransferToFriend.gif["Transfer To Friends In Action"]
- Hurray !!! we completed our TransferToFriends project.
- Hurray !!! we completed our TransferToFriends project.
2 changes: 1 addition & 1 deletion contrib/google-cloud-testnet.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Puppeth is a powerful devops tool which allows for rapid deployment of a private
* a dashboard for navigating all the above components


The following are instructions for setting up a private ethereum test network on
The following are instructions for setting up a private Ethereum test network on
google cloud.

## Architecture
Expand Down
4 changes: 2 additions & 2 deletions contrib/web3-contract-basic-interaction-async-await.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ This script is for educational use and is based on [email protected] web3.js ve

It should be see as an introduction to web3.js.

The web3.js library is a collection of modules which contain specific functionality for the ethereum ecosystem.
The web3.js library is a collection of modules which contain specific functionality for the Ethereum ecosystem.

The web3.js object is an umbrella package to house all ethereum related modules.
The web3.js object is an umbrella package to house all Ethereum related modules.

This is the Ethereum compatible JavaScript API which implements the Generic JSON RPC spec.

Expand Down
4 changes: 2 additions & 2 deletions contrib/web3-contract-basic-interaction.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ This script is for educational use and is based on [email protected] web3.js ve

It should be see as an introduction to web3.js.

The web3.js library is a collection of modules which contain specific functionality for the ethereum ecosystem.
The web3.js library is a collection of modules which contain specific functionality for the Ethereum ecosystem.

The web3.js object is an umbrella package to house all ethereum related modules.
The web3.js object is an umbrella package to house all Ethereum related modules.

This is the Ethereum compatible JavaScript API which implements the Generic JSON RPC spec.

Expand Down
8 changes: 4 additions & 4 deletions dapps.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ TODO: add paragraph
[[live_dapps_chap]]
== Live Dapps

Here are listed different live Dapps on the ethereum network:
Here are listed different live Dapps on the Ethereum network:

////
TODO: add paragraph
////

[[ethpm_sec]]
=== EthPM
A project aimed at bringing package management to the ethereum ecosystem.
A project aimed at bringing package management to the Ethereum ecosystem.

Website link; https://www.ethpm.com/

Expand All @@ -205,7 +205,7 @@ Website link; https://radarrelay.com/

[[cryptokitties_sec]]
=== CryptoKitties
A game deployed on ethereum that allows players to purchase, collect, breed and sell various types of virtual cats
A game deployed on Ethereum that allows players to purchase, collect, breed and sell various types of virtual cats
It represents one of the earliest attempts to deploy blockchain technology for recreational and leisurely purposes.

Website link; https://www.cryptokitties.co
Expand All @@ -218,6 +218,6 @@ Website link; https://ethlance.com/

[[decentraland_sec]]
=== Decentraland
Decentraland is a virtual reality platform powered by the ethereum blockchain. Users can create, experience, and monetize content and applications.
Decentraland is a virtual reality platform powered by the Ethereum blockchain. Users can create, experience, and monetize content and applications.

Website link; https://decentraland.org/
2 changes: 1 addition & 1 deletion devp2p-protocol.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The *"reason"* parameter can take values from `0x00` to `0x10`, e.g. `0x00` repr
==== Status - Ethereum sub-protocol example
This sub-protocol is identified by the `+0x00` message-id.

This message should be sent after the initial handshake and prior to any ethereum related messages and inform of its current state.
This message should be sent after the initial handshake and prior to any Ethereum related messages and inform of its current state.

To do this, the node disclose to its peer the following data;

Expand Down
Loading

0 comments on commit e104ffc

Please sign in to comment.