Inspiration

Do Kwan, GiganticRebirth, Algod, Balaji Srinivasan, Cobie... In the last 2 years we've seen some crazy public bets in the crypto space. Do Kwan bet a total of $11 million on the price of LUNA. Balaji bet $1 million about Bitcoin price. Many more public bets have come and gone. Oddly, these bets required trusting intermediaries for escrow and payout, in the case of Do Kwan, or a handshake agreement in the case of Balaji's bet.

In a trustless universe, we deserve better. Enter Flex

What it does

Flex allows anyone to trustlessly create a contract or "bet" with anyone else in the world. The Flex smart contract will escrow each party's funds and, after a specified period of time, allow the bet to be trustlessly closed and funds distributed to the winning party.

Escrow Maker's can choose between Chainlink price oracles for common assets and Uniswap oracles for long-tail assets. A specific cryptocurrency address can be designated as the taker or the null address can be designated which allows anyone to be the Taker. The Maker and Taker put up collateral that the protocol escrows. After a predefined period of time the bet can be closed manually or Chainlink Automation can close the bet automatically. The winner will receive all of the escrowed funds.

How we built it

Major thanks to Patrick Collins, without whom this wouldn't have been possible. Everything I know came from his Hardhat/Solidity YouTube course.

Other resources include: -Hardhat -CryptoZombies -Mastering Ethereum -Furious Google-ing

Challenges we ran into

Mostly compatibility issues. I started Patrick Collins free Hardhat course 8 months after he made it. The deeper I went the more compatibility issues and breaking upgrades I ran into. I ultimately couldn't finish the more advanced courses.

Front End development was a nightmare.

Accomplishments that we're proud of

The whole thing! This is the first project like this I've ever done. It feels novel in a world of endless blockchain copycats.

What's next for Flex

If there is interest in the protocol then I'd like to get it audited and put out for public release. Next steps include code cleanup (it's messy), security reviews, and a better front-end design.

Built With

Share this project:

Updates