Skip to content

$1 Million USDC vs 1 Wrapped Bitcoin 90-day term bet, inspired by Balaji's tweet

License

Notifications You must be signed in to change notification settings

Anish-Agnihotri/Hyperbitcoinization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperbitcoinization

Simple smart contract that configures a 1M USDC vs 1 Wrapped Bitcoin 90-day term bet, inspired by Balaji's tweet.

  1. Anyone can createBet() initializing a bet between two parties
  2. Parties A and B deposit their funds, contract marks second deposit as startTimestamp
  3. Bet is frozen for 90 days from startTimestamp
  4. After 90 days, anyone call call settleBet(), using the Chainlink BTC/USD oracle to settle the bet.

Note: settleBet() can also be called earlier than 90 days, if in favor of partyUSDC (kudos banteg).

Test

Tests use Foundry: Forge.

Install Foundry using the installation steps in the README of the linked repo.

# Get dependencies
forge update

# Run tests
forge test

Potential issues

  1. USDC can de-peg, (1M USDC != $1M USD), kudos @supernovahs
  2. Chainlink oracle price manipulation kudos @0xfps

License

GNU Affero GPL v3.0

About

$1 Million USDC vs 1 Wrapped Bitcoin 90-day term bet, inspired by Balaji's tweet

Topics

Resources

License

Stars

Watchers

Forks