A smart contract is blockchain-deployed code. For example:
contract Agreement {
address recipient;
bool conditionIsMet;
function payout() external {
if(conditionIsMet) {
sendValue(recipient);
}
}
// ...
}Deploying a Contract
- ⚙️ compile your solidity to bytecode
- ✉️ send a transaction containing the bytecode to an EVM node
- 🏡 the node calculates an address for your new contract
Contract Deployment

Opcodes

https://ethereum.org/en/developers/docs/evm/opcodes
Gas is a unit used to measure the computational work required to execute operations on the blockchain.
Key Takeaways
- ⚙️ Contracts are compiled to creation bytecode
- ⛓ The
datafield contains your creation bytecode - 📭 The
tofield is left blank to deploy a contract - 🏡 Your contract will have an address, balance and runtime bytecode
Transaction Life Cycle

💡 Externally Owned Account (EOA) refers to an account managed by a user through private keys rather than by smart contract code.
💡 Analogy
Think of an EOA as a bank account and the wallet as your online banking app:
– The EOA holds your funds (like the bank account).
– The wallet lets you access and manage the EOA, just like an app lets you manage your bank account. Example MetaMask.
Key Takeaways
- 🥾 Transactions begin at an EOA
- ☝️ Transactions occur sequentially
- ⛽️ Transactions set a gas limit
- 🎯 Transactions send calldata, targetting a contract method
- 🌐 Similarly smart contracts can call each other within the one transaction
Resources
- An awesome interactive resource for understanding EVM opcodes: https://www.evm.codes/
It should be noted in this video Dan said that the amount of gas is static to the opcodes used. What he meant is that the amount of gas is deterministically calculated based on the opcodes used. For simple opcodes, likeADDorMULthe gas amount is a fixed amount. For more complicated opcodes, likeSSTORE, there are several factors that go into the gas calculation and there are even gas refunds for clearing of a storage slot (see evm codes for more details)
Learn Solidity. Alchemy University.
Accessed October 6, 2024
https://university.alchemy.com/overview/solidity