From 981e3659a9a51f71e03a6f8b2a94a86aaa41e657 Mon Sep 17 00:00:00 2001 From: Antonio Guilherme Ferreira Viggiano Date: Sun, 10 Sep 2023 19:45:03 -0300 Subject: [PATCH] Create generic User to proxy arbitrary requests --- contracts/util/User.sol | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 contracts/util/User.sol diff --git a/contracts/util/User.sol b/contracts/util/User.sol new file mode 100644 index 0000000..2cb049a --- /dev/null +++ b/contracts/util/User.sol @@ -0,0 +1,20 @@ +pragma solidity ^0.8.0; + +contract User { + function proxy( + address _target, + bytes memory _calldata + ) public returns (bool success, bytes memory returnData) { + (success, returnData) = _target.call(_calldata); + } + + function proxy( + address _target, + bytes memory _calldata, + uint256 _value + ) public returns (bool success, bytes memory returnData) { + (success, returnData) = _target.call{value: _value}(_calldata); + } + + receive() external payable {} +} \ No newline at end of file