Smart Contracts Flashcards
Encryption
Encryption ensures the privacy and security of data in smart contracts by converting information into a coded format that can only be decoded with a key.
Example - A smart contract for a financial transaction might encrypt the payment details, ensuring only the involved parties can read or modify the data.
Blockchain
Blockchain is a decentralised, distributed ledger technology that records smart contract transactions in a secure and immutable way.
Example - A smart contract for transferring ownership of an asset is recorded on the blockchain, ensuring transparency and preventing tampering.
Hexadecimal Hash
A hexadecimal hash is a unique, fixed-length string derived from data, used to verify integrity and ensure security in smart contracts.
Example - A smart contract uses a hexadecimal hash to confirm the integrity of transaction data, ensuring it hasn’t been altered.
Solidity
Solidity is a high-level programming language used to write smart contracts on the Ethereum blockchain.
Example - A smart contract for voting is written in Solidity to ensure transparent and tamper-proof election results.
If/When… Then
“If/When… Then” statements in smart contracts define conditions that trigger specific actions when certain criteria are met.
Example - A smart contract might execute a payment (Then) when the condition “If the delivery is confirmed” is met.
Testing
Testing ensures that smart contracts function correctly and securely before deployment, often using frameworks like Truffle or Hardhat.
Example - A smart contract for token transfers is tested to ensure it correctly handles transactions and prevents unauthorized access.
Gas
Gas is the fee required to execute operations on the Ethereum blockchain, paid to miners for validating smart contract transactions.
Example - Executing a smart contract to transfer tokens requires gas, which is paid in Ether, based on the complexity of the transaction.
Address Book
An address book in smart contracts stores a list of Ethereum addresses, allowing interactions like sending tokens or calling functions.
Example - A smart contract may maintain an address book to track users and their balances for a decentralised application.
Registry
A registry in smart contracts is a decentralised list that stores data (e.g., addresses, identifiers) in a secure and immutable way.
Example - A domain name system (DNS) smart contract could use a registry to store mappings of domain names to Ethereum addresses.
Artifacts.required()
artifacts.required() is a method in the Truffle framework that loads the compiled contract artifact (bytecode and ABI) to interact with a deployed smart contract.
Example - In a Truffle test, artifacts.required(‘MyContract’) loads the contract artifact for interaction in tests or migrations.
eWallets
eWallets (electronic wallets) are digital tools that store cryptocurrencies and enable transactions with smart contracts.
Example - MetaMask is an eWallet that allows users to store Ether and interact with Ethereum-based smart contracts directly from a web browser.