Smart Contracts and Solidity Programming: ECE598PV Quiz
20 Questions
6 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

ERC-20 tokens are non-fungible tokens (NFT)

False (B)

View functions can modify states or call other non-view functions

False (B)

Payable address can receive Ether

True (A)

The fallback function must be external and payable

<p>True (A)</p> Signup and view all the answers

ERC-721 is an extension of the ERC-20 interface

<p>False (B)</p> Signup and view all the answers

Decimals are used to specify how many decimal places a token has

<p>True (A)</p> Signup and view all the answers

ERC-1155 is a multi-token standard

<p>True (A)</p> Signup and view all the answers

The receive function has no function keyword, no arguments, and no return values

<p>True (A)</p> Signup and view all the answers

Event EVM logging facilities are used for ERC-20 tokens

<p>False (B)</p> Signup and view all the answers

The total token supply is calculated as the displayed amount multiplied by 10^decimals

<p>True (A)</p> Signup and view all the answers

Smart contracts were first proposed in the 1990s as a digital form of promises

<p>True (A)</p> Signup and view all the answers

Solidity is designed for Ethereum and also used by Binance Smart Chain, Avalanche, XinFin

<p>True (A)</p> Signup and view all the answers

Solidity is a dynamically-typed language

<p>False (B)</p> Signup and view all the answers

Smart contract state variables of value types are stored in the stack

<p>True (A)</p> Signup and view all the answers

Storage variables are written in the blockchain and stored permanently

<p>True (A)</p> Signup and view all the answers

Local variables of reference types in a function are stored in memory or storage

<p>True (A)</p> Signup and view all the answers

Solidity is a Turing-complete language

<p>True (A)</p> Signup and view all the answers

The cost of storing data in the memory scales quadratically per operation

<p>True (A)</p> Signup and view all the answers

Smart contracts can be modified after they are deployed

<p>False (B)</p> Signup and view all the answers

The cost of storing data in the stack is cheaper than in memory or storage

<p>True (A)</p> Signup and view all the answers

Flashcards

ERC-20 tokens are NFTs

ERC-20 tokens are fungible, not non-fungible.

View functions modify state

View functions do not modify the contract's state.

Payable address receives Ether

A payable address can receive Ether.

Fallback function is external, payable?

The fallback function must be external and payable.

Signup and view all the flashcards

ERC-721 is an extension of ERC-20

ERC-721 is a different standard for NFTs, not an extension of ERC-20.

Signup and view all the flashcards

Decimals specify token decimals

Decimals specify the number of decimal places the token has.

Signup and view all the flashcards

ERC-1155 is a multi-token standard

ERC-1155 is designed to manage multiple types of tokens.

Signup and view all the flashcards

Receive function has no keyword

The receive function has no function keyword, arguments, or return values.

Signup and view all the flashcards

Event EVM logging for ERC20

Events are not used exclusively for EVM logging for ERC-20 tokens.

Signup and view all the flashcards

Total supply from decimals

The total supply is calculated by multiplying displayed amount and 10 to the power of decimals.

Signup and view all the flashcards

Smart contracts in 1990s

Smart contracts were first proposed in the 1990s as a digital form of promises.

Signup and view all the flashcards

Solidity used by other blockchains?

Solidity, a language designed for Ethereum, is used by other blockchains like Binance Smart Chain, Avalanche, and others.

Signup and view all the flashcards

Solidity is dynamically typed

Solidity is not dynamically typed; it is statically typed.

Signup and view all the flashcards

Value types stored in stack

Smart contract state variables of value types are stored on the stack.

Signup and view all the flashcards

Storage variables are permanent

Storage variables are written to the blockchain and stored permanently.

Signup and view all the flashcards

Local variables (reference types)

Local variables of reference types in a function are stored either in memory or storage.

Signup and view all the flashcards

Solidity is Turing complete

Solidity is Turing complete, meaning it can compute anything a Turing machine can.

Signup and view all the flashcards

Memory storage cost

Storing data in memory scales quadratically per operation.

Signup and view all the flashcards

Smart contracts modifiable after deployment

Smart contracts cannot be modified after deployment.

Signup and view all the flashcards

Stack storage cost

Storing data in the stack is cheaper than in memory or storage.

Signup and view all the flashcards

Study Notes

ERC Tokens

  • ERC-20 tokens are not non-fungible tokens (NFT), they are a standard for fungible tokens.
  • ERC-721 is an extension of the ERC-20 interface.
  • ERC-1155 is a multi-token standard.

Function Types

  • View functions cannot modify states or call other non-view functions.
  • Payable address can receive Ether.
  • The fallback function must be external and payable.
  • The receive function has no function keyword, no arguments, and no return values.

Token Supply

  • Decimals are used to specify how many decimal places a token has.
  • The total token supply is calculated as the displayed amount multiplied by 10^decimals.

Smart Contracts

  • Smart contracts were first proposed in the 1990s as a digital form of promises.
  • Solidity is designed for Ethereum and also used by Binance Smart Chain, Avalanche, XinFin.
  • Solidity is a dynamically-typed language.
  • Solidity is a Turing-complete language.

Storage and Memory

  • Smart contract state variables of value types are stored in the stack.
  • Storage variables are written in the blockchain and stored permanently.
  • Local variables of reference types in a function are stored in memory or storage.
  • The cost of storing data in the stack is cheaper than in memory or storage.
  • The cost of storing data in the memory scales quadratically per operation.
  • Smart contracts cannot be modified after they are deployed.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Test your understanding of smart contracts, Solidity programming, token standards, and smart contract security with this quiz based on the principles of blockchains. Explore the basic structure of smart contracts, token standards like ERC20 and ERC721, and the lifecycle of smart contracts.

More Like This

Use Quizgecko on...
Browser
Browser