Skip to content

Conversation

shark0der
Copy link
Contributor

@shark0der shark0der commented Nov 8, 2022

Context

Partial implementation of #386.

Changes proposed in this pull request

  • Given the logic overlap between buyCover and editCover the PR merges them in a single function
  • Removes the refund logic from the Cover contract in order to avoid cross-pool refund (buy on staking pool X, move cover to Y hence switching the rewards from one pool to another and "rugging" the stakers)
  • Moves the following items from the CoverUtilsLib to Cover contract:
    • payment handling
    • stake burn function
    • stakingPool function

Test plan

All buyCover tests failed and need fixing (TBD).

Checklist

  • Attached corresponding Github issue
  • Prefixed the name with the type of change (i.e. feat, chore, test)
  • Performed a self-review of my own code
  • Made corresponding changes to the documentation
  • Didn't generate new warnings
  • Added tests that prove my fix is effective or that my feature works

Review

When reviewing a PR, please indicate intention in comments using the following emojis:

  • 🍰 = Nice to have but not essential.
  • 💡 = Suggestion or a comment based on personal opinion
  • 🔨 = I believe this should be changed.
  • 🤔 = I don’t understand something, do you mind giving me more context?
  • 🚀 = Feedback

@shark0der shark0der changed the base branch from master to nexus-v2 November 8, 2022 14:41
@shark0der shark0der force-pushed the feature/allocate-and-edit branch from 401954d to 6c7dc2c Compare November 11, 2022 16:58
@shark0der shark0der changed the title Feature: allocate and edit Feature: merge buy & edit cover in a single function and remove refund logic from Cover Nov 15, 2022
@shark0der shark0der marked this pull request as ready for review November 15, 2022 13:06
@shark0der shark0der force-pushed the feature/allocate-and-edit branch from 6c7dc2c to 66e04f3 Compare November 15, 2022 13:10
@roxdanila roxdanila linked an issue Nov 15, 2022 that may be closed by this pull request

function buyCover(
BuyCoverParams memory params,
PoolAllocationRequest[] memory allocationRequests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would rename this to poolAllocationRequests

The fact that there is another type called AllocationRequest makes it hard to disambiguate between what's coming from that array and what's being created inside the pool

@roxdanila roxdanila force-pushed the feature/allocate-and-edit branch from b016a64 to 687223a Compare November 15, 2022 17:29
@shark0der shark0der force-pushed the feature/allocate-and-edit branch from 4d406b5 to 2594ad8 Compare November 18, 2022 15:14
@shark0der shark0der force-pushed the feature/allocate-and-edit branch from 2594ad8 to 12d6cb3 Compare November 22, 2022 11:56
@roxdanila roxdanila force-pushed the feature/allocate-and-edit branch from 12d6cb3 to e17b751 Compare November 22, 2022 16:50
@roxdanila roxdanila mentioned this pull request Nov 23, 2022
@shark0der shark0der force-pushed the feature/allocate-and-edit branch from 6436d44 to 5083aaf Compare November 23, 2022 10:55
@roxdanila roxdanila force-pushed the feature/allocate-and-edit branch 2 times, most recently from 97cc567 to 4ca0cc9 Compare November 23, 2022 16:08
@roxdanila roxdanila force-pushed the feature/allocate-and-edit branch from 5ca1c88 to 7d07dd4 Compare November 24, 2022 10:31
@roxdanila roxdanila merged commit 1ee4993 into nexus-v2 Nov 24, 2022
@roxdanila roxdanila deleted the feature/allocate-and-edit branch November 24, 2022 13:00
roxdanila added a commit that referenced this pull request Nov 30, 2022
…e-and-edit

Test: Fix remaining broken tests after PR #480
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.

Edit cover changes
4 participants