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

Add Pool Access Control methods #27

Merged
merged 5 commits into from
Sep 28, 2022
Merged

Add Pool Access Control methods #27

merged 5 commits into from
Sep 28, 2022

Conversation

venables
Copy link
Contributor

@venables venables commented Sep 26, 2022

This PR does a few things:

  • Moves all permissioned contracts to the contracts/permissioned folder
  • Adds Permissioned* versions of ServiceConfiguration (control PoolManagers), Pool/PoolFactory (enforce PM rules on Lenders).
  • Removes all permission-based logic from the base contracts.
  • Removes all Verite "Registry" logic, as we will likely not be using a Verite registry at all.
  • Removes ServiceConfigurable, as it was causing issues with inheritance. For now, these methods will be explicitly declared in each contract.

@@ -1,6 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.8.16"]
"compiler-version": ["error", "^0.8.16"],
"func-visibility": ["warn", { "ignoreConstructors": true }]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is recommended to be set to true for solidity >= 0.7.0

@@ -321,6 +320,7 @@ contract Pool is IPool, ERC20 {
*/
function deposit(uint256 assets, address receiver)
external
virtual
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to cover off on the mint as well?

I also notice per the EIP 4626 re: maxMint, maxDeposit: MUST factor in both global and user-specific limits, which I interpret to mean incorporating ACL policies? Not sure how we want to handle that (can also punt).

Copy link
Contributor

@ams9198 ams9198 left a comment

Choose a reason for hiding this comment

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

👍

}

/**
* @inheritdoc Pool
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍 I also even like the shorthand /// @inheritdoc style too.

* @dev Modifier that checks that the caller is the pool's manager.
*/
modifier onlyManagerOfPool() {
require(msg.sender == _pool.manager(), "Pool: caller is not manager");
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, was wondering how we'd handle the case of a pool switching manager's, and needing to update this contract, but this makes sense to just store the pool address 👍

@venables venables merged commit 4a849de into circlefin:master Sep 28, 2022
@venables venables deleted the matt/pool-access-control branch September 28, 2022 13:12
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.

2 participants