From 0372d493999431332411b613781b8726cf2af822 Mon Sep 17 00:00:00 2001 From: Alexandre Ferreira Date: Wed, 11 Jan 2023 19:23:18 +0000 Subject: [PATCH] chore: fix code highlights for smart-contract's guides Signed-off-by: Alexandre Ferreira --- get-details/smart-contract-details/README.md | 44 ++++++++++++-------- get-started/smart-contracts.md | 44 ++++++++++++-------- 2 files changed, 52 insertions(+), 36 deletions(-) diff --git a/get-details/smart-contract-details/README.md b/get-details/smart-contract-details/README.md index de77e29d..25146f76 100644 --- a/get-details/smart-contract-details/README.md +++ b/get-details/smart-contract-details/README.md @@ -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** diff --git a/get-started/smart-contracts.md b/get-started/smart-contracts.md index df508724..e4ae1770 100644 --- a/get-started/smart-contracts.md +++ b/get-started/smart-contracts.md @@ -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