Skip to content

GitSafeBot/contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitsafe/contracts

Solidity smart contracts for GitSafe — soul-bound vault system on Solana (EVM bridge layer).

Contracts

Contract File Description
SafeToken SafeToken.sol Soul-bound ERC-20. Represents a locked position. No transfer, approve, or allowance.
SafeVault SafeVault.sol Per-user vault. Holds real ERC-20 assets, issues soul-bound safeTokens as claim certificates.
SafeVaultFactory SafeVaultFactory.sol Deploys vault clones via EIP-1167 minimal proxy pattern.

Deployed (Devnet)

Contract Address
SafeVaultFactory
SafeVault impl
Deployer / feeCollector
relayerSigner

Mainnet addresses will be published at launch. Follow @GitSafe.

Key design decisions

  • Dual-signature security — every state-changing vault call requires both the user execution keypair AND a short-lived ECDSA signature from the relayer (5-min deadline). A leaked execution key alone cannot drain the vault.
  • Soul-bound safeTokens — cannot be phished or drained via approval exploits. No transfer, no approve.
  • GitHub permanent user ID — vault identity anchored to immutable integer, survives username renames.
  • Swap output whitelistgitSwap can only output WETH or USDC, enforced on-chain.
  • 2-step commit-reveal transferinitTransfer + finalizeTransfer prevents front-running.
  • EIP-1167 minimal proxy clones — cheap per-user vault deployment via factory.

Token naming

Underlying safeToken Description
USDC safeUSDC Soul-bound USDC position
SOL (wrapped) safeSOL Soul-bound SOL position
USDT safeUSDT Soul-bound USDT position
JTO safeJTO Soul-bound JTO position

safeTokens are created automatically on first deposit of any ERC-20 token.

Fee structure

Operation Fee
gitShield (deposit) 0.10%
gitUnshield (withdraw) 0.10%
gitSwap 0.30%
Bounty payout 0.20%

Prerequisites

  • Node.js 20+
  • pnpm 10+

Install

pnpm install

Test

pnpm test

Deploy

pnpm hardhat run scripts/deploy.ts --network <network>

Architecture

GitSafe Relayer (off-chain)
     │
     ├── verifies GitHub bot command (HMAC webhook)
     ├── issues short-lived relayerSig (5-min deadline)
     │
     ▼
SafeVaultFactory
     │
     └── clone() ──► SafeVault (per GitHub User ID)
                          │
                          ├── gitShield()    → mint safeTokens
                          ├── gitUnshield()  → burn safeTokens, release ERC-20
                          ├── gitSwap()      → swap via DEX router
                          ├── createProject() → lock budget in escrow
                          ├── assignTaskBounty() → escrow per-task bounty
                          └── executeBountyPayout() → release on PR merge

License

Apache 2.0

About

Soul-bound vault smart contracts

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors