-
Notifications
You must be signed in to change notification settings - Fork 2
feat(vault): add UnbondingPeriodAuthorizer #17
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
Conversation
| import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; | ||
| import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | ||
| import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; |
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.
Imports are not sorted, but should be (according to our Solidity Style Guide, sections 8.B and 8.C)
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.
Good point! Thanks
| function authorize( | ||
| address owner, | ||
| address token, | ||
| uint256 // amount - not used | ||
| ) public view override returns (bool) { |
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.
When implementing an interface function, the style guide recommends not using the override keyword.
Style Guide, section 2.A: "Do not use override keyword when implementing an interface function."
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.
Agree, thanks
| function completeUnbondingRequest(address token) external { | ||
| _completeUnbondingRequest(msg.sender, token); | ||
| } |
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.
According to the Operational Advice section (3.A.2: "Avoid using msg.sender for permissionless functions.") this function should take an explicit address account parameter to improve interoperability.
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.
This function is not permissionless as a user should be able to complete only their own unbonding requests.
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.
I think I will modify the clarify the formulation of "permissionless functions" in Operational Advice.
No description provided.