Skip to content
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

SMR-1834-WETH-Bridging #12

Merged
merged 17 commits into from
Oct 26, 2023
Merged

SMR-1834-WETH-Bridging #12

merged 17 commits into from
Oct 26, 2023

Conversation

proletesseract
Copy link
Contributor

WETH bridging is now handled. WETH is unwrapped and send as ETH through the bridge.

Callouts

  • Added interface for WETH for use in the bridge contracts
  • Added contract for WETH (copied from the WIMX contract) for use in the test suite.
  • Added receive() external payable {} method to root bridge so the WETH contract can send the ETH back which we unwrap.
  • Unit and Integration tests added

Comment on lines 24 to 26
address rootIMXToken = vm.envAddress("ROOT_IMX_ADDRESS");
address rootWETHToken = vm.envAddress("ROOT_WETH_ADDRESS");

Copy link
Collaborator

@Benjimmutable Benjimmutable Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add the steps into ./deploy.sh that deploy WETH (if local), and instructions in README for how to trigger this local deployment of WETH, and explaining that it needs to be manually set iff ./deploy.sh is not going to be run with the local flag

src/root/RootERC20Bridge.sol Outdated Show resolved Hide resolved
src/root/RootERC20Bridge.sol Outdated Show resolved Hide resolved
src/root/RootERC20Bridge.sol Outdated Show resolved Hide resolved
@proletesseract
Copy link
Contributor Author

I've addressed the feedback here.

  • Fixed the nits
  • Reorganised the root bridge contract to meet the layout guidelines linked
  • Restructured the main if/else statement in the _deposit function to be a bit clearer on whats happening
  • Removed the need to parse in the feeAmount
  • Added a WETHDeposit event
  • Removed the _depositWrappedETH function and simply called deposit after the unwrapping

One thing i was thinking is we could just put the deposit call at the end of the _unwrapETH function and remove the need to call it then _deposit. We don't have a use case for only unwrapping yet and it's a private function, so currently its technically more modular than it needs to be. Not sure it's a big deal, happy to leave it how it is unless any major objections.

@Benjimmutable Benjimmutable self-requested a review October 26, 2023 04:47
@proletesseract
Copy link
Contributor Author

the question i had above has been resolved and we decided to go with the option of combining the unwrapping and deposit steps into one function

@proletesseract proletesseract merged commit ff42ce1 into sprint-1-poc Oct 26, 2023
3 checks passed
@proletesseract proletesseract deleted the SMR-1834-WETH-Bridging branch October 26, 2023 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants