Technical Crypto OSStage 2 · Smart Contract Engineering
Introduction to Stage 2
Smart Contract Engineering. Write, test, and deploy working contracts on EVM and Solana.
The questions this stage addresses
This stage focuses on three fundamental differences between contracts and ordinary backend code:
- Public: Anyone can call any entry point, so every public function is an attack surface.
- Immutable: You cannot change deployed code unless you designed an upgrade path in advance, and that path introduces its own risks.
- Expensive: Storage is scarce. One write can cost a hundred times as much as one computation.
Six chapters
T7Solidity fundamentals
What form does a contract take once deployed on-chain?
State VariableFunctionModifierEventMapping
T8Inside the EVM
Why can the same assignment statement cost 100 times more gas?
MemoryStorageCalldataABIDelegatecall
T9ERC Standards
What problem do standards actually solve?
ERC20ERC721ERC1155PermitApprove
T10Solana Program
Without contract storage, how does a program remember state?
RustAnchorPDACPIAccount Validation
T11Token Program
Why isn't a Solana token a standalone contract?
SPL TokenToken-2022MintATATransfer Hook
T12Testing & Deployment
How can you catch problems before real money is spent?
Unit TestIntegration TestForkFuzzingDeployment Script
After this stage
You can deliver a fully tested contract deployed to a testnet with verified source code.
Stage artifact: A token contract with comprehensive tests.
Study suggestions
- T12's mainnet fork testing is this stage's most important skill. It lets you validate code against real state before spending real money.
- Write failure cases first. Correct rejection matters more than correct execution in contracts.
- Mainnet deployment belongs in the capstone, after the security stage. This stage does not involve it.