Skip to content

bigchiano/gsd-smart-contracts

Repository files navigation

GSD Smart Contracts

Solidity contracts for Gold Standard DAO — a DeFi protocol built around a gold-pegged token with on-chain collateralized debt positions.

What's in here

  • Gold-pegged token — ERC20 token designed to track the price of gold, redeemable 1:1 against reserves
  • Collateralized debt positions (CDPs) — users lock collateral to mint the pegged token, with liquidation thresholds enforced on-chain
  • Vault system — deposit, borrow, and repay logic with gas-optimized storage patterns
  • Frontrunning resistance — contract-level protections against sandwich attacks on vault operations

Stack

  • Solidity 0.6.12 — smart contracts
  • Hardhat — compilation, testing, deployment
  • TypeScript — deploy scripts and tests
  • Solhint / Prettier / ESLint — linting and formatting

Project structure

├── contracts/       # Solidity source files
├── test/            # Contract test suite
├── scripts/         # Deployment and utility scripts
├── hardhat.config.ts
├── .solhint.json
└── verify.json      # Etherscan verification config

Setup

git clone https://github.com/bigchiano/gsd-smart-contracts.git
cd gsd-smart-contracts
yarn install

Copy .env.example to .env and fill in your RPC URL, deployer private key, and Etherscan API key.

Compile

npx hardhat compile

Test

npx hardhat test

Gas reporting:

REPORT_GAS=true npx hardhat test

Deploy

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

Verify on Etherscan

npx hardhat verify --network <network> DEPLOYED_ADDRESS

Lint

npx solhint 'contracts/**/*.sol'
npx eslint '**/*.{js,ts}'

Context

Built these contracts while working at Gold Standard DAO. The protocol lets users mint a gold-pegged stablecoin by locking collateral into CDPs — similar in concept to MakerDAO's DAI, but pegged to gold instead of USD. The contracts handle collateral management, minting/burning of the pegged token, liquidation logic, and frontrunning protections.

92 commits across the dev branch. Companion subgraph for indexing is at gsd-subgraph.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors