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

Feat: PP_Queue_v1 & PP_Queue_ManualExecution #708

Conversation

vendrell46
Copy link

@vendrell46 vendrell46 commented Dec 23, 2024

What has been done?

  • Setup of PP_Queue, PP_Queue_ManualExecution, interfaces
  • Manage queue based on the client
  • Add functions to
    • add payment orders to the queue
    • execute the queue
    • cancel individual payment orders in the queue, removing the element form the queue
  • add functions to validate an a payment order for the PP_Queue
  • Extend PP_Queue to add a manual execution function

Relevant Links

vendrell46 and others added 30 commits December 10, 2024 14:52
- The function `handleCollateralTokensAfterSell` was still expecting to
transfer collateral, which would revert in the current implementation.
- The _sellOrder` function had a conditional check which would let
the contract revert given there will not be any collateral in the
contract
Feat: Add collateral transfer to treasury
/// @notice Validates a payment order.
/// @param order_ The order to validate.
/// @return valid_ True if the order is valid.
function _validPaymentOrder(QueuedOrder memory order_)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be missing something but we are not using this anywhere

Copy link
Collaborator

Choose a reason for hiding this comment

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

The function called within the internal function are also not utilized, like the _validateFlagsAndData()

vendrell46 and others added 11 commits January 23, 2025 12:30
- _orderExists would return true as it was even if the order didn't exist (which had orderId = 0)

- Now we verify:
   1. The order belongs to the specified client (order.client_ == address(client_))
   2. The order has been initialized (order.timestamp_ != 0)
- Checking if the queue is initialized by looking at the sentinel position in the queue's list mapping
- If the sentinel position is 0, it means the queue is uninitialized, so we revert with our own error
- Only if the queue is initialized, we proceed to get the head of the queue
What has been done:
- Add Queue operator, queue operator admin role and getters
- refactor internal _validPaymentOrder() and call the function
  in different funcitons to replace individual validation statements
- Remove timestamp from event emit
- Update natspec across different functions
- Refactor _validateFlagsAndData() to return boolean instead of revert
- Remove unused imports
What has been done:
- Remove duplicate check for 0 order ID
- Change revert in _validPaymentToken() to return boolean instead
Zitzak and others added 7 commits January 24, 2025 13:08
- Fix main configuration and role assignments in E2E tests
- Reorganize preconditions for better test structure
- Fix and enable 8 test cases in QueueBaseFundingManagerAndPaymentProcessorE2E
- Improve role assignment logic with correct module addresses
- Clean up test initialization and setup process
- Ensure proper role hierarchy in _setadminroles function
- Format code
What has been done?
- Add addresses, getters and setters for cancelled and failed order
  treasuries
- fix _orders mapping to work with multiple clients
- Add function to claim unclaimableAmount from blacklisted address
  to the right treasury
- Refactor cancelPaymentOrderThroughQueueId
- Refactor _executePaymentTransfer such that transfers are handled
  seperately, as transfers are needed across the module
@Zitzak
Copy link
Collaborator

Zitzak commented Jan 31, 2025

This branch got merged into the ZealynxSecurity/Feature/FM_PC_ExternalPrice feature branch, for which a PR is open here

@Zitzak Zitzak closed this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants