-
Notifications
You must be signed in to change notification settings - Fork 35
chore: restricted eliminate deficit #1067
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -352,7 +352,7 @@ contract Hub is IHub, AccessManaged { | |
| uint256 assetId, | ||
| uint256 amount, | ||
| address spoke | ||
| ) external returns (uint256) { | ||
| ) external restricted returns (uint256) { | ||
| Asset storage asset = _assets[assetId]; | ||
| SpokeData storage callerSpoke = _spokes[assetId][msg.sender]; | ||
| SpokeData storage coveredSpoke = _spokes[assetId][spoke]; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check coveredSpoke is registered |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,6 +147,7 @@ abstract contract Base is Test { | |
| address internal HUB_ADMIN = makeAddr('HUB_ADMIN'); | ||
| address internal SPOKE_ADMIN = makeAddr('SPOKE_ADMIN'); | ||
| address internal USER_POSITION_UPDATER = makeAddr('USER_POSITION_UPDATER'); | ||
| address internal HUB_UMBRELLA = makeAddr('HUB_UMBRELLA'); | ||
| address internal TREASURY_ADMIN = makeAddr('TREASURY_ADMIN'); | ||
| address internal LIQUIDATOR = makeAddr('LIQUIDATOR'); | ||
| address internal POSITION_MANAGER = makeAddr('POSITION_MANAGER'); | ||
|
|
@@ -303,6 +304,9 @@ abstract contract Base is Test { | |
| manager.grantRole(Roles.USER_POSITION_UPDATER_ROLE, SPOKE_ADMIN, 0); | ||
| manager.grantRole(Roles.USER_POSITION_UPDATER_ROLE, USER_POSITION_UPDATER, 0); | ||
|
|
||
| manager.grantRole(Roles.HUB_UMBRELLA_ROLE, HUB_ADMIN, 0); | ||
| manager.grantRole(Roles.HUB_UMBRELLA_ROLE, HUB_UMBRELLA, 0); | ||
|
|
||
| // Grant responsibilities to roles | ||
| { | ||
| bytes4[] memory selectors = new bytes4[](7); | ||
|
|
@@ -333,6 +337,12 @@ abstract contract Base is Test { | |
| selectors[5] = IHub.mintFeeShares.selector; | ||
| manager.setTargetFunctionRole(address(targetHub), selectors, Roles.HUB_ADMIN_ROLE); | ||
| } | ||
|
|
||
| { | ||
| bytes4[] memory selectors = new bytes4[](1); | ||
| selectors[0] = IHub.eliminateDeficit.selector; | ||
| manager.setTargetFunctionRole(address(targetHub), selectors, Roles.HUB_UMBRELLA_ROLE); | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you put this into a helper func, will be easier to refactor later
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this could be refactored via the payload engine PR, like for other roles
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep let's do it there |
||
| vm.stopPrank(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check asset is registered