Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
deploy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
deploy
Commits
6b9e6161
Commit
6b9e6161
authored
Apr 17, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update contract for withdrawal
parent
742f056f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
311 additions
and
149 deletions
+311
-149
Deploy.s.sol
layer2/contracts-bedrock/scripts/deploy/Deploy.s.sol
+36
-36
OptimismPortal.sol
layer2/contracts-bedrock/src/L1/OptimismPortal.sol
+253
-113
Hashing.sol
layer2/contracts-bedrock/src/libraries/Hashing.sol
+7
-0
Types.sol
layer2/contracts-bedrock/src/libraries/Types.sol
+15
-0
No files found.
layer2/contracts-bedrock/scripts/deploy/Deploy.s.sol
View file @
6b9e6161
...
@@ -1424,46 +1424,46 @@ contract Deploy is Deployer {
...
@@ -1424,46 +1424,46 @@ contract Deploy is Deployer {
/// @notice Sets the implementation for the `CANNON` game type in the `DisputeGameFactory`
/// @notice Sets the implementation for the `CANNON` game type in the `DisputeGameFactory`
function setCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
function setCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
//
console.log("Setting Cannon FaultDisputeGame implementation");
//
console.log("Setting Cannon FaultDisputeGame implementation");
//
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
//
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
//
DelayedWETH weth = DelayedWETH(mustGetAddress("DelayedWETHProxy"));
//
DelayedWETH weth = DelayedWETH(mustGetAddress("DelayedWETHProxy"));
//
//
// Set the Cannon FaultDisputeGame implementation in the factory.
//
// Set the Cannon FaultDisputeGame implementation in the factory.
//
_setFaultGameImplementation({
//
_setFaultGameImplementation({
//
_factory: factory,
//
_factory: factory,
//
_allowUpgrade: _allowUpgrade,
//
_allowUpgrade: _allowUpgrade,
//
_params: FaultDisputeGameParams({
//
_params: FaultDisputeGameParams({
//
anchorStateRegistry: AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
//
anchorStateRegistry: AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
//
weth: weth,
//
weth: weth,
//
gameType: GameTypes.CANNON,
//
gameType: GameTypes.CANNON,
//
absolutePrestate: loadMipsAbsolutePrestate(),
//
absolutePrestate: loadMipsAbsolutePrestate(),
//
faultVm: IBigStepper(mustGetAddress("Mips")),
//
faultVm: IBigStepper(mustGetAddress("Mips")),
//
maxGameDepth: cfg.faultGameMaxDepth(),
//
maxGameDepth: cfg.faultGameMaxDepth(),
//
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration()))
//
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration()))
//
})
//
})
//
});
//
});
}
}
/// @notice Sets the implementation for the `PERMISSIONED_CANNON` game type in the `DisputeGameFactory`
/// @notice Sets the implementation for the `PERMISSIONED_CANNON` game type in the `DisputeGameFactory`
function setPermissionedCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
function setPermissionedCannonFaultGameImplementation(bool _allowUpgrade) public broadcast {
//
console.log("Setting Cannon PermissionedDisputeGame implementation");
//
console.log("Setting Cannon PermissionedDisputeGame implementation");
//
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
//
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
//
DelayedWETH weth = DelayedWETH(mustGetAddress("PermissionedDelayedWETHProxy"));
//
DelayedWETH weth = DelayedWETH(mustGetAddress("PermissionedDelayedWETHProxy"));
//
//
// Set the Cannon FaultDisputeGame implementation in the factory.
//
// Set the Cannon FaultDisputeGame implementation in the factory.
//
_setFaultGameImplementation({
//
_setFaultGameImplementation({
//
_factory: factory,
//
_factory: factory,
//
_allowUpgrade: _allowUpgrade,
//
_allowUpgrade: _allowUpgrade,
//
_params: FaultDisputeGameParams({
//
_params: FaultDisputeGameParams({
//
anchorStateRegistry: AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
//
anchorStateRegistry: AnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
//
weth: weth,
//
weth: weth,
//
gameType: GameTypes.PERMISSIONED_CANNON,
//
gameType: GameTypes.PERMISSIONED_CANNON,
//
absolutePrestate: loadMipsAbsolutePrestate(),
//
absolutePrestate: loadMipsAbsolutePrestate(),
//
faultVm: IBigStepper(mustGetAddress("Mips")),
//
faultVm: IBigStepper(mustGetAddress("Mips")),
//
maxGameDepth: cfg.faultGameMaxDepth(),
//
maxGameDepth: cfg.faultGameMaxDepth(),
//
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration()))
//
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration()))
//
})
//
})
//
});
//
});
}
}
/// @notice Sets the implementation for the `ALPHABET` game type in the `DisputeGameFactory`
/// @notice Sets the implementation for the `ALPHABET` game type in the `DisputeGameFactory`
...
...
layer2/contracts-bedrock/src/L1/OptimismPortal.sol
View file @
6b9e6161
This diff is collapsed.
Click to expand it.
layer2/contracts-bedrock/src/libraries/Hashing.sol
View file @
6b9e6161
...
@@ -107,6 +107,13 @@ library Hashing {
...
@@ -107,6 +107,13 @@ library Hashing {
return keccak256(abi.encode(_tx.nonce, _tx.sender, _tx.target, _tx.value, _tx.gasLimit, _tx.data));
return keccak256(abi.encode(_tx.nonce, _tx.sender, _tx.target, _tx.value, _tx.gasLimit, _tx.data));
}
}
/// @notice Derives the withdrawal hash according to the encoding in the L2.
/// @param _param Withdrawal param to hash.
/// @return Hashed withdrawal param.
function hashExChainWithdrawal(Types.ExChainWithdrawalParam memory _param) internal pure returns (bytes32) {
return keccak256(abi.encode(_param.user, _param.coin, _param.value, _param.txHash));
}
/// @notice Hashes the various elements of an output root proof into an output root hash which
/// @notice Hashes the various elements of an output root proof into an output root hash which
/// can be used to check if the proof is valid.
/// can be used to check if the proof is valid.
/// @param _outputRootProof Output root proof which should hash to an output root.
/// @param _outputRootProof Output root proof which should hash to an output root.
...
...
layer2/contracts-bedrock/src/libraries/Types.sol
View file @
6b9e6161
...
@@ -67,4 +67,19 @@ library Types {
...
@@ -67,4 +67,19 @@ library Types {
uint256 gasLimit;
uint256 gasLimit;
bytes data;
bytes data;
}
}
struct ExChainWithdrawalParam {
uint256 value;
address user;
bytes coin;
bytes32 txHash;
}
struct BatchExChainWithdrawalParam {
uint256 value;
address user;
bytes coin;
bytes32 txHash;
bytes[] _withdrawalProof;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment