Skip to content

feat: Payment Split#46

Merged
drewstone merged 6 commits intomainfrom
shady/payment-split
Dec 19, 2024
Merged

feat: Payment Split#46
drewstone merged 6 commits intomainfrom
shady/payment-split

Conversation

@shekohex
Copy link
Contributor

@shekohex shekohex commented Dec 17, 2024

This pull request includes significant changes to the asset management system in the blockchain project. The main focus is the introduction of the AssetsLib.sol library and the refactoring of the BlueprintServiceManagerBase contract to utilize this new library. Additionally, some redundant code has been removed, and new utility functions have been added.

Introduction of AssetsLib.sol library:

  • Added a new library AssetsLib.sol to handle asset types and conversions, including enums, structs, and utility functions for asset management.

Refactoring to use AssetsLib.sol:

  • Updated BlueprintServiceManagerBase to use the new Assets library for asset management, replacing the old ServiceOperators library. This includes changes to functions such as _permitAsset, _revokeAsset, _getPermittedAssets, and _isAssetPermitted. [1] [2] [3] [4] [5] [6] [7]

Removal of redundant code:

  • Removed the ServiceOperators library from IBlueprintServiceManager.sol and replaced it with an import statement for the new ServiceOperatorsLib.sol. [1] [2]

Additional imports and utility usage:

  • Added new imports and utility functions in MasterBlueprintServiceManager.sol to support the Assets library and SafeERC20 for handling ERC20 tokens. [1] [2]

These changes improve the modularity and readability of the codebase by centralizing asset management logic within a dedicated library.

Closes #24
Closes #16

@github-actions
Copy link

github-actions bot commented Dec 17, 2024

LCOV of commit e9e2ca8 during Foundry CI #36

Summary coverage rate:
  lines......: 85.1% (274 of 322 lines)
  functions..: 83.0% (73 of 88 functions)
  branches...: 62.2% (23 of 37 branches)

Files changed coverage rate:
                                       |Lines       |Functions  |Branches    
  Filename                             |Rate     Num|Rate    Num|Rate     Num
  ===========================================================================
  src/AssetsLib.sol                    |21.2%     33| 171%     7|    -      0
  src/BlueprintServiceManagerBase.sol  |39.7%     58|13.0%    23|    -      0
  src/MasterBlueprintServiceManager.sol|18.5%    124|47.8%    23|    -      0
  src/Permissions.sol                  |62.5%      8| 0.0%     3|    -      0
  src/ServiceOperatorsLib.sol          |    -      0|    -     0|    -      0
  test/MockBlueprintServiceManager.sol |57.1%     14| 0.0%     7|    -      0

@shekohex shekohex force-pushed the shady/payment-split branch from cdb2a5b to 985037e Compare December 18, 2024 19:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 10 changed files in this pull request and generated no comments.

Files not reviewed (9)
  • src/AssetsLib.sol: Language not supported
  • src/BlueprintServiceManagerBase.sol: Language not supported
  • src/IBlueprintServiceManager.sol: Language not supported
  • src/MasterBlueprintServiceManager.sol: Language not supported
  • src/Permissions.sol: Language not supported
  • src/ServiceOperatorsLib.sol: Language not supported
  • test/BlueprintServiceManagerBase.t.sol: Language not supported
  • test/Dummy.t.sol: Language not supported
  • test/MockBlueprintServiceManager.sol: Language not supported

@shekohex shekohex marked this pull request as ready for review December 18, 2024 20:09
@drewstone drewstone merged commit 1072c28 into main Dec 19, 2024
2 checks passed
@shekohex shekohex deleted the shady/payment-split branch December 19, 2024 07:02
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.

[TASK] Implement payment split mechanism [TASK] Add operatorAddressFromPublicKey to the BlueprintServiceManager Base contract

2 participants