-
Notifications
You must be signed in to change notification settings - Fork 2
fix: Initializable ERC20TransferModule #44
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
fix: Initializable ERC20TransferModule #44
Conversation
…d update related tests
LCOV of commit
|
src/example/ERC20TransferModule.sol
Outdated
| constructor(address _crossModule, address _token) { | ||
| CROSS_MODULE = _crossModule; | ||
| TOKEN = IERC20(_token); | ||
| function initialize(address _crossModule, address _token) external initializer { |
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.
initialize can be called by anyone. Isn’t there a risk that it could be initialized maliciously? It might be better to restrict it using Ownable or AccessControl.
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.
fix: cd171a6
mattsu6666
left a comment
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.
LGTM☀️
Because in the original design the constructor for
CrossModulerequired anIContractModule, andERC20TransferModulerequiredCrossModule, creating a circular dependency that prevented deployment, I madeERC20TransferModuleinitializable instead.