-
Notifications
You must be signed in to change notification settings - Fork 107
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
Support Native ETH in v1 #1354
Open
alistair-singh
wants to merge
22
commits into
main
Choose a base branch
from
alistair/support-eth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support Native ETH in v1 #1354
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b75401c
initial support
alistair-singh 7491ff8
add error
alistair-singh 4403dab
ws
alistair-singh a8f7197
test legacy and new unlock messages
alistair-singh e9b860c
fixed tests
alistair-singh 5642145
Merge branch 'alistair/test-new-and-legacy-unlock' into alistair/supp…
alistair-singh 3a8c9d9
fix spelling
alistair-singh 40b51f8
test registration is blocked
alistair-singh 7fb34f3
fix inbound messages
alistair-singh f866356
allow gateway proxy to receive funds
alistair-singh c937338
final tests and fixes
alistair-singh c01db5c
warnings
alistair-singh 0e40439
PR feedback
alistair-singh a9768e1
migrate ether on upgrade
alistair-singh f491ebc
fix scripts
alistair-singh 53b6ae7
update bindings
alistair-singh 10b4343
e2e tests
alistair-singh 89b9e09
fix assert
alistair-singh 8899527
duplicated error removal
alistair-singh 6b984bf
fix test fixture generator
alistair-singh ad9e7fb
template fixes
alistair-singh b24e0c4
contract address changes
alistair-singh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this refund process still required since Gateway now is the vault of Ether? I'd suggest to remove it.
Or for security do we need to add some reentrantlock on outbound calls?
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 just wanted to port the functionality across as is. I changed the code to consider dust like we do in fees so that we do not transfer if the amount is too low. But I think it is good to refund the customer incase of any error in the input, we will not lock and hold more funds than we mint on the other side of the bridge.
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.
@alistair-singh I added a PR #1356 with tests to demonstrate the reentrancy behavior through the refund process.
Adding the
ReentrancyGuard
did enhance the security somehow. On the other hand, it will also cost a bit more gas, and it seems our bridge can't be exploited in this way. So I'm still not sure if it's necessary.Please let me know what you think.
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.
Nice catch! How is
ReentracyGuard
different from thenonentrancy
keyword in solidity 0.28 that we use in Contracts v2?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.
Yeah, the Transient storage version is better.
Btw: There is an OZ version at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/ReentrancyGuardTransient.sol