Skip to content

Commit 981e365

Browse files
committed
Create generic User to proxy arbitrary requests
1 parent c25de70 commit 981e365

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

contracts/util/User.sol

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pragma solidity ^0.8.0;
2+
3+
contract User {
4+
function proxy(
5+
address _target,
6+
bytes memory _calldata
7+
) public returns (bool success, bytes memory returnData) {
8+
(success, returnData) = _target.call(_calldata);
9+
}
10+
11+
function proxy(
12+
address _target,
13+
bytes memory _calldata,
14+
uint256 _value
15+
) public returns (bool success, bytes memory returnData) {
16+
(success, returnData) = _target.call{value: _value}(_calldata);
17+
}
18+
19+
receive() external payable {}
20+
}

0 commit comments

Comments
 (0)