0
0
Blockchain / Solidityprogramming~10 mins

Why deployment process matters in Blockchain / Solidity - Test Your Understanding

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

Complete the code to deploy a smart contract using a deployment function.

Blockchain / Solidity
contract = [1]('MyContract')
Drag options to blanks, or click blank then click option'
Atest
Bcompile
Cdeploy
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using compile instead of deploy
Trying to run the contract directly
Confusing test with deploy
2fill in blank
medium

Complete the code to wait for the deployment transaction to be confirmed.

Blockchain / Solidity
tx_receipt = tx.wait([1])
Drag options to blanks, or click blank then click option'
A1
B10
C5
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Waiting for 0 confirmations which means no confirmation
Waiting for too many confirmations unnecessarily
3fill in blank
hard

Fix the error in the deployment code by choosing the correct network parameter.

Blockchain / Solidity
network = [1]  # Choose the correct network for deployment
Drag options to blanks, or click blank then click option'
A'devnet'
B'mainnet'
C'localhost'
D'testnet'
Attempts:
3 left
💡 Hint
Common Mistakes
Deploying to testnet when real deployment is needed
Using localhost which is only for local testing
4fill in blank
hard

Fill both blanks to set the gas limit and gas price for deployment.

Blockchain / Solidity
tx = contract.deploy(gas=[1], gasPrice=[2])
Drag options to blanks, or click blank then click option'
A3000000
B1000000000
C500000
D2000000000
Attempts:
3 left
💡 Hint
Common Mistakes
Setting gas limit too low causing deployment failure
Using incorrect gas price units
5fill in blank
hard

Fill all three blanks to create a deployment script that compiles, deploys, and waits for confirmation.

Blockchain / Solidity
compiled = compiler.compile('[1]')
contract = blockchain.deploy(compiled)
tx_receipt = contract.tx.wait([2])
print('Contract deployed at:', contract.[3])
Drag options to blanks, or click blank then click option'
AMyContract.sol
B1
Caddress
DMyContract.py
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong file extension for the contract source
Not waiting for any confirmation
Printing an incorrect property instead of address