-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#4] Add test delegate contract, add test case for root access action
- Loading branch information
Showing
3 changed files
with
62 additions
and
1 deletion.
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,17 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
pragma solidity ^0.8.18; | ||
|
||
contract TestDelegateCallReceiver { | ||
address immutable ethReceiver; | ||
Check warning on line 5 in contracts/test/TestDelegateCallReceiver.sol
|
||
|
||
constructor(address _ethReceiver) { | ||
ethReceiver = _ethReceiver; | ||
} | ||
|
||
receive() external payable { | ||
(bool success, bytes memory data) = ethReceiver.call{value: address(this).balance}(""); | ||
Check warning on line 12 in contracts/test/TestDelegateCallReceiver.sol
|
||
if (!success) { | ||
revert("Failed to send eth"); | ||
} | ||
} | ||
} |
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