Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is the Minimal Proxy (Clone) Pattern in blockchain?
It is a design pattern that creates lightweight contract copies by delegating calls to a single implementation contract, saving gas and deployment costs.
Click to reveal answer
beginner
How does the Minimal Proxy pattern save gas?
By deploying very small proxy contracts that forward calls to a shared logic contract, it avoids duplicating code and reduces deployment size and cost.
Click to reveal answer
intermediate
What opcode is commonly used in Minimal Proxy contracts to delegate calls?
The DELEGATECALL opcode is used to forward calls to the implementation contract while preserving the caller's context.
Click to reveal answer
advanced
Show the basic bytecode structure of a Minimal Proxy contract.
It consists of a small piece of bytecode that includes a fixed prefix, the address of the implementation contract, and a fixed suffix that performs the delegatecall.
Click to reveal answer
beginner
Why is the Minimal Proxy pattern also called the 'clone' pattern?
Because it creates clones of a contract that share the same logic but have separate storage, acting like lightweight copies.
Click to reveal answer
What is the main benefit of using the Minimal Proxy pattern?
AImproved contract security
BAutomatic contract upgrades
CFaster transaction execution
DLower gas costs for deploying multiple contracts
✗ Incorrect
Minimal Proxy contracts reduce deployment costs by sharing code, lowering gas fees.
Which opcode does a Minimal Proxy contract use to forward calls?
ASTATICCALL
BCALL
CDELEGATECALL
DCREATE
✗ Incorrect
DELEGATECALL forwards calls preserving the caller's context, essential for proxies.
In the Minimal Proxy pattern, where is the logic code stored?
AIn a single implementation contract
BIn each proxy contract
COn the client side
DIn the blockchain's state root
✗ Incorrect
The implementation contract holds the logic; proxies delegate calls to it.
What does a Minimal Proxy contract NOT have?
AIts own storage
BIts own logic code
CAn address
DA delegatecall instruction
✗ Incorrect
Minimal proxies do not contain logic code; they delegate to the implementation.
Why might developers choose the Minimal Proxy pattern?
ATo reduce contract deployment costs
BTo increase contract size
CTo avoid using delegatecall
DTo store all data on-chain
✗ Incorrect
It reduces deployment costs by reusing logic code across many proxies.
Explain how the Minimal Proxy pattern works and why it is useful in blockchain development.
Think about how many contracts can share one logic contract to save costs.
You got /4 concepts.
Describe the role of DELEGATECALL in the Minimal Proxy pattern.
Focus on how calls are forwarded without changing the caller.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of the Minimal proxy (clone) pattern in blockchain development?
easy
A. To replace the original contract with a new one
B. To increase the size of deployed contracts
C. To create cheap copies of contracts by forwarding calls
D. To store large amounts of data on-chain
Solution
Step 1: Understand the pattern's goal
The minimal proxy pattern is designed to save gas and storage by creating lightweight copies of a contract.
Step 2: Identify the correct purpose
It achieves this by forwarding calls to the original contract instead of duplicating all code.
Final Answer:
To create cheap copies of contracts by forwarding calls -> Option C
Hint: Minimal proxy uses create, not new or delegatecall [OK]
Common Mistakes:
Using new keyword which deploys full contract
Confusing create2 with create
Using delegatecall which does not deploy
3. Given the following Solidity code snippet for deploying a minimal proxy clone, what will be the output of clone.owner() if the original contract's owner is set to address 0x1234...?
address clone = Clones.clone(original);
// original.owner() returns 0x1234...
// clone forwards calls to original
medium
A. 0x1234... (same owner as original)
B. 0x0000... (zero address)
C. Revert error due to missing owner variable
D. Address of the clone contract
Solution
Step 1: Understand call forwarding in minimal proxy
The clone forwards calls to the original contract, but storage is separate, so state variables like owner are not shared.
Step 2: Determine owner value returned
Since owner() reads from the clone's storage which is uninitialized, it returns 0x0000... (zero address).
Final Answer:
0x0000... (zero address) -> Option B
Quick Check:
Clone forwards calls but has separate storage, owner = zero address [OK]
Hint: Clone has separate storage, owner defaults to zero [OK]
Common Mistakes:
Assuming clone shares storage with original
Expecting original owner to be returned
Thinking clone address is returned
4. Identify the error in this minimal proxy deployment code snippet:
5. You want to deploy 1000 instances of a contract cheaply using the minimal proxy pattern. Which approach best reduces gas and storage costs while allowing each clone to have its own owner?
hard
A. Use minimal proxies forwarding to one implementation and store owner in each clone's storage
B. Deploy 1000 full contracts separately with unique owners
C. Use minimal proxies forwarding to one implementation and store owner in the implementation contract
D. Deploy one contract and share the same owner for all clones
Solution
Step 1: Understand minimal proxy benefits
Minimal proxies save gas by sharing code but have separate storage for each clone.
Step 2: Assign unique owners per clone
Storing owner in each clone's storage allows unique ownership while sharing logic.
Step 3: Evaluate options
Use minimal proxies forwarding to one implementation and store owner in each clone's storage uses minimal proxies with per-clone storage, reducing gas and allowing unique owners.
Final Answer:
Use minimal proxies forwarding to one implementation and store owner in each clone's storage -> Option A