Skip to content

Latest commit

 

History

History
161 lines (115 loc) · 4.59 KB

File metadata and controls

161 lines (115 loc) · 4.59 KB

GitNull Core Protocol

Smart contracts powering the GitNull onchain code collaboration platform — deployed on gitchain-l2.

License: MIT Network Audit Platform

gitnull.xyz · Explorer · Docs


Overview

The GitNull protocol consists of four core smart contracts deployed on gitchain-l2, an EVM-compatible Layer-2 optimized for developer workflows:

Contract Address Description
RepoRegistry 0x1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b Repository registration and ownership management
ContribLedger 0x5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f Immutable contribution records + soulbound NFT minting
BountyEscrow 0x9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d Non-custodial bounty fund management
GovernanceDAO 0x3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b Protocol parameter governance

Contracts

RepoRegistry

Manages repository registration, ownership, and metadata onchain.

function register(string calldata name, string calldata owner, string calldata ipfsHash)
    external returns (uint256 repoId);

function transferOwnership(uint256 repoId, address newOwner) external;

function setIpfsHash(uint256 repoId, string calldata ipfsHash) external;

ContribLedger

Records every merged pull request as an immutable onchain event. Mints a soulbound ERC-721 NFT (non-transferable) to the contributor's wallet.

function recordMerge(
    uint256 repoId,
    uint256 prNumber,
    address contributor,
    uint256 additions,
    uint256 deletions,
    bytes32 commitHash
) external returns (uint256 proofTokenId);

function getContributions(address contributor)
    external view returns (Contribution[] memory);

Proof NFT metadata (stored onchain):

  • Repository name + owner
  • PR number and title hash
  • Additions / deletions diff stats
  • Commit hash (IPFS CID)
  • Block timestamp of merge
  • Contributor wallet address

BountyEscrow

Non-custodial escrow for $GNULL bounties. Funds are locked until an agent verifies the solution or the poster cancels.

function post(uint256 issueId, uint256 amount) external;

function settle(uint256 issueId, address contributor, bytes calldata agentProof)
    external;

function cancel(uint256 issueId) external;

function getEscrow(uint256 issueId)
    external view returns (address poster, uint256 amount, bool settled);

GovernanceDAO

On-chain governance for protocol parameter changes. Uses a simple proposal + voting mechanism with $GNULL token weight.

function propose(string calldata description, bytes calldata callData)
    external returns (uint256 proposalId);

function vote(uint256 proposalId, bool support) external;

function execute(uint256 proposalId) external;

Repository Structure

core-protocol/
├── contracts/
│   ├── RepoRegistry.sol
│   ├── ContribLedger.sol
│   ├── BountyEscrow.sol
│   ├── GovernanceDAO.sol
│   └── interfaces/
│       ├── IRepoRegistry.sol
│       ├── IContribLedger.sol
│       └── IBountyEscrow.sol
├── scripts/
│   ├── deploy.ts
│   └── verify.ts
├── test/
│   ├── RepoRegistry.test.ts
│   ├── ContribLedger.test.ts
│   └── BountyEscrow.test.ts
├── hardhat.config.ts
└── package.json

Security

  • Audited by Zellic (March 2026) — view report
  • All contracts use checks-effects-interactions pattern
  • BountyEscrow uses ReentrancyGuard on all state-changing functions
  • ContribLedger NFTs are soulbound (transfer reverts) — EIP-5192 compliant
  • Agent proof signatures verified via ECDSA before bounty settlement

Development

npm install
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.ts --network gitchain-l2

Network config:

RPC: https://rpc.gitchain-l2.xyz
Chain ID: 7472
Explorer: https://explorer.gitchain-l2.xyz

Live Explorer

Track all onchain events in real time at gitnull.xyz/explorer.


License

MIT © GitNull Protocol Labs