0
0
Blockchain / Solidityprogramming~30 mins

Sending transactions in Blockchain / Solidity - Mini Project: Build & Apply

Choose your learning style9 modes available
Sending transactions
📖 Scenario: You are building a simple blockchain wallet app. You want to send cryptocurrency from your wallet to a friend's wallet.
🎯 Goal: Create a program that sets up a transaction with sender, receiver, and amount, configures a transaction fee, builds the transaction data, and then outputs the transaction details.
📋 What You'll Learn
Create a dictionary called transaction with keys sender, receiver, and amount with exact values
Create a variable called fee and set it to the exact value 0.001
Create a new dictionary called full_transaction that includes all keys from transaction plus the fee
Print the full_transaction dictionary
💡 Why This Matters
🌍 Real World
Sending transactions is a core part of blockchain wallets and apps. This project shows how to prepare transaction data before sending it to the blockchain network.
💼 Career
Blockchain developers and engineers often need to build and manage transaction data structures to interact with blockchain networks securely and correctly.
Progress0 / 4 steps
1
Create the initial transaction data
Create a dictionary called transaction with these exact entries: 'sender': '0xABC123', 'receiver': '0xDEF456', and 'amount': 10.
Blockchain / Solidity
Need a hint?

Use curly braces to create a dictionary with the keys and values exactly as shown.

2
Set the transaction fee
Create a variable called fee and set it to the float value 0.001.
Blockchain / Solidity
Need a hint?

Just assign the number 0.001 to the variable named fee.

3
Build the full transaction data
Create a new dictionary called full_transaction that contains all keys and values from transaction plus a new key 'fee' with the value from the variable fee.
Blockchain / Solidity
Need a hint?

Use dictionary unpacking {**transaction, 'fee': fee} to add the fee key.

4
Print the full transaction
Write a print statement to display the full_transaction dictionary.
Blockchain / Solidity
Need a hint?

Use print(full_transaction) to show the transaction details.