-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Covered Calls ETH #162
base: main
Are you sure you want to change the base?
Conversation
require(call.expiry > block.timestamp, "INVALID_CALL"); | ||
|
||
// Ensure the specified strike matches the call strike | ||
require(call.strike == _strike, "MUST_MATCH_STRIKE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why even pass strike if they have to match? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its to prevent a buyer from getting rugged on a strike price they didn't intend to purchase the option for
there'd be a race condition upon a pending buy where the seller could cancel the call and create a new one with the same premium but higher strike price
_handleOutgoingTransfer(seller, premium, address(0), 50000); | ||
|
||
// Mark the option as purchased | ||
call.buyer = msg.sender; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be moved above any of the external calls. Currently the seller could re-enter and cancel after receiving premium :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow lol ty for catching that!
New Module Proposal
Description
This module enables users to create ETH covered call options on NFTs.
Motivation and Context
https://twitter.com/will__price/status/1473036686691082248?s=21
How has this been tested?
Relevant tests have been included via Foundry.
Checklist: