Solidity contracts for Gold Standard DAO — a DeFi protocol built around a gold-pegged token with on-chain collateralized debt positions.
- 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
- Solidity 0.6.12 — smart contracts
- Hardhat — compilation, testing, deployment
- TypeScript — deploy scripts and tests
- Solhint / Prettier / ESLint — linting and formatting
├── contracts/ # Solidity source files
├── test/ # Contract test suite
├── scripts/ # Deployment and utility scripts
├── hardhat.config.ts
├── .solhint.json
└── verify.json # Etherscan verification config
git clone https://github.com/bigchiano/gsd-smart-contracts.git
cd gsd-smart-contracts
yarn installCopy .env.example to .env and fill in your RPC URL, deployer private key, and Etherscan API key.
npx hardhat compilenpx hardhat testGas reporting:
REPORT_GAS=true npx hardhat testnpx hardhat run scripts/deploy.ts --network <network>npx hardhat verify --network <network> DEPLOYED_ADDRESSnpx solhint 'contracts/**/*.sol'
npx eslint '**/*.{js,ts}'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.