0
0
Blockchain / Solidityprogramming~10 mins

Monitoring deployed contracts 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 fetch the contract address after deployment.

Blockchain / Solidity
const contractAddress = deployedContract.[1];
Drag options to blanks, or click blank then click option'
AgetAddress
Baddress
CcontractAddress
Daddr
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method instead of a property
Using incorrect property names like 'addr' or 'contractAddress'
2fill in blank
medium

Complete the code to listen for the 'Transfer' event emitted by the contract.

Blockchain / Solidity
contract.on('[1]', (from, to, amount) => { console.log(`Transfer from ${from} to ${to} of ${amount}`); });
Drag options to blanks, or click blank then click option'
AApproval
BWithdraw
CDeposit
DTransfer
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong event names like 'Deposit' or 'Withdraw'
Confusing event names with method names
3fill in blank
hard

Fix the error in the code to correctly fetch the transaction receipt after deployment.

Blockchain / Solidity
const receipt = await provider.getTransaction[1](txHash);
Drag options to blanks, or click blank then click option'
AReceiptSync
BReceiptAsync
CReceipt
DReceipts
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names like 'getTransactionReceipts' or adding 'Async' suffix
Misspelling 'Receipt'
4fill in blank
hard

Fill both blanks to create a filter for monitoring events from a specific contract address and event name.

Blockchain / Solidity
const filter = { address: '[1]', topics: [ethers.utils.id('[2]')] };
Drag options to blanks, or click blank then click option'
A0xAbC1234567890defABC1234567890DEFabc12345
BTransfer(address,address,uint256)
CApproval(address,address,uint256)
D0x0000000000000000000000000000000000000000
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero address instead of contract address
Using wrong event signature like 'Approval' when monitoring transfers
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps event names to their decoded data if the event matches a filter.

Blockchain / Solidity
const decodedEvents = events.reduce((acc, event) => { if(event.event === '[1]') { acc[event.event] = [2].[3](event.data); } return acc; }, {});
Drag options to blanks, or click blank then click option'
ATransfer
BcontractInterface
CdecodeEventLog
DApproval
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong event names like 'Approval'
Calling non-existent methods on the interface
Not matching event names correctly