Skip to content

Commit 9b91ad9

Browse files
authored
Merge pull request #44 from aviggiano/feat/user
Create generic User to proxy arbitrary requests
2 parents 578acac + 981e365 commit 9b91ad9

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)