Challenge - 5 Problems
Smart Contract CI/CD Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of a smart contract deployment script
What is the output of this deployment script snippet when deploying a smart contract using Hardhat?
Blockchain / Solidity
const hre = require('hardhat'); async function main() { const Contract = await hre.ethers.getContractFactory('MyContract'); const contract = await Contract.deploy(); await contract.deployed(); console.log('Contract deployed to:', contract.address); } main().catch((error) => { console.error(error); process.exitCode = 1; });
Attempts:
2 left
💡 Hint
The script logs the deployed contract address on success.
✗ Incorrect
The script deploys the contract and logs its address. Option C shows the expected output format.
🔀 Workflow
intermediate2:00remaining
Correct CI/CD pipeline step order for smart contracts
Which option shows the correct order of steps in a CI/CD pipeline for smart contracts?
Attempts:
2 left
💡 Hint
Linting should happen before compilation.
✗ Incorrect
Static analysis and linting catch issues early, then compile, test, and deploy.
❓ Troubleshoot
advanced2:00remaining
Troubleshooting deployment failure due to missing private key
A CI job fails deploying a smart contract with this error: "Error: No private key provided". Which option is the most likely cause?
Attempts:
2 left
💡 Hint
Private keys are usually stored as environment variables in CI.
✗ Incorrect
The error indicates the deployer key is missing, likely due to unset environment variables.
✅ Best Practice
advanced2:00remaining
Best practice for managing secrets in smart contract CI/CD
Which option is the best practice for handling private keys and secrets in a smart contract CI/CD pipeline?
Attempts:
2 left
💡 Hint
Secrets should never be stored in code or sent insecurely.
✗ Incorrect
Using the CI secret manager keeps keys safe and accessible only during deployment.
🧠 Conceptual
expert3:00remaining
Impact of immutable smart contracts on CI/CD updates
Given that deployed smart contracts are immutable, what is the best approach to update contract logic in a CI/CD pipeline?
Attempts:
2 left
💡 Hint
Smart contracts cannot be changed once deployed.
✗ Incorrect
Because contracts are immutable, updates require deploying new contracts and redirecting usage.