Find all new smart contract deployments in a block range to track protocol launches, analyze deployment patterns, or monitor for security research.
Use Case
Contract deployment monitoring helps you:
- Track new protocol and dApp launches
- Analyze deployment patterns and trends
- Monitor for security research and auditing
- Build contract discovery tools
Code Example
curl --compress -X POST 'https://portal.sqd.dev/datasets/ethereum-mainnet/stream' \
-H 'Content-Type: application/json' \
-d '{
"type": "evm",
"fromBlock": 20000000,
"toBlock": 20000003,
"fields": {
"block": {
"number": true,
"timestamp": true
},
"trace": {
"type": true,
"createFrom": true,
"createResultAddress": true
}
},
"traces": [{
"type": ["create"]
}]
}'
Try it yourself with the interactive query interface below:
Key Parameters
| Parameter | Description |
|---|
type | Trace type: "create" for contract deployments |
createResultAddress | Address of the newly deployed contract |
createFrom | Deployer address (caller of CREATE) |
trace | Internal transaction trace showing contract creation |
Use traces with type: ["create"] to filter for contract deployments. The createResultAddress field contains the newly deployed contract address.
Expected Output
{
"header": {
"number": 20000001,
"timestamp": 1705173443
},
"traces": [
{
"type": "create",
"createFrom": "0xa9d1e08c7793af67e9d92fe308d5697fb81d3e43",
"result": {
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7"
}
}
]
}
Filter by Deployer
Track deployments from a specific address:
curl --compress -X POST 'https://portal.sqd.dev/datasets/ethereum-mainnet/stream' \
-H 'Content-Type: application/json' \
-d '{
"type": "evm",
"fromBlock": 20000000,
"toBlock": 20000003,
"fields": {
"transaction": {
"hash": true,
"from": true,
"contractAddress": true
}
},
"transactions": [{
"from": ["0x1234567890123456789012345678901234567890"]
}]
}'
Analyze Bytecode Size
Group deployments by bytecode size to find patterns:
const deployments = [];
for (const block of blocks) {
for (const tx of block.transactions) {
if (tx.contractAddress) {
const bytecodeSize = tx.input.length / 2 - 1; // Convert hex to bytes
deployments.push({
address: tx.contractAddress,
deployer: tx.from,
bytecodeSize,
block: block.header.number,
});
}
}
}
// Find large contracts (>24KB, near the limit)
const largeContracts = deployments.filter(d => d.bytecodeSize > 24000);
console.log(`Found ${largeContracts.length} contracts near the 24KB limit`);
Ethereum has a 24KB contract size limit. Contracts approaching this limit may use proxy patterns or optimizations.
Detect Proxy Patterns
Identify potential proxy deployments by bytecode patterns:
// Simple heuristic: small bytecode often indicates a proxy
const MIN_PROXY_SIZE = 50; // Minimal proxy is ~45 bytes
const MAX_PROXY_SIZE = 500; // Most proxies are under 500 bytes
for (const block of blocks) {
for (const tx of block.transactions) {
if (tx.contractAddress) {
const bytecodeSize = tx.input.length / 2 - 1;
if (bytecodeSize >= MIN_PROXY_SIZE && bytecodeSize <= MAX_PROXY_SIZE) {
console.log({
possibleProxy: tx.contractAddress,
bytecodeSize,
deployer: tx.from,
});
}
}
}
}
Track Factory Deployments
Monitor contracts deployed by factory contracts:
// Track contracts created via factory patterns
// Factory deployments appear as internal transactions (traces)
const blocks = await dataSource.getBlocks({
from: 20000000,
to: 20000003,
fields: {
trace: {
type: true,
from: true,
createResultAddress: true,
createResultCode: true,
},
},
traces: [
{
type: ["create"],
callFrom: ["0xYourFactoryAddress"],
},
],
});
for (const block of blocks) {
for (const trace of block.traces) {
if (trace.createResultAddress) {
console.log({
factory: trace.callFrom || trace.createFrom,
deployed: trace.createResultAddress,
type: trace.type,
});
}
}
}
Factory-deployed contracts don’t appear as regular transactions. Use trace queries with type: ["create"] instead.
- Request minimal fields: Omit
input if you don’t need bytecode
- Use block ranges: Process 10k-50k blocks at a time
- Filter by deployer: When tracking specific addresses
- Post-process bytecode: Analyze bytecode in your application