DEV Community

Cover image for Ethereum-Solidity Quiz Q32: What transaction types are used in Ethereum?
MihaiHng
MihaiHng

Posted on

Ethereum-Solidity Quiz Q32: What transaction types are used in Ethereum?

────────────────────────────────────────────────────────────────────
                         TRANSACTION TYPES                                    
────────────────────────────────────────────────────────────────────

1. CREATE     - Deploy contract (address depends on deployer + nonce)
2. CREATE2    - Deploy contract (address is deterministic/predictable)
3. CALL       - Call a function on existing contract
4. DELEGATECALL - Call using caller's storage (used by proxies internally)
Enter fullscreen mode Exit fullscreen mode

Transaction Types Explained

1. CREATE

// Regular contract deployment
new MyContract(arg1, arg2);
json{
  "transactionType": "CREATE",
  "to": null,  // ◄── null means contract creation
  "contractAddress": "0x..."
}
Enter fullscreen mode Exit fullscreen mode

2. CREATE2

// Deterministic deployment via factory
// Foundry does this automatically for libraries
json{
  "transactionType": "CREATE2",
  "to": "0x4e59b448...",  // ◄── Factory address
  "contractAddress": "0x..."
}
Enter fullscreen mode Exit fullscreen mode

3. CALL

// Function call on existing contract
provider.setStablecoin(usdcAddress);
json{
  "transactionType": "CALL",
  "to": "0xa729b836...",  // ◄── Contract being called
  "function": "setStablecoin(address)",
  "arguments": ["0x1c7D4B19..."]
}
Enter fullscreen mode Exit fullscreen mode

4. DELEGATECALL (Internal, not in broadcast)

// Used by proxies - executes code in caller's context
// You won't see this in transactions, it's internal
proxy.delegatecall(implementation, data);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)