Commit 6b9e6161 authored by vicotor's avatar vicotor

update contract for withdrawal

parent 742f056f
...@@ -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`
......
...@@ -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.
......
...@@ -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;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment