feat: add permissioned borrow access manager - #1336
Conversation
There was a problem hiding this comment.
can you please add gas snapshots for using this access manager ? I suspect this adds ~5-10k gas costs
| } | ||
|
|
||
| /// @inheritdoc IAccessManager | ||
| function canCall( |
There was a problem hiding this comment.
I personally don't like the complexity of mantaining a modified OZ Access Manager
There was a problem hiding this comment.
canCall is virtual so we can just add custom logic in PermissionedBorrowAccessManager without touching OZ deps no? @AlbertoCentonze
smt like
function canCall() override {
if target and selector is spoke and borrow(), then call custom logic
else super.canCall()
}
There was a problem hiding this comment.
we can keep the onlyPositionManager as is, and only add restricted
There was a problem hiding this comment.
We need a method overload that uses bytes instead bytes4 but yes technical we can just build on top. It still a custom implementation technically
| uint256 amount, | ||
| address onBehalfOf | ||
| ) external nonReentrant onlyPositionManager(onBehalfOf) returns (uint256, uint256) { | ||
| ) external nonReentrant restricted returns (uint256, uint256) { |
There was a problem hiding this comment.
one advantage of this is that we can reuse the same spoke impl for canonical and permissioned/horizon spokes
There was a problem hiding this comment.
this is because we are moving the onlyPositionManager to the access manager. If we don't do it, we may need a seaprate implementation anyway for collateral seizing
| } | ||
|
|
||
| /// @dev To be overridden by the inheriting Spoke instance contract. | ||
| function initialize(address authority) external virtual; |
There was a problem hiding this comment.
upside is that by just updating the authority via setAuthority we can modify general access control
no upgrade required, no separate implemenation for restricting access
No description provided.