Part II · Accounts, transactions, contracts
Gas, nonce and block explorers
This chapter answers one question: how do you tell that something really landed on-chain?
Where the starting funds came from
At the start of the lab, account A received 0.05 SepETH (testnet ETH) at 2026-11-11 15:58:24 Singapore time, in block 12110419:
- Funding transaction: View transaction on Sepolia Etherscan (opens in a new tab): 0xc8b5c548e4e42c69c9f0b9cd8a9a8c4381d7cb2a1e0823b1ef22f539d344d92b
- Sending address: View address on Sepolia Etherscan (opens in a new tab): 0x52f1984Cd3e46e1214dB222D3Ff63712E7aCEedD
A service that hands out free test coins is called a faucet. The sending address has no official name tag in the explorer, so this book only states the address and amount you can verify and does not guess which brand it belongs to. Test coins have no market value; the lab spent no real money.
Gas: the metering fee for execution
Gas is the unit that measures the work the EVM does. Think of posting a parcel: the price depends not only on whether you send it, but on handling cost and how busy things are.
Under the EIP-1559 fee market:
- fee paid =
gasUsed × effective gas price - effective gas price ≈
base fee + tip gasUsed × base feeis burned (removed from circulation, credited to nobody);gasUsed × tipgoes to the validator that includes the block.
Which part is larger depends on the base fee and tip at the time; there is no fixed ratio. Check it against the five real Counter transactions from the lab (all values in wei):
| Transaction | Base fee | Tip | Effective price | Burned | To validator | Total fee |
|---|---|---|---|---|---|---|
| Deploy Counter | 20 | 50 | 70 | 33,052,820 | 82,632,050 | 115,684,870 |
| First increment | 18 | 50 | 68 | 2,290,122 | 6,361,450 | 8,651,572 |
| reset | 20 | 50 | 70 | 472,520 | 1,181,300 | 1,653,820 |
| increment (1 wei tip) | 20 | 1 | 21 | 2,544,580 | 127,229 | 2,671,809 |
| increment (2 wei tip) | 24 | 2 | 26 | 703,416 | 58,618 | 762,034 |
Sepolia was quiet then: the base fee was only around 20 wei while the default tip was 50 wei, so in the first three transactions the tip was the larger part (about 71% of the deployment fee went to the validator). Only after the tip was cut to 1 wei did the burned part dominate again. The same 127,229-gas increment cost 8,651,572 wei with a 50 wei tip and 2,671,809 wei with a 1 wei tip: the difference is the tip, not the computation.
Nonce: the account’s transaction counter
For an ordinary externally owned account, the nonce is the sequence number of the account’s transactions. It starts at 0 and goes up by one for every transaction that gets mined; it orders transactions and prevents the same one from being replayed.
At the snapshot, account A’s nonce was 20. That means A had sent 20 mined transactions using nonces 0 through 19, and its next transaction would use nonce 20. It is not “a balance of 20”, and not “20 successful calls” (nonce 15 was a deliberately failing transaction that still used up a nonce). Account B’s nonce was 3 (nonces 0, 1 and 2 used).
A real lesson about a “stuck” transaction
The lower the tip, the more likely a transaction waits at the back of the queue when the network is busy. The lab practised this on purpose:
- Nonce 3: an increment with a tip of only 1 wei. The chain was not busy, so it was still mined: View transaction on Sepolia Etherscan (opens in a new tab): 0xd61e57686959b7c4c9d774a6aa35b0fb9dac72e8317055146da4676a9e4e4b31 (block 12111091).
- Nonce 4: the replacement script
replace-stuck.mjswas designed to first send a 1 wei tip transaction at nonce 4 that would be hard to mine and watch it; if it was still waiting in the pending queue (the mempool), it would send a replacement with the same nonce and a higher tip (2 wei). The transaction mined at nonce 4 matches that script exactly (gas limit 140,000, tip 2 wei): View transaction on Sepolia Etherscan (opens in a new tab): 0x8141d5f30dc7abd76c7c2ebfcc9f4861af625e38ca11220605057e1275512da8 (block 12111181).
Only the transaction that was finally mined is visible on-chain. A replaced transaction never enters any block and leaves no successful receipt. That is why this book never treats the hash of an unmined transaction as fact: a hash shown by your wallet or script only says “sent”, not “landed”.
What to look at in a block explorer
(See Figure 2 in Chapter 5 for the whole flow.)
- Network: make sure it is Sepolia (the address bar reads
sepolia.etherscan.io). Do not confuse testnet and mainnet. - Status: success or failure. A failed transaction may still have consumed gas.
- From / To: who sent it and which account or contract it went to.
- Method / Logs: which function was called and which events were emitted. An event is not always the final state of an asset (Chapters 11–12 show an event with a net change of zero).
- Block / Transaction Hash: the block that contains it and its unique identifier.
Judge the on-chain result by status, events and balance changes together, never just because a program or bot says “success”.