Address Contract Partially Verified
Address
0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C
Balance
0 ETH
Nonce
1
Code Size
1631 bytes
Creator
0x4E64C2d0...9b93 at tx 0x84822c8d...d18045
Indexed Transactions
0
Contract Bytecode
1631 bytes
0x60806040526004361061001e5760003560e01c8063c219a14d1461008c575b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f6e6f742070617961626c652066616c6c6261636b00000000000000000000000081525060200191505060405180910390fd5b34801561009857600080fd5b50610184600480360360c08110156100af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561011657600080fd5b82018360208201111561012857600080fd5b8035906020019184600183028401116401000000008311171561014a57600080fd5b909192939192939080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610186565b005b6101918787876103c6565b610203576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f7061796d656e74207472616e7366657246726f6d2829206661696c656400000081525060200191505060405180910390fd5b6000821180156102405750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b156102c3576102508782846103c6565b6102c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f666565207472616e7366657246726f6d2829206661696c65640000000000000081525060200191505060405180910390fd5b5b838360405180838380828437808301925050509250505060405180910390207f9f16cbcc523c67a60c450e5ffe4f3b7b6dbe772e7abcadb2686ce029a9a0a2b68888888686604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390a250505050505050565b6000833b6103d357600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff16338585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b6020831061051557805182526020820191506020810190506020830392506104f2565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610577576040519150601f19603f3d011682016040523d82523d6000602084013e61057c565b606091505b505090503d60008114610596576020811461059f57600080fd5b600192506105ab565b60206000803e60005192505b508061061f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f7472616e7366657246726f6d282920686173206265656e20726576657274656481525060200191505060405180910390fd5b81915050939250505056fea265627a7a72315820c6f132923802b0fe75b088b51751fdfa1deca9f04c82c451d7dddabd8742604764736f6c63430005110032
Verified Source Code Partial Match
Compiler: v0.5.17+commit.d19bba13
EVM: istanbul
Optimization: No
ERC20FeeProxy.sol 95 lines
pragma solidity ^0.5.0;
/**
* @title ERC20FeeProxy
* @notice This contract performs an ERC20 token transfer, with a Fee sent to a third address and stores a reference
*/
contract ERC20FeeProxy {
// Event to declare a transfer with a reference
event TransferWithReferenceAndFee(
address tokenAddress,
address to,
uint256 amount,
bytes indexed paymentReference,
uint256 feeAmount,
address feeAddress
);
// Fallback function returns funds to the sender
function() external payable {
revert("not payable fallback");
}
/**
* @notice Performs a ERC20 token transfer with a reference and a transfer to a second address for the payment of a fee
* @param _tokenAddress Address of the ERC20 token smart contract
* @param _to Transfer recipient
* @param _amount Amount to transfer
* @param _paymentReference Reference of the payment related
* @param _feeAmount The amount of the payment fee
* @param _feeAddress The fee recipient
*/
function transferFromWithReferenceAndFee(
address _tokenAddress,
address _to,
uint256 _amount,
bytes calldata _paymentReference,
uint256 _feeAmount,
address _feeAddress
) external
{
require(safeTransferFrom(_tokenAddress, _to, _amount), "payment transferFrom() failed");
if (_feeAmount > 0 && _feeAddress != address(0)) {
require(safeTransferFrom(_tokenAddress, _feeAddress, _feeAmount), "fee transferFrom() failed");
}
emit TransferWithReferenceAndFee(
_tokenAddress,
_to,
_amount,
_paymentReference,
_feeAmount,
_feeAddress
);
}
/**
* @notice Call transferFrom ERC20 function and validates the return data of a ERC20 contract call.
* @dev This is necessary because of non-standard ERC20 tokens that don't have a return value.
* @return The return value of the ERC20 call, returning true for non-standard tokens
*/
function safeTransferFrom(address _tokenAddress, address _to, uint256 _amount) internal returns (bool result) {
/* solium-disable security/no-inline-assembly */
// check if the address is a contract
assembly {
if iszero(extcodesize(_tokenAddress)) { revert(0, 0) }
}
// solium-disable-next-line security/no-low-level-calls
(bool success, ) = _tokenAddress.call(abi.encodeWithSignature(
"transferFrom(address,address,uint256)",
msg.sender,
_to,
_amount
));
assembly {
switch returndatasize()
case 0 { // not a standard erc20
result := 1
}
case 32 { // standard erc20
returndatacopy(0, 0, 32)
result := mload(0)
}
default { // anything else, should revert for safety
revert(0, 0)
}
}
require(success, "transferFrom() has been reverted");
/* solium-enable security/no-inline-assembly */
return result;
}
}
Write Contract 1 functions
These functions modify contract state and require a wallet transaction to execute.
transferFromWithReferenceAndFee 0xc219a14d
address _tokenAddress
address _to
uint256 _amount
bytes _paymentReference
uint256 _feeAmount
address _feeAddress
Recent Transactions
No transactions found for this address