-
Notifications
You must be signed in to change notification settings - Fork 69
/
Forwarder.sol
25 lines (21 loc) · 899 Bytes
/
Forwarder.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// "SPDX-License-Identifier: Unlicence"
pragma solidity 0.7.1;
/// @title Arbitrary Data Forwarder
/// @author @nicholashc
contract Forwarder {
address internal owner;
/// @notice set contract deployer as owner
constructor() {
owner = msg.sender;
}
/// @notice Forward arbitrary data to an arbitrary address
/// @dev Only the contract deployer is allowed to call this function
/// @param add the address to forward to
/// @param data arbitrary data of any length
/// @return success low level call failed or succeeded
/// @return message any data returned by the call (not necessarily anything will be returned even on success)
function forward(address payable add, bytes calldata data) external payable returns(bool success, bytes memory message) {
require(msg.sender == owner);
return add.call{value: msg.value}(data);
}
}