-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
310 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.7.0; | ||
pragma experimental ABIEncoderV2; | ||
|
||
import { IERC6777 } from "../interfaces/IBridge.sol"; | ||
|
||
contract WithdrawalWorker { | ||
constructor( | ||
IERC6777 token, | ||
address[] memory targets, | ||
bytes[] memory calldatas | ||
) { | ||
for (uint256 i = 0; i < targets.length; i++) { | ||
(bool success, ) = targets[i].call(calldatas[i]); | ||
require(success, "WW: call failed"); | ||
} | ||
require(token.balanceOf(address(this)) == 0, "Stuck tokens on withdrawal worker"); | ||
assembly { | ||
return(0, 0) | ||
} | ||
} | ||
} |
This file contains 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,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.7.0; | ||
pragma experimental ABIEncoderV2; | ||
|
||
import { IERC6777 } from "../interfaces/IBridge.sol"; | ||
|
||
contract WithdrawalWorkerStuckCheck { | ||
constructor( | ||
IERC6777 token, | ||
address changeReceiver, | ||
address[] memory targets, | ||
bytes[] memory calldatas | ||
) { | ||
for (uint256 i = 0; i < targets.length; i++) { | ||
(bool success, ) = targets[i].call(calldatas[i]); | ||
require(success, "WW: call failed"); | ||
} | ||
uint256 amount = token.balanceOf(address(this)); | ||
token.transfer(changeReceiver, amount); | ||
assembly { | ||
return(0, 0) | ||
} | ||
} | ||
} |
This file contains 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.