This bounty is no longer available
Web3 DAO | yieldhand Logo

Tests For 3 Core Functions (and Readme update for running tests)

Organization

yieldhand

Deadline

in over 262 years

Status

ENDED

140.89 USD

INSTRUCTIONS

This project is a day old. The basic functionality is in, and we're currently working on building our development community (is that you I see?). What better way to do that than with writing the first tests (is that you I see again?). We'll be using the Truffle standards here (Mocha/Chai): https://www.trufflesuite.com/docs/truffle/testing/writing-tests-in-javascript, and HardHat as the test chain because we need example funds (DAI and USDC) to pull off these tests.

This is probably the simplest option market smart contract project in existence but ticks most of the boxes for what users need. Currently, a seller can create a limit order for an option of any token in the OptionsMarket. And a buyer(s) can purchase these options for set premium prices and strike prices. Further, the options can be exercised after their expiry. Super basic! We're all about simplicity and you can see more of what we're trying to do here: https://www.yieldhand.com

If you find and fix a bug, a $50(ETH) reward will be yours. That's the current bug bounty program right there. Also, if you don't know how to fix and just want to report, Please ping us on discord!

With this project, the best part is that anyone can seamlessly create an option for any ERC20 token without it being whitelisted. There is so much possibility for what we can do from here (and contributors/community members will benefit in the long term from all of that), but first:

Here are the tests we are going to write for the core functionality:

Assertion 1: "User 1 called sellOption function called with USDC underlying, and mapping updated with all data/ event emitted properly"

Assertion 2: "Using the sellOption data from Assertion 1, User 2 (who has 100 DAI and 100 USDC) called buyOptionByExactPremiumAndExpiry, paid the premium and have a position in the positions mapping with ID"

Assertion 3: "The expiration date for Assertion 1 passed, and User 2 excersized their option using DAI after approving the contract to handle their DAI"