S Price: $0.554016 (+3.78%)

Contract

0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
39741382025-01-15 9:25:0030 days ago1736933100  Contract Creation0 S
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC20FeeProxy

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : ERC20FeeProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.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
  receive() external payable {
    revert('not payable receive');
  }

  /**
    * @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 result 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;
  }
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"bytes","name":"paymentReference","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"feeAddress","type":"address"}],"name":"TransferWithReferenceAndFee","type":"event"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_paymentReference","type":"bytes"},{"internalType":"uint256","name":"_feeAmount","type":"uint256"},{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"transferFromWithReferenceAndFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50610875806100206000396000f3fe6080604052600436106100225760003560e01c8063c219a14d1461006757610062565b36610062576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610059906103a3565b60405180910390fd5b600080fd5b34801561007357600080fd5b5061008e600480360381019061008991906104c6565b610090565b005b61009b8787876101c7565b6100da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100d1906105c1565b60405180910390fd5b6000821180156101175750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b15610167576101278782846101c7565b610166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015d9061062d565b60405180910390fd5b5b838360405161017792919061068c565b60405180910390207f9f16cbcc523c67a60c450e5ffe4f3b7b6dbe772e7abcadb2686ce029a9a0a2b688888886866040516101b69594939291906106c3565b60405180910390a250505050505050565b6000833b6101d457600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff1633858560405160240161020293929190610716565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161028c91906107bc565b6000604051808303816000865af19150503d80600081146102c9576040519150601f19603f3d011682016040523d82523d6000602084013e6102ce565b606091505b505090503d600081146102e857602081146102f157600080fd5b600192506102fd565b60206000803e60005192505b508061033e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103359061081f565b60405180910390fd5b509392505050565b600082825260208201905092915050565b7f6e6f742070617961626c65207265636569766500000000000000000000000000600082015250565b600061038d601383610346565b915061039882610357565b602082019050919050565b600060208201905081810360008301526103bc81610380565b9050919050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f8826103cd565b9050919050565b610408816103ed565b811461041357600080fd5b50565b600081359050610425816103ff565b92915050565b6000819050919050565b61043e8161042b565b811461044957600080fd5b50565b60008135905061045b81610435565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261048657610485610461565b5b8235905067ffffffffffffffff8111156104a3576104a2610466565b5b6020830191508360018202830111156104bf576104be61046b565b5b9250929050565b600080600080600080600060c0888a0312156104e5576104e46103c3565b5b60006104f38a828b01610416565b97505060206105048a828b01610416565b96505060406105158a828b0161044c565b955050606088013567ffffffffffffffff811115610536576105356103c8565b5b6105428a828b01610470565b945094505060806105558a828b0161044c565b92505060a06105668a828b01610416565b91505092959891949750929550565b7f7061796d656e74207472616e7366657246726f6d2829206661696c6564000000600082015250565b60006105ab601d83610346565b91506105b682610575565b602082019050919050565b600060208201905081810360008301526105da8161059e565b9050919050565b7f666565207472616e7366657246726f6d2829206661696c656400000000000000600082015250565b6000610617601983610346565b9150610622826105e1565b602082019050919050565b600060208201905081810360008301526106468161060a565b9050919050565b600081905092915050565b82818337600083830152505050565b6000610673838561064d565b9350610680838584610658565b82840190509392505050565b6000610699828486610667565b91508190509392505050565b6106ae816103ed565b82525050565b6106bd8161042b565b82525050565b600060a0820190506106d860008301886106a5565b6106e560208301876106a5565b6106f260408301866106b4565b6106ff60608301856106b4565b61070c60808301846106a5565b9695505050505050565b600060608201905061072b60008301866106a5565b61073860208301856106a5565b61074560408301846106b4565b949350505050565b600081519050919050565b60005b8381101561077657808201518184015260208101905061075b565b83811115610785576000848401525b50505050565b60006107968261074d565b6107a0818561064d565b93506107b0818560208601610758565b80840191505092915050565b60006107c8828461078b565b915081905092915050565b7f7472616e7366657246726f6d282920686173206265656e207265766572746564600082015250565b6000610809602083610346565b9150610814826107d3565b602082019050919050565b60006020820190508181036000830152610838816107fc565b905091905056fea2646970667358221220b9b836a03da1aa90d1c7846f44a91220029e4ac0ef63cf70084474dd70ea1a2364736f6c63430008090033

Deployed Bytecode

0x6080604052600436106100225760003560e01c8063c219a14d1461006757610062565b36610062576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610059906103a3565b60405180910390fd5b600080fd5b34801561007357600080fd5b5061008e600480360381019061008991906104c6565b610090565b005b61009b8787876101c7565b6100da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100d1906105c1565b60405180910390fd5b6000821180156101175750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b15610167576101278782846101c7565b610166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015d9061062d565b60405180910390fd5b5b838360405161017792919061068c565b60405180910390207f9f16cbcc523c67a60c450e5ffe4f3b7b6dbe772e7abcadb2686ce029a9a0a2b688888886866040516101b69594939291906106c3565b60405180910390a250505050505050565b6000833b6101d457600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff1633858560405160240161020293929190610716565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161028c91906107bc565b6000604051808303816000865af19150503d80600081146102c9576040519150601f19603f3d011682016040523d82523d6000602084013e6102ce565b606091505b505090503d600081146102e857602081146102f157600080fd5b600192506102fd565b60206000803e60005192505b508061033e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103359061081f565b60405180910390fd5b509392505050565b600082825260208201905092915050565b7f6e6f742070617961626c65207265636569766500000000000000000000000000600082015250565b600061038d601383610346565b915061039882610357565b602082019050919050565b600060208201905081810360008301526103bc81610380565b9050919050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f8826103cd565b9050919050565b610408816103ed565b811461041357600080fd5b50565b600081359050610425816103ff565b92915050565b6000819050919050565b61043e8161042b565b811461044957600080fd5b50565b60008135905061045b81610435565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261048657610485610461565b5b8235905067ffffffffffffffff8111156104a3576104a2610466565b5b6020830191508360018202830111156104bf576104be61046b565b5b9250929050565b600080600080600080600060c0888a0312156104e5576104e46103c3565b5b60006104f38a828b01610416565b97505060206105048a828b01610416565b96505060406105158a828b0161044c565b955050606088013567ffffffffffffffff811115610536576105356103c8565b5b6105428a828b01610470565b945094505060806105558a828b0161044c565b92505060a06105668a828b01610416565b91505092959891949750929550565b7f7061796d656e74207472616e7366657246726f6d2829206661696c6564000000600082015250565b60006105ab601d83610346565b91506105b682610575565b602082019050919050565b600060208201905081810360008301526105da8161059e565b9050919050565b7f666565207472616e7366657246726f6d2829206661696c656400000000000000600082015250565b6000610617601983610346565b9150610622826105e1565b602082019050919050565b600060208201905081810360008301526106468161060a565b9050919050565b600081905092915050565b82818337600083830152505050565b6000610673838561064d565b9350610680838584610658565b82840190509392505050565b6000610699828486610667565b91508190509392505050565b6106ae816103ed565b82525050565b6106bd8161042b565b82525050565b600060a0820190506106d860008301886106a5565b6106e560208301876106a5565b6106f260408301866106b4565b6106ff60608301856106b4565b61070c60808301846106a5565b9695505050505050565b600060608201905061072b60008301866106a5565b61073860208301856106a5565b61074560408301846106b4565b949350505050565b600081519050919050565b60005b8381101561077657808201518184015260208101905061075b565b83811115610785576000848401525b50505050565b60006107968261074d565b6107a0818561064d565b93506107b0818560208601610758565b80840191505092915050565b60006107c8828461078b565b915081905092915050565b7f7472616e7366657246726f6d282920686173206265656e207265766572746564600082015250565b6000610809602083610346565b9150610814826107d3565b602082019050919050565b60006020820190508181036000830152610838816107fc565b905091905056fea2646970667358221220b9b836a03da1aa90d1c7846f44a91220029e4ac0ef63cf70084474dd70ea1a2364736f6c63430008090033

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.