-
Notifications
You must be signed in to change notification settings - Fork 48
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
Upgrade to OpenZeppelin V5 #806
Conversation
4003ab9
to
6496fe2
Compare
refactor: remove _after and _before hooks and implement _update function refactor: use newly added _requireOwned function refactor: use the new named parameter in ERC20 functions test: add mocks for ERC20 and ERC721 test: use openeppelin's custom errors in cheatcode chore: provide a more precise explanation for _update chore: define "_update" alphabetically docs: document "_update" function test: check IERC20Errors custom error revert
6496fe2
to
bde699b
Compare
docs: use known terminology in _update natspec
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
* build: update openzeppelin to 5.0.0 refactor: remove _after and _before hooks and implement _update function refactor: use newly added _requireOwned function refactor: use the new named parameter in ERC20 functions test: add mocks for ERC20 and ERC721 test: use openeppelin's custom errors in cheatcode chore: provide a more precise explanation for _update chore: define "_update" alphabetically docs: document "_update" function test: check IERC20Errors custom error revert * perf: optimize getRecipient function docs: use known terminology in _update natspec
* build: update openzeppelin to 5.0.0 refactor: remove _after and _before hooks and implement _update function refactor: use newly added _requireOwned function refactor: use the new named parameter in ERC20 functions test: add mocks for ERC20 and ERC721 test: use openeppelin's custom errors in cheatcode chore: provide a more precise explanation for _update chore: define "_update" alphabetically docs: document "_update" function test: check IERC20Errors custom error revert * perf: optimize getRecipient function docs: use known terminology in _update natspec
* build: update openzeppelin to 5.0.0 refactor: remove _after and _before hooks and implement _update function refactor: use newly added _requireOwned function refactor: use the new named parameter in ERC20 functions test: add mocks for ERC20 and ERC721 test: use openeppelin's custom errors in cheatcode chore: provide a more precise explanation for _update chore: define "_update" alphabetically docs: document "_update" function test: check IERC20Errors custom error revert * perf: optimize getRecipient function docs: use known terminology in _update natspec
@@ -14,7 +14,7 @@ import { Broker, LockupDynamic, LockupLinear } from "../src/types/DataTypes.sol" | |||
import { BaseScript } from "./Base.s.sol"; | |||
|
|||
interface IERC20Mint { | |||
function mint(address beneficiary, uint256 amount) external; | |||
function mint(address beneficiary, uint256 value) external; |
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.
Why did you change the amount
to value
here?
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.
because OpenZeppelin does not say amount
anymore but value
for all function parameter names
so, i wanted to follow their approach
Just found a moment to review this PR. Good job, overall.
What do you mean by this? We've upgraded Forge Std in the meantime, so maybe we can switch to their mocks now? |
@andreivladbrg can we please get an answer from you here |
Sorry for not responding to this earlier. I did not receive an email notification for the first message. The mock contracts in
Later edit: I was wrong, we can remove the For the Does this answer your question? |
Regarding the Do you consider that it would be needed to remove the I personally don't think we should make this change atm. |
Yes, thank you for answering. Let's proceed with using their ERC-721 mock.
No. Let's keep using our mock. It would be nice if OpenZeppelin offered a mock for this, though .. |
* build: update openzeppelin to 5.0.0 refactor: remove _after and _before hooks and implement _update function refactor: use newly added _requireOwned function refactor: use the new named parameter in ERC20 functions test: add mocks for ERC20 and ERC721 test: use openeppelin's custom errors in cheatcode chore: provide a more precise explanation for _update chore: define "_update" alphabetically docs: document "_update" function test: check IERC20Errors custom error revert * perf: optimize getRecipient function docs: use known terminology in _update natspec
* build: update openzeppelin to 5.0.0 refactor: remove _after and _before hooks and implement _update function refactor: use newly added _requireOwned function refactor: use the new named parameter in ERC20 functions test: add mocks for ERC20 and ERC721 test: use openeppelin's custom errors in cheatcode chore: provide a more precise explanation for _update chore: define "_update" alphabetically docs: document "_update" function test: check IERC20Errors custom error revert * perf: optimize getRecipient function docs: use known terminology in _update natspec
Closes #702.
Notes about PR:
_after
and_before
hooks, and implements a_update
oneERC20
andERC721
are now abtract contracts, mocks were required. i know thatforge-std
offers an implementation, but they don't implemented the OpenZeppelin version (which we need in our code for the hooks called) and it would not be consistent. also, we would have needed to upgrade to the a newer version, which would trigger other incompatibilities. thus, it is better to keep the mocks in our code base.Snip from release