GasLiteBirth
GasLiteBirth — A minimal, gas-optimized Solidity smart contract that records its own creation details on-chain. Every deployment becomes a unique digital “birth certificate.”
Description
# 🪶 GasLiteBirth
GasLiteBirth is a minimal, gas-optimized Solidity smart contract that records its own creation details on-chain.
Each deployment is unique — it stores the deployer’s address, block number, timestamp, and a unique “birth hash” fingerprint.
---
## 💡 Overview
This project demonstrates how a smart contract can self-document its own creation using blockchain metadata — all while remaining extremely gas-efficient.
Every time you deploy GasLiteBirth
, it automatically:
- Records who deployed it creator
)
- Logs when it was created birthTime
)
- Captures which block it was born in birthBlock
)
- Generates a unique fingerprint birthHash
)
No inputs, no functions, no interaction required — just pure on-chain identity.
---
## ⚙️ Features
- Beginner-Friendly – Simple, readable Solidity.
- Unique Each Deployment – No two contracts have the same hash.
- Gas-Optimized – Uses immutable
variables and compact types.
- Instantly Works – No user input or configuration required.
---
## 🧩 Smart Contract
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
/// @title GasLiteBirth - Minimal, gas-optimized contract that records its own creation info
/// @notice Demonstrates constructor use, immutables, and block metadata
contract GasLiteBirth {
// immutables use code storage instead of contract storage (cheaper gas)
address public immutable creator;
uint64 public immutable birthTime; // fits in 8 bytes (less gas)
uint64 public immutable birthBlock; // fits in 8 bytes
bytes32 public immutable birthHash; // unique fingerprint
constructor() {
creator = msg.sender;
birthTime = uint64(block.timestamp);
birthBlock = uint64(block.number);
// derive a unique fingerprint from deployer, time, and block number
birthHash = keccak256(
abi.encodePacked(msg.sender, block.timestamp, block.number)
);
}
}
Progress During Hackathon
Built first smart contract