Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions get-details/smart-contract-details/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,32 @@ A smart contract is a computer code running on a blockchain that establishes rul

Bitcoin was the first blockchain to support basic smart contracts. Its network of nodes only validated transactions if certain conditions were met. Here, we have an example of a rudimentary smart contract, where we use Set and Get functions:

`pragma solidity 0.4.0;`\
`// Imagine a big integer that the whole world could share`\
`contract SimpleStorage {`\
`uint storedData;`\
`function set(uint x) public {`\
`storedData = x;`\
`}`\
`function get() constant public returns (uint) {`\
`return storedData;`\
`}`\
`function increment (uint n) public {`\
`storedData = storedData + n;`\
`return;`\
`}`\
`function decrement (uint n) public {`\
`storedData = storedData - n;`\
`return;`\
`}`
```solidity
pragma solidity 0.4.0;

// Imagine a big integer that the whole world could share
contract SimpleStorage {
uint storedData;

function set(uint x) public {
storedData = x;
}

function get() constant public returns (uint) {
return storedData;
}

function increment (uint n) public {
storedData = storedData + n;
return;
}

function decrement (uint n) public {
storedData = storedData - n;
return;
}
}
```

## **Key Features of Smart Contracts**

Expand Down
44 changes: 26 additions & 18 deletions get-started/smart-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,32 @@ A smart contract is a computer code running on a blockchain that establishes rul

Here, we have an example of a rudimentary smart contract, where we use Set and Get functions:

`pragma solidity 0.4.0;`\
`// Imagine a big integer that the whole world could share`\
`contract SimpleStorage {`\
`uint storedData;`\
`function set(uint x) public {`\
`storedData = x;`\
`}`\
`function get() constant public returns (uint) {`\
`return storedData;`\
`}`\
`function increment (uint n) public {`\
`storedData = storedData + n;`\
`return;`\
`}`\
`function decrement (uint n) public {`\
`storedData = storedData - n;`\
`return;`\
`}`
```solidity
pragma solidity 0.4.0;

// Imagine a big integer that the whole world could share
contract SimpleStorage {
uint storedData;

function set(uint x) public {
storedData = x;
}

function get() constant public returns (uint) {
return storedData;
}

function increment (uint n) public {
storedData = storedData + n;
return;
}

function decrement (uint n) public {
storedData = storedData - n;
return;
}
}
```

## Key Features of Smart Contracts

Expand Down