Smart Contracts Flashcards

1
Q

Whats is Blockchain

A

distributed database that maintains a growing list of ordered records called blocks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How are Blocks linked

A

Uisng cryptography. Each block contains a hash of the previous block, a timestamp, and transaction data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Smart Contract

A

Self-Executing contract with terms directly written into code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Smart Contract (Automation?)

A

Automatically enforces rules and conditions once pre-defined criteria are met

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Key Features (Smart Contract)

(AIDT)

A

Automation
Immutable: Once deployed, can’t be altered
Decentralised
Transparent and Secure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Smart Contract Workflow

(WDLER)

A

1: Written
2. Deploy
2: Listen
3: Execute
4: Record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Registry

A

Record of all deployed contracts, allowing access, and updates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Registry (Contains)

A

bytecode,
ABI,
developer Docs,
critical information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Registry (Available)

A

Available at runtime to all participants

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Address Book

A

Used to manage ethereum strings of Hex.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Address Book (How it works)

A

when a new instance of a user or contract is detected it is added to the book with a link to the contract.

all instances of a contract are listed and a REST API for each is auto-generated.

REST API can be used from any node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Truffle

A

Truffle is an automated testing framework to test smart contracts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Ways to write a test

A

Javascript and Typescript

Solidity

All files in ./test directory

Truffle will only run .js, .ts, .es, .es6, .jsx, and .sol.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Encryption

A

The use of a key to encode information so that it cannot be read by nodes without the corresponding decryption key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Components of smart contract

A

Pragma directive: solidity compiler version.

Contract Definition: Basic buildign block

State variables: variables

Functions: Blocks of code defining the operations and logic

Modifiers: custom conditions used to modify behaviour of functions

Events: logging mechanisms

Fallback and Receive: Special functions to handle Ether transfers

Data Types: Defines the type of variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Testing Steps
(WCTDM)

A
  1. Writing
  2. Compiling
  3. Testing
  4. Deploying
  5. Monitoring
17
Q

Truffle

A

Development framework for smart contracts.

Simplifies development.

18
Q

Benefits of Truffle
(ATM)

A

Automation: automates compiling, deployment, and testing

Testing: Provides testing frameworks (Mocha/Chai)

Migration: Helps manage contract migrations.

19
Q

Gas

A

Gas is the unit that measures the computational work required to execute transactions and smart contracts on ethereum.

20
Q

Gas (How it works)

A

Each operation costs a certain amount of Gas.

Users pay gas (Ether) to incentivize miners to process transactions.

21
Q

Gas Limit and price

A

Limit: the amount of gas a user is willing to spend

Price: the amount a user is willing to pay in ether for each unit of Gas

22
Q

Artifacts.required()

A

Helps JavaScript code find and interact with a specific smart contract that you’ve already compiled.