0
0
Blockchain / Solidityprogramming~10 mins

ERC-20 fungible token standard in Blockchain / Solidity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to declare the total supply variable in an ERC-20 token contract.

Blockchain / Solidity
uint256 public [1];
Drag options to blanks, or click blank then click option'
Aowner
Bbalance
CtotalSupply
Dallowance
Attempts:
3 left
💡 Hint
Common Mistakes
Using balance instead of totalSupply.
Using owner which is unrelated here.
2fill in blank
medium

Complete the code to declare the transfer function signature in an ERC-20 token contract.

Blockchain / Solidity
function transfer(address [1], uint256 amount) public returns (bool);
Drag options to blanks, or click blank then click option'
Ato
Brecipient
Cowner
Dspender
Attempts:
3 left
💡 Hint
Common Mistakes
Using spender which is for allowances.
Using owner which is the sender, not recipient.
3fill in blank
hard

Fix the error in the approve function signature to match the ERC-20 standard.

Blockchain / Solidity
function approve(address [1], uint256 amount) public returns (bool);
Drag options to blanks, or click blank then click option'
Aspender
Bcaller
Crecipient
Downer
Attempts:
3 left
💡 Hint
Common Mistakes
Using owner which is the token holder, not spender.
Using recipient which is not correct here.
4fill in blank
hard

Fill both blanks to complete the balanceOf function signature and return type.

Blockchain / Solidity
function balanceOf(address [1]) public view returns ([2]);
Drag options to blanks, or click blank then click option'
Aaccount
Buint256
Cbool
Daddress
Attempts:
3 left
💡 Hint
Common Mistakes
Using bool as return type instead of uint256.
Using address as return type which is incorrect.
5fill in blank
hard

Fill all three blanks to complete the transferFrom function signature and return type.

Blockchain / Solidity
function transferFrom(address [1], address [2], uint256 [3]) public returns (bool);
Drag options to blanks, or click blank then click option'
Asender
Brecipient
Camount
Dspender
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up spender with sender or recipient.
Using wrong parameter names that don't match the standard.