Challenge - 5 Problems
Blockchain Dev Tools Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:30remaining
Output of Hardhat compile command
What is the expected output when you run
npx hardhat compile in a new Hardhat project with a valid contracts/ folder containing Solidity files?Attempts:
2 left
💡 Hint
Think about what happens when you compile Solidity contracts with Hardhat.
✗ Incorrect
When you run
npx hardhat compile with valid Solidity files, Hardhat compiles them and saves the output artifacts. If no errors occur, it confirms successful compilation.❓ Predict Output
intermediate1:30remaining
Remix IDE Solidity compilation result
In Remix IDE, after writing a valid Solidity contract and clicking the Compile button, what is the expected result shown in the Compile tab?
Attempts:
2 left
💡 Hint
Remix compiles Solidity code directly in the browser.
✗ Incorrect
Remix compiles Solidity contracts in-browser and shows success if code is valid. It does not require external nodes to compile.
🧠 Conceptual
advanced2:00remaining
Hardhat network configuration for local testing
Which Hardhat configuration snippet correctly sets up a local network named 'localhost' on port 8545 for testing?
Attempts:
2 left
💡 Hint
Hardhat uses a URL string to specify network endpoints.
✗ Incorrect
Hardhat network configuration requires a URL key with the full HTTP address including port. Other keys like host or port alone are invalid.
🔧 Debug
advanced2:00remaining
Identify the error in Hardhat config file
Given this Hardhat config snippet, what error will occur when running
npx hardhat compile?
module.exports = {
solidity: "0.8.18",
networks: {
localhost: {
url: "http://127.0.0.1:8545",
}
},
// missing comma here
paths: {
sources: "./contracts"
}
};Attempts:
2 left
💡 Hint
Check punctuation between object properties in JavaScript objects.
✗ Incorrect
In JavaScript objects, properties must be separated by commas. Missing a comma causes a SyntaxError.
🚀 Application
expert3:00remaining
Deploying a contract using Hardhat script
Which script correctly deploys a Solidity contract named
MyToken using Hardhat and logs the deployed address?Attempts:
2 left
💡 Hint
Remember to await deployment and the deployed promise before accessing the address.
✗ Incorrect
The correct deployment script awaits the contract factory, deploys the contract, waits for deployment to finish, then logs the address. Missing awaits or async cause errors or undefined addresses.