-
Notifications
You must be signed in to change notification settings - Fork 75
improve: Add ability to unwhitelist a route #66
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
contracts/HubPool.sol
Outdated
| "setEnableRoute(address,uint256,bool)", | ||
| originToken, | ||
| destinationChainId, | ||
| (destinationToken != address(0)) // We assume that setting the destination token to 0x0 for any route |
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.
the other option would be to add a bool to the props and let the caller pass it in. either is ok I think but what you have here does make some implementations impossible (if the target chain actually uses destinationToken of 0x0, which should never happen)
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.
let's add a bool to the function call params then as the gas increase is not important for a function that shoudn't be called that frequently
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.
If we did it with a bool, we'd need additional branching at the top of this method.
I do think using 0x0 is a bit more subtle, but the implementation might be a little cleaner this way.
I think either way makes sense.
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 additional branching is fine for functions where we are not as gas cost sensitive like this one
contracts/HubPool.sol
Outdated
| "setEnableRoute(address,uint256,bool)", | ||
| originToken, | ||
| destinationChainId, | ||
| (destinationToken != address(0)) // We assume that setting the destination token to 0x0 for any route |
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.
If we did it with a bool, we'd need additional branching at the top of this method.
I do think using 0x0 is a bit more subtle, but the implementation might be a little cleaner this way.
I think either way makes sense.
No description provided.