pragma solidity ^0.5.0;
/**
* @title EthereumProxy
* @notice This contract performs an ethereum transfer and stores a reference
*/
contract EthereumProxy {
// Event to declare a transfer with a reference
event TransferWithReference(address to, uint256 amount, bytes indexed paymentReference);
// Fallback function returns funds to the sender
function() external payable {
revert("not payable fallback");
}
/**
* @notice Performs an ethereum transfer with a reference
* @param _to Transfer recipient
* @param _paymentReference Reference of the payment related
*/
function transferWithReference(address payable _to, bytes calldata _paymentReference)
external
payable
{
_to.transfer(msg.value);
emit TransferWithReference(_to, msg.value, _paymentReference);
}
}
{
"compilationTarget": {
"EthereumProxy.sol": "EthereumProxy"
},
"evmVersion": "istanbul",
"libraries": {},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"bytes","name":"paymentReference","type":"bytes"}],"name":"TransferWithReference","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":false,"inputs":[{"internalType":"address payable","name":"_to","type":"address"},{"internalType":"bytes","name":"_paymentReference","type":"bytes"}],"name":"transferWithReference","outputs":[],"payable":true,"stateMutability":"payable","type":"function"}]