Skip to content
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

Standardize member naming and ordering #99

Merged
merged 13 commits into from
Nov 16, 2022
Merged

Conversation

neodaoist
Copy link
Contributor

@neodaoist neodaoist commented Nov 15, 2022

Proposed naming changes:

  • OptionSettlementEngine is the contract implementation name, now matching IOptionSettlementEngine
  • Data structures
    • Option is a struct representing a type of option
    • OptionLotClaim is a struct representing a claim to the underlying/exercise assets of an option lot
    • OptionLotClaimIndex
    • OptionLotClaimBucket
    • earliestExerciseTimestamp (in struct, function, and event)
  • IDs
    • Token ID is the external-facing token ID
    • Option ID is the token ID of a fungible Option token
    • Claim ID is the token ID of a non-fungible Option Lot Claim token
  • Encoding
    • Option Key is the uint160 identifier of a type of option
    • Claim Num is the auto-incrementing uint96 identifier of an option lot claim
    • encodeTokenId(), decodeTokenId(), getOptionForTokenId()

Proposed ordering changes:

  • events
  • errors
  • enums
  • structs
  • functions
    • Option Info
    • Token ID Encoding (only in contract impl)
    • Write Options
    • Exercise Options
    • Redeem Option Lot Claims
    • Protocol Admin
    • Internal Helpers (TBD if these go in semantic sections or stay at bottom)

Test suite:

  • 2 failing tests, need to investigate further why bc there should be no changes to bucket accounting biz logic
    • testAssignMultipleBuckets
    • testRandomAssignment

Will resolve #96 and #81

@neodaoist neodaoist changed the title Feature/naming things Standardize member naming and ordering Nov 15, 2022
@neodaoist neodaoist changed the title Standardize member naming and ordering WIP: Standardize member naming and ordering Nov 15, 2022
@0xAlcibiades 0xAlcibiades marked this pull request as ready for review November 16, 2022 06:18
@0xAlcibiades
Copy link
Member

@neodaoist can you please resolve the failing tests and merge conflicts here before review?

@0xAlcibiades 0xAlcibiades changed the title WIP: Standardize member naming and ordering Standardize member naming and ordering Nov 16, 2022
@Flip-Liquid
Copy link
Contributor

@neodaoist it looks like you're moving the ordering of fields in the options struct. This will affect the settlement seed initialization:
image

Those tests are asserting the exercise of options in particular buckets, and are sensitive to the seed.

README.md Outdated Show resolved Hide resolved
@neodaoist
Copy link
Contributor Author

There are 2 TODOs I just added, re: reviewing and clarifying Claim Bucketing natspec.

I need more time to fix the failing tests, but will do so shortly today.

Ditto on merge conflicts.

@Flip-Liquid
Copy link
Contributor

@neodaoist just change the two failures to testFail to get checks passing

@codecov-commenter
Copy link

Codecov Report

Merging #99 (a37dfb2) into master (47e4bcb) will decrease coverage by 0.46%.
The diff coverage is 96.38%.

@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
- Coverage   87.03%   86.57%   -0.47%     
==========================================
  Files           3        3              
  Lines         347      350       +3     
  Branches       51       52       +1     
==========================================
+ Hits          302      303       +1     
- Misses         35       36       +1     
- Partials       10       11       +1     
Impacted Files Coverage Δ
test/OptionSettlement.t.sol 0.00% <ø> (ø)
src/OptionSettlementEngine.sol 96.80% <96.38%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Flip-Liquid Flip-Liquid self-requested a review November 16, 2022 23:34
@neodaoist neodaoist dismissed 0xAlcibiades’s stale review November 16, 2022 23:40

Addressed changes already

@neodaoist neodaoist merged commit 9467abf into master Nov 16, 2022
@neodaoist neodaoist deleted the feature/naming-things branch November 16, 2022 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review var naming + struct naming for easier readability + devex
4 participants