Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles.
A block of code is set as follows:
pragma solidity ^0.8.0; contract MyContract { uint256 public value = 10; bool public isGreater = value > 5; }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
contract BadAccessControl { address public owner; constructor() { owner = tx.origin; } function sensitiveFunction() public { require(tx.origin == owner, "BadAccessControl: Not authorized");// Sensitive code } }
Any command-line input or output is written as follows:
contract MultiSigWallet { uint minApprovers; address payable dealProposer; address payable beneficiary; mapping (address => bool) approvedBy; mapping (address => bool) isApprover; uint approvalsNum;
Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Once you’ve signed up for an Infura account, you can create a new project by clicking on the Create New Project button on the dashboard.”
Tips or important notes
Appear like this.