-
Notifications
You must be signed in to change notification settings - Fork 165
feat: yield bearing bridge #177
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
Open
waelsy123
wants to merge
94
commits into
main
Choose a base branch
from
feat/yield-bearing-bridge-full
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
Changes from 28 commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
11e3993
test ci
waelsy123 4be3547
update foundry.toml
waelsy123 8bb6035
add master vault contracts
waelsy123 fb019c4
fixup! add master vault contracts
waelsy123 e2edd95
fix: slither reentrancy in Mastervault
waelsy123 2fe0126
test: add mastervault test util contracts
waelsy123 10a8d51
test: add mastervault tests
waelsy123 244c278
add yield bearing gateways
waelsy123 2952945
fixup! add yield bearing gateways
waelsy123 3f643a0
add L1YbbBridgeDeployer lib
waelsy123 3cef66b
introduce L1GatewayDeployer lib to reduce L1AtomicTokenBridgeCreator …
waelsy123 3fc04d3
fixup! introduce L1GatewayDeployer lib to reduce L1AtomicTokenBridgeC…
waelsy123 e114255
test: e2e Ybb deposit test
waelsy123 5597e1f
fix: use vault shares decimals
waelsy123 b26c54c
fix: initiate local roles
waelsy123 ce02657
fix: check 0 shares
waelsy123 4aadcf0
fix: add event TargetAllocationUpdated
waelsy123 520a371
rebalance affects profit assets too
godzillaba 1f3e22c
test: more rebalance tests
waelsy123 6bf9f42
fix: remove toggle perf fee
waelsy123 2b0c724
fixup! test: more rebalance tests
waelsy123 de28387
fix: use safeIncreaseAllowance instead of safeApprove
waelsy123 6e0107d
refactor: use CREATE2 determinstic deployments
waelsy123 0f8d4d3
ybb fee-token gateways
waelsy123 3f49a2a
fix: defaultSubVault mint extra shares
waelsy123 cc6c1b5
fixup! fix: defaultSubVault mint extra shares
waelsy123 9654a8f
1.2.1
godzillaba 89a4dfa
Revert "1.2.1"
godzillaba fc59687
properly restrict default subvault
godzillaba 990ef5b
add mastervault role admin tests
godzillaba dd546bc
large mutation test file
godzillaba d074bf8
slight rebalance comment improvement
godzillaba 6ab1b86
scaffold mutation test files
godzillaba 77312db
access control tests moved
godzillaba b9ec81c
default subvault tests moved
godzillaba dde5aa9
move fees tests over
godzillaba 4da7e91
start invariant testing
godzillaba e820d2f
invariant readme
godzillaba 3dc37d0
reorganize mutation tests
godzillaba ae3147d
decimals test
godzillaba c94b7ed
no calls on zero amountToTransfer
godzillaba b8ac8f3
move roles tests into more comprehensive file
godzillaba 1cad122
move only_master_vault test
godzillaba 7044927
restore gitignore
godzillaba b4ae0ab
restore test files
godzillaba 08c5321
organize tests
godzillaba 778f1f4
remove mutation base
godzillaba e2e3dc5
introduce YbbVaultLib for deposit & withdraw from vault
waelsy123 ec1a72b
0% rebalancing special case
godzillaba a3149d3
refactor rebalance
godzillaba 4eb1bf5
simpler fuzz vault
godzillaba 4a98dfb
Merge branch 'ha/ybb-rebalance-refactor' into ha/ybb-invariant-tests
godzillaba 51641a2
no empty expectRevert
godzillaba 74626ed
test 0% rebalance
godzillaba fab56c8
Merge branch 'ha/ybb-mutation-testing' into ha/ybb-rebalance-refactor
godzillaba 455e979
Merge branch 'ha/ybb-rebalance-refactor' into ha/ybb-invariant-tests
godzillaba 0910434
fix stale natspec and ambiguous event
godzillaba e02ec94
small natspec change
godzillaba e274e7c
Merge branch 'ha/ybb-rebalance-refactor' into ha/ybb-invariant-tests
godzillaba 0e61d92
rebalance to zero invariant test
godzillaba 3801a2d
fuzz rounding error
godzillaba 990f01a
invariant_depositRedeemNoValueExtraction
godzillaba b7f0905
Merge branch 'feat/yield-bearing-bridge-full' into ha/ybb-mutation-te…
godzillaba 2a03d02
Merge branch 'ha/ybb-mutation-testing' into ha/ybb-rebalance-refactor
godzillaba 864d982
Merge branch 'ha/ybb-rebalance-refactor' into ha/ybb-invariant-tests
godzillaba d5dae5b
delete readme and fuzz file
godzillaba 50cfcdb
invariant_feeDistributionBounded
godzillaba 0cd8883
fix conversion functions to return ideal ratios when vault is healthy
godzillaba 5f21f5a
better invariant_feeDistributionBounded
godzillaba 15d44f0
Merge branch 'ha/ybb-invariant-tests' into ha/ybb-ratio-drift-fix
godzillaba 21fd31b
fix stale docs
godzillaba abe121b
Merge pull request #182 from OffchainLabs/ha/ybb-ratio-drift-fix
waelsy123 45197cc
Merge pull request #181 from OffchainLabs/ha/ybb-invariant-tests
waelsy123 a1ba0e6
Merge pull request #179 from OffchainLabs/ha/ybb-rebalance-refactor
waelsy123 b459155
Merge pull request #178 from OffchainLabs/ha/ybb-mutation-testing
godzillaba da59267
fix bad fsv maxWithdraw
godzillaba ad6630a
fix div by zero in slippage check
godzillaba 60f4c0f
change manipulation meanings
godzillaba 2a1b7bf
clean up fsv
godzillaba 8f87592
rebalance idempotent
godzillaba 0410682
invariant_redeemRateNeverAbovePar
godzillaba 44f4973
remove confusing ghost manipulation vars
godzillaba 15a8474
no manipulation invariants inheritance
godzillaba f2e4b34
invariant_rebalancePreservesTotalAssets
godzillaba 9986968
two handlers, remove trivial tests
godzillaba 1a0eddd
reorganize invariant tests and fix broken rebalance test
godzillaba 618f4de
simplify handler
godzillaba 7d5e5cd
add distribute fee value conservation test and remove useless invariants
godzillaba 36a2a65
remove unused logstate func
godzillaba e96d3dc
fix visibility
godzillaba 04fc167
fix slither
godzillaba 8f0def3
add donation attack invariants
godzillaba d29598b
Merge pull request #184 from OffchainLabs/ha/ybb-more-invariant-tests
waelsy123 052c65d
improved donation attack tests
godzillaba 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 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
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
311 changes: 198 additions & 113 deletions
311
contracts/tokenbridge/ethereum/L1AtomicTokenBridgeCreator.sol
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,216 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity ^0.8.4; | ||
|
|
||
| import {L1ERC20Gateway} from "./gateway/L1ERC20Gateway.sol"; | ||
| import {L1CustomGateway} from "./gateway/L1CustomGateway.sol"; | ||
| import {L1WethGateway} from "./gateway/L1WethGateway.sol"; | ||
| import {L1OrbitERC20Gateway} from "./gateway/L1OrbitERC20Gateway.sol"; | ||
| import {L1OrbitCustomGateway} from "./gateway/L1OrbitCustomGateway.sol"; | ||
| import {L1YbbERC20Gateway} from "./gateway/L1YbbERC20Gateway.sol"; | ||
| import {L1YbbCustomGateway} from "./gateway/L1YbbCustomGateway.sol"; | ||
| import {L1OrbitYbbERC20Gateway} from "./gateway/L1OrbitYbbERC20Gateway.sol"; | ||
| import {L1OrbitYbbCustomGateway} from "./gateway/L1OrbitYbbCustomGateway.sol"; | ||
| import {IMasterVaultFactory} from "../libraries/vault/IMasterVaultFactory.sol"; | ||
| import {IGatewayRouter} from "../libraries/gateway/IGatewayRouter.sol"; | ||
| import {ClonableBeaconProxy} from "../libraries/ClonableBeaconProxy.sol"; | ||
| import { | ||
| TransparentUpgradeableProxy | ||
| } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | ||
|
|
||
| /** | ||
| * @title L1GatewayDeployer | ||
| * @notice Library for deploying all L1 gateway components (standard, custom, WETH, and YBB) | ||
| */ | ||
| library L1GatewayDeployer { | ||
| // ============ Standard Gateway Structs ============ | ||
|
|
||
| struct StandardDeploymentParams { | ||
| address inbox; | ||
| address proxyAdmin; | ||
| address upgradeExecutor; | ||
| address router; | ||
| address l2StandardGateway; | ||
| address l2CustomGateway; | ||
| address l2BeaconProxyFactory; | ||
| bool isFeeTokenBased; | ||
| } | ||
|
|
||
| struct StandardTemplates { | ||
| address standardGatewayTemplate; | ||
| address feeTokenBasedStandardGatewayTemplate; | ||
| address customGatewayTemplate; | ||
| address feeTokenBasedCustomGatewayTemplate; | ||
| } | ||
|
|
||
| struct StandardDeploymentResult { | ||
| address standardGateway; | ||
| address customGateway; | ||
| } | ||
|
|
||
| // ============ WETH Gateway Structs ============ | ||
|
|
||
| struct WethDeploymentParams { | ||
| address inbox; | ||
| address proxyAdmin; | ||
| address router; | ||
| address l2WethGateway; | ||
| address l1Weth; | ||
| address l2Weth; | ||
| } | ||
|
|
||
| struct WethDeploymentResult { | ||
| address wethGateway; | ||
| } | ||
|
|
||
| // ============ YBB Gateway Structs ============ | ||
|
|
||
| struct YbbDeploymentParams { | ||
| address inbox; | ||
| address proxyAdmin; | ||
| address upgradeExecutor; | ||
| address router; | ||
| address l2StandardGateway; | ||
| address l2CustomGateway; | ||
| address l2BeaconProxyFactory; | ||
| bool isFeeTokenBased; | ||
| } | ||
|
|
||
| struct YbbTemplates { | ||
| address ybbStandardGatewayTemplate; | ||
| address ybbCustomGatewayTemplate; | ||
| address feeTokenBasedYbbStandardGatewayTemplate; | ||
| address feeTokenBasedYbbCustomGatewayTemplate; | ||
| address masterVaultFactoryTemplate; | ||
| } | ||
|
|
||
| struct YbbDeploymentResult { | ||
| address masterVaultFactory; | ||
| address standardGateway; | ||
| address customGateway; | ||
| } | ||
|
|
||
| // ============ Standard Gateway Deployment ============ | ||
|
|
||
| function deployStandardGateways( | ||
| StandardDeploymentParams memory params, | ||
| StandardTemplates memory templates, | ||
| bytes32 standardGatewaySalt, | ||
| bytes32 customGatewaySalt | ||
| ) external returns (StandardDeploymentResult memory result) { | ||
| { | ||
| address template = params.isFeeTokenBased | ||
| ? templates.feeTokenBasedStandardGatewayTemplate | ||
| : templates.standardGatewayTemplate; | ||
|
|
||
| result.standardGateway = _deployProxy(standardGatewaySalt, template, params.proxyAdmin); | ||
|
|
||
| L1ERC20Gateway(result.standardGateway) | ||
| .initialize( | ||
| params.l2StandardGateway, | ||
| params.router, | ||
| params.inbox, | ||
| keccak256(type(ClonableBeaconProxy).creationCode), | ||
| params.l2BeaconProxyFactory | ||
| ); | ||
| } | ||
|
|
||
| { | ||
| address template = params.isFeeTokenBased | ||
| ? templates.feeTokenBasedCustomGatewayTemplate | ||
| : templates.customGatewayTemplate; | ||
|
|
||
| result.customGateway = _deployProxy(customGatewaySalt, template, params.proxyAdmin); | ||
|
|
||
| L1CustomGateway(result.customGateway) | ||
| .initialize( | ||
| params.l2CustomGateway, params.router, params.inbox, params.upgradeExecutor | ||
| ); | ||
| } | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| // ============ WETH Gateway Deployment ============ | ||
|
|
||
| function deployWethGateway( | ||
| WethDeploymentParams memory params, | ||
| address wethGatewayTemplate, | ||
| bytes32 wethGatewaySalt | ||
| ) external returns (WethDeploymentResult memory result) { | ||
| result.wethGateway = _deployProxy(wethGatewaySalt, wethGatewayTemplate, params.proxyAdmin); | ||
|
|
||
| L1WethGateway(payable(result.wethGateway)) | ||
| .initialize( | ||
| params.l2WethGateway, params.router, params.inbox, params.l1Weth, params.l2Weth | ||
| ); | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| // ============ YBB Gateway Deployment ============ | ||
|
|
||
| function deployYbbGateways( | ||
| YbbDeploymentParams memory params, | ||
| YbbTemplates memory templates, | ||
| bytes32 masterVaultSalt, | ||
| bytes32 standardGatewaySalt, | ||
| bytes32 customGatewaySalt | ||
| ) external returns (YbbDeploymentResult memory result) { | ||
| result.masterVaultFactory = _deployProxy( | ||
| masterVaultSalt, templates.masterVaultFactoryTemplate, params.proxyAdmin | ||
| ); | ||
|
|
||
| { | ||
| address template = params.isFeeTokenBased | ||
| ? templates.feeTokenBasedYbbStandardGatewayTemplate | ||
| : templates.ybbStandardGatewayTemplate; | ||
|
|
||
| result.standardGateway = _deployProxy(standardGatewaySalt, template, params.proxyAdmin); | ||
|
|
||
| L1YbbERC20Gateway(result.standardGateway) | ||
| .initialize( | ||
| params.l2StandardGateway, | ||
| params.router, | ||
| params.inbox, | ||
| keccak256(type(ClonableBeaconProxy).creationCode), | ||
| params.l2BeaconProxyFactory, | ||
| result.masterVaultFactory | ||
| ); | ||
| } | ||
|
|
||
| { | ||
| address template = params.isFeeTokenBased | ||
| ? templates.feeTokenBasedYbbCustomGatewayTemplate | ||
| : templates.ybbCustomGatewayTemplate; | ||
|
|
||
| result.customGateway = _deployProxy(customGatewaySalt, template, params.proxyAdmin); | ||
|
|
||
| L1YbbCustomGateway(result.customGateway) | ||
| .initialize( | ||
| params.l2CustomGateway, | ||
| params.router, | ||
| params.inbox, | ||
| params.upgradeExecutor, | ||
| result.masterVaultFactory | ||
| ); | ||
| } | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| function initializeMasterVaultFactory( | ||
| address masterVaultFactory, | ||
| address masterVaultImplementation, | ||
| address admin, | ||
| address router | ||
| ) external { | ||
| IMasterVaultFactory(masterVaultFactory) | ||
| .initialize(masterVaultImplementation, admin, IGatewayRouter(router)); | ||
| } | ||
|
|
||
| // ============ Internal ============ | ||
|
|
||
| function _deployProxy(bytes32 salt, address logic, address admin) internal returns (address) { | ||
| return address(new TransparentUpgradeableProxy{salt: salt}(logic, admin, bytes(""))); | ||
| } | ||
| } |
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
61 changes: 61 additions & 0 deletions
61
contracts/tokenbridge/ethereum/gateway/L1OrbitYbbCustomGateway.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| pragma solidity ^0.8.0; | ||
|
|
||
| import {L1OrbitCustomGateway} from "./L1OrbitCustomGateway.sol"; | ||
| import {L1CustomGateway} from "./L1CustomGateway.sol"; | ||
| import {IMasterVault} from "../../libraries/vault/IMasterVault.sol"; | ||
| import {IMasterVaultFactory} from "../../libraries/vault/IMasterVaultFactory.sol"; | ||
| import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
| import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | ||
|
|
||
| /** | ||
| * @title Layer 1 Gateway contract for bridging Custom ERC20s with YBB enabled in ERC20-based rollup | ||
| * @notice Escrows funds into MasterVaults for yield bearing bridging. | ||
| */ | ||
| contract L1OrbitYbbCustomGateway is L1OrbitCustomGateway { | ||
| using SafeERC20 for IERC20; | ||
|
|
||
| /// @notice Address of the MasterVaultFactory contract | ||
| address public masterVaultFactory; | ||
|
|
||
| function initialize( | ||
| address _l1Counterpart, | ||
| address _l1Router, | ||
| address _inbox, | ||
| address _owner, | ||
| address _masterVaultFactory | ||
| ) public virtual { | ||
| L1CustomGateway.initialize(_l1Counterpart, _l1Router, _inbox, _owner); | ||
| _setMasterVaultFactory(_masterVaultFactory); | ||
| } | ||
|
|
||
| function inboundEscrowTransfer(address _l1Token, address _dest, uint256 _amount) | ||
| internal | ||
| override | ||
| { | ||
| address masterVault = IMasterVaultFactory(masterVaultFactory).getVault(_l1Token); | ||
| IERC20(masterVault).safeTransfer(_dest, _amount); | ||
| } | ||
|
|
||
| function outboundEscrowTransfer(address _l1Token, address _from, uint256 _amount) | ||
| internal | ||
| override | ||
| returns (uint256 amountReceived) | ||
| { | ||
| uint256 prevBalance = IERC20(_l1Token).balanceOf(address(this)); | ||
| IERC20(_l1Token).safeTransferFrom(_from, address(this), _amount); | ||
| uint256 postBalance = IERC20(_l1Token).balanceOf(address(this)); | ||
| amountReceived = postBalance - prevBalance; | ||
|
|
||
| address masterVault = IMasterVaultFactory(masterVaultFactory).getVault(_l1Token); | ||
| IERC20(_l1Token).safeIncreaseAllowance(masterVault, amountReceived); | ||
| amountReceived = IMasterVault(masterVault).deposit(amountReceived); | ||
| require(amountReceived > 0, "ZERO_SHARES"); | ||
| } | ||
|
|
||
| function _setMasterVaultFactory(address _masterVaultFactory) internal { | ||
| require(_masterVaultFactory != address(0), "BAD_MASTER_VAULT_FACTORY"); | ||
| masterVaultFactory = _masterVaultFactory; | ||
| } | ||
| } | ||
91 changes: 91 additions & 0 deletions
91
contracts/tokenbridge/ethereum/gateway/L1OrbitYbbERC20Gateway.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| pragma solidity ^0.8.0; | ||
|
|
||
| import {L1OrbitERC20Gateway} from "./L1OrbitERC20Gateway.sol"; | ||
| import {L1ERC20Gateway} from "./L1ERC20Gateway.sol"; | ||
| import {IMasterVault} from "../../libraries/vault/IMasterVault.sol"; | ||
| import {IMasterVaultFactory} from "../../libraries/vault/IMasterVaultFactory.sol"; | ||
| import {IERC20, ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
| import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | ||
| import {GatewayMessageHandler} from "../../libraries/gateway/GatewayMessageHandler.sol"; | ||
| import {ITokenGateway} from "../../libraries/gateway/ITokenGateway.sol"; | ||
|
|
||
| /** | ||
| * @title Layer 1 Gateway contract for bridging standard ERC20s with YBB enabled in ERC20-based rollup | ||
| * @notice Escrows funds into MasterVaults for yield bearing bridging. | ||
| */ | ||
| contract L1OrbitYbbERC20Gateway is L1OrbitERC20Gateway { | ||
| using SafeERC20 for IERC20; | ||
|
|
||
| /// @notice Address of the MasterVaultFactory contract | ||
| address public masterVaultFactory; | ||
|
|
||
| function initialize( | ||
| address _l2Counterpart, | ||
| address _router, | ||
| address _inbox, | ||
| bytes32 _cloneableProxyHash, | ||
| address _l2BeaconProxyFactory, | ||
| address _masterVaultFactory | ||
| ) public { | ||
| L1ERC20Gateway.initialize( | ||
| _l2Counterpart, _router, _inbox, _cloneableProxyHash, _l2BeaconProxyFactory | ||
| ); | ||
| _setMasterVaultFactory(_masterVaultFactory); | ||
| } | ||
|
|
||
| function inboundEscrowTransfer(address _l1Token, address _dest, uint256 _amount) | ||
| internal | ||
| override | ||
| { | ||
| address masterVault = IMasterVaultFactory(masterVaultFactory).getVault(_l1Token); | ||
| IERC20(masterVault).safeTransfer(_dest, _amount); | ||
| } | ||
|
|
||
| function outboundEscrowTransfer(address _l1Token, address _from, uint256 _amount) | ||
| internal | ||
| override | ||
| returns (uint256 amountReceived) | ||
| { | ||
| uint256 prevBalance = IERC20(_l1Token).balanceOf(address(this)); | ||
| IERC20(_l1Token).safeTransferFrom(_from, address(this), _amount); | ||
| uint256 postBalance = IERC20(_l1Token).balanceOf(address(this)); | ||
| amountReceived = postBalance - prevBalance; | ||
|
|
||
| address masterVault = IMasterVaultFactory(masterVaultFactory).getVault(_l1Token); | ||
| IERC20(_l1Token).safeIncreaseAllowance(masterVault, amountReceived); | ||
| amountReceived = IMasterVault(masterVault).deposit(amountReceived); | ||
| require(amountReceived > 0, "ZERO_SHARES"); | ||
| } | ||
|
|
||
| function getOutboundCalldata( | ||
| address _token, | ||
| address _from, | ||
| address _to, | ||
| uint256 _amount, | ||
| bytes memory _data | ||
| ) public view override returns (bytes memory outboundCalldata) { | ||
| address vault = IMasterVaultFactory(masterVaultFactory).calculateVaultAddress(_token); | ||
|
|
||
| bytes memory deployData = abi.encode( | ||
| callStatic(_token, ERC20.name.selector), | ||
| callStatic(_token, ERC20.symbol.selector), | ||
| callStatic(vault, ERC20.decimals.selector) | ||
| ); | ||
|
|
||
| outboundCalldata = abi.encodeWithSelector( | ||
| ITokenGateway.finalizeInboundTransfer.selector, | ||
| _token, | ||
| _from, | ||
| _to, | ||
| _amount, | ||
| GatewayMessageHandler.encodeToL2GatewayMsg(deployData, _data) | ||
| ); | ||
| } | ||
|
|
||
| function _setMasterVaultFactory(address _masterVaultFactory) internal { | ||
| require(_masterVaultFactory != address(0), "BAD_MASTER_VAULT_FACTORY"); | ||
| masterVaultFactory = _masterVaultFactory; | ||
| } | ||
| } |
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.
bit of a nit, but even though it's a sortof convention in this codebase idk if an address(0) check is very useful
if we keep it though i think it should inlined in the initializer