Conversation
MasterVault
* many vaults per gw and gwr, simplify initializers and creator, refactor MVF, add comments/todos/questions * note about transferring funds * comments
fix stack too deep with `CreateTokenBridgeArgs` struct
add ownership to MVF
gzeoneth
requested changes
Jan 28, 2026
Member
gzeoneth
left a comment
There was a problem hiding this comment.
we should merge ybb and have actual integration test
Member
There was a problem hiding this comment.
mismatch actual interface(contracts/tokenbridge/libraries/vault/IMasterVaultFactory.sol), should remove this file after merge
|
|
||
| if (masterVaultFactory != address(0)) { | ||
| address masterVault = IMasterVaultFactory(masterVaultFactory).getVault(_l1Token); | ||
| amountReceived = IERC4626(masterVault).deposit(amountReceived, address(this)); |
| import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | ||
| import "@openzeppelin/contracts/utils/Create2.sol"; | ||
| import "@openzeppelin/contracts/utils/Address.sol"; | ||
| import "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol"; |
Member
There was a problem hiding this comment.
we should not assume 4626, remove this import
|
|
||
| if (masterVaultFactory != address(0)) { | ||
| address masterVault = IMasterVaultFactory(masterVaultFactory).getVault(_l1Token); | ||
| amountReceived = IERC4626(masterVault).deposit(amountReceived, address(this)); |
| address _router, | ||
| address _inbox | ||
| address _inbox, | ||
| address _masterVaultFactory |
Member
There was a problem hiding this comment.
hmm I don't like this, why are we making change to the existing gateways? we should just make a NEW ybbGateway
| IERC20(_l1Token).safeTransfer(_dest, _amount); | ||
| if (masterVaultFactory != address(0)) { | ||
| address masterVault = IMasterVaultFactory(masterVaultFactory).getVault(_l1Token); | ||
| IERC20(masterVault).safeTransfer(_dest, _amount); |
Member
There was a problem hiding this comment.
would expect auto withdraw if MV is not underwater (and 100% fee)
| bytes memory deployData = abi.encode( | ||
| callStatic(_token, ERC20.name.selector), | ||
| callStatic(_token, ERC20.symbol.selector), | ||
| callStatic(_token, ERC20.decimals.selector) |
Member
There was a problem hiding this comment.
this is not modified to include the MV decimals (+6) so the token would be deployed with the wrong decimal
| address(l1Templates.masterVaultFactory), | ||
| proxyAdmin | ||
| ); | ||
| IMasterVaultFactory(masterVaultFactory).initialize(upgradeExecutor); |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.