S Price: $0.536945 (-2.23%)

Contract

0x4989F941D62bEEb3548Bf55d0D5291Ec335429f0

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

5 Internal Transactions found.

Latest 5 internal transactions

Parent Transaction Hash Block From To
56827692025-01-28 14:14:0117 days ago1738073641
0x4989F941...c335429f0
0.2188 S
56827692025-01-28 14:14:0117 days ago1738073641
0x4989F941...c335429f0
0.2188 S
56827692025-01-28 14:14:0117 days ago1738073641
0x4989F941...c335429f0
0.2188 S
56827692025-01-28 14:14:0117 days ago1738073641
0x4989F941...c335429f0
0.2188 S
39740982025-01-15 9:24:4131 days ago1736933081  Contract Creation0 S
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EthereumFeeProxy

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 2 : EthereumFeeProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/security/ReentrancyGuard.sol';

/**
 * @title EthereumFeeProxy
 * @notice This contract performs an Ethereum transfer with a Fee sent to a third address and stores a reference
 */
contract EthereumFeeProxy is ReentrancyGuard {
  // Event to declare a transfer with a reference
  event TransferWithReferenceAndFee(
    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 an Ethereum transfer with a reference
   * @param _to Transfer recipient
   * @param _paymentReference Reference of the payment related
   * @param _feeAmount The amount of the payment fee (part of the msg.value)
   * @param _feeAddress The fee recipient
   */
  function transferWithReferenceAndFee(
    address payable _to,
    bytes calldata _paymentReference,
    uint256 _feeAmount,
    address payable _feeAddress
  ) external payable {
    transferExactEthWithReferenceAndFee(
      _to,
      msg.value - _feeAmount,
      _paymentReference,
      _feeAmount,
      _feeAddress
    );
  }

  /**
   * @notice Performs an Ethereum transfer with a reference with an exact amount of eth
   * @param _to Transfer recipient
   * @param _amount Amount to transfer
   * @param _paymentReference Reference of the payment related
   * @param _feeAmount The amount of the payment fee (part of the msg.value)
   * @param _feeAddress The fee recipient
   */
  function transferExactEthWithReferenceAndFee(
    address payable _to,
    uint256 _amount,
    bytes calldata _paymentReference,
    uint256 _feeAmount,
    address payable _feeAddress
  ) public payable nonReentrant {
    (bool sendSuccess, ) = _to.call{value: _amount}('');
    require(sendSuccess, 'Could not pay the recipient');

    _feeAddress.transfer(_feeAmount);

    // transfer the remaining ethers to the sender
    (bool sendBackSuccess, ) = payable(msg.sender).call{value: msg.value - _amount - _feeAmount}(
      ''
    );
    require(sendBackSuccess, 'Could not send remaining funds to the payer');

    emit TransferWithReferenceAndFee(_to, _amount, _paymentReference, _feeAmount, _feeAddress);
  }
}

File 2 of 2 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

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":"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 payable","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_paymentReference","type":"bytes"},{"internalType":"uint256","name":"_feeAmount","type":"uint256"},{"internalType":"address payable","name":"_feeAddress","type":"address"}],"name":"transferExactEthWithReferenceAndFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"},{"internalType":"bytes","name":"_paymentReference","type":"bytes"},{"internalType":"uint256","name":"_feeAmount","type":"uint256"},{"internalType":"address payable","name":"_feeAddress","type":"address"}],"name":"transferWithReferenceAndFee","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b506001600081905550610933806100286000396000f3fe60806040526004361061002d5760003560e01c8063b868980b14610072578063d7c95e981461008e5761006d565b3661006d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610064906103a5565b60405180910390fd5b600080fd5b61008c600480360381019061008791906104c8565b6100aa565b005b6100a860048036038101906100a39190610550565b6100ca565b005b6100c38583346100ba9190610619565b868686866100ca565b5050505050565b6100d26102ee565b60008673ffffffffffffffffffffffffffffffffffffffff16866040516100f89061067e565b60006040518083038185875af1925050503d8060008114610135576040519150601f19603f3d011682016040523d82523d6000602084013e61013a565b606091505b505090508061017e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610175906106df565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156101c4573d6000803e3d6000fd5b5060003373ffffffffffffffffffffffffffffffffffffffff168488346101eb9190610619565b6101f59190610619565b6040516102019061067e565b60006040518083038185875af1925050503d806000811461023e576040519150601f19603f3d011682016040523d82523d6000602084013e610243565b606091505b5050905080610287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027e90610771565b60405180910390fd5b85856040516102979291906107c5565b60405180910390207fa1c241e337c4610a9d0f881111e977e9dc8690c85fe2108897bb1483c66e6a96898987876040516102d4949392919061084c565b60405180910390a250506102e661033e565b505050505050565b60026000541415610334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032b906108dd565b60405180910390fd5b6002600081905550565b6001600081905550565b600082825260208201905092915050565b7f6e6f742070617961626c65207265636569766500000000000000000000000000600082015250565b600061038f601383610348565b915061039a82610359565b602082019050919050565b600060208201905081810360008301526103be81610382565b9050919050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103fa826103cf565b9050919050565b61040a816103ef565b811461041557600080fd5b50565b60008135905061042781610401565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126104525761045161042d565b5b8235905067ffffffffffffffff81111561046f5761046e610432565b5b60208301915083600182028301111561048b5761048a610437565b5b9250929050565b6000819050919050565b6104a581610492565b81146104b057600080fd5b50565b6000813590506104c28161049c565b92915050565b6000806000806000608086880312156104e4576104e36103c5565b5b60006104f288828901610418565b955050602086013567ffffffffffffffff811115610513576105126103ca565b5b61051f8882890161043c565b94509450506040610532888289016104b3565b925050606061054388828901610418565b9150509295509295909350565b60008060008060008060a0878903121561056d5761056c6103c5565b5b600061057b89828a01610418565b965050602061058c89828a016104b3565b955050604087013567ffffffffffffffff8111156105ad576105ac6103ca565b5b6105b989828a0161043c565b945094505060606105cc89828a016104b3565b92505060806105dd89828a01610418565b9150509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061062482610492565b915061062f83610492565b925082821015610642576106416105ea565b5b828203905092915050565b600081905092915050565b50565b600061066860008361064d565b915061067382610658565b600082019050919050565b60006106898261065b565b9150819050919050565b7f436f756c64206e6f74207061792074686520726563697069656e740000000000600082015250565b60006106c9601b83610348565b91506106d482610693565b602082019050919050565b600060208201905081810360008301526106f8816106bc565b9050919050565b7f436f756c64206e6f742073656e642072656d61696e696e672066756e6473207460008201527f6f20746865207061796572000000000000000000000000000000000000000000602082015250565b600061075b602b83610348565b9150610766826106ff565b604082019050919050565b6000602082019050818103600083015261078a8161074e565b9050919050565b82818337600083830152505050565b60006107ac838561064d565b93506107b9838584610791565b82840190509392505050565b60006107d28284866107a0565b91508190509392505050565b6000819050919050565b60006108036107fe6107f9846103cf565b6107de565b6103cf565b9050919050565b6000610815826107e8565b9050919050565b60006108278261080a565b9050919050565b6108378161081c565b82525050565b61084681610492565b82525050565b6000608082019050610861600083018761082e565b61086e602083018661083d565b61087b604083018561083d565b610888606083018461082e565b95945050505050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006108c7601f83610348565b91506108d282610891565b602082019050919050565b600060208201905081810360008301526108f6816108ba565b905091905056fea26469706673582212202c2ce259d025d4574b4c9387ab104c04464ec63b42081fc6ebb7062dd97cfc3264736f6c63430008090033

Deployed Bytecode

0x60806040526004361061002d5760003560e01c8063b868980b14610072578063d7c95e981461008e5761006d565b3661006d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610064906103a5565b60405180910390fd5b600080fd5b61008c600480360381019061008791906104c8565b6100aa565b005b6100a860048036038101906100a39190610550565b6100ca565b005b6100c38583346100ba9190610619565b868686866100ca565b5050505050565b6100d26102ee565b60008673ffffffffffffffffffffffffffffffffffffffff16866040516100f89061067e565b60006040518083038185875af1925050503d8060008114610135576040519150601f19603f3d011682016040523d82523d6000602084013e61013a565b606091505b505090508061017e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610175906106df565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156101c4573d6000803e3d6000fd5b5060003373ffffffffffffffffffffffffffffffffffffffff168488346101eb9190610619565b6101f59190610619565b6040516102019061067e565b60006040518083038185875af1925050503d806000811461023e576040519150601f19603f3d011682016040523d82523d6000602084013e610243565b606091505b5050905080610287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027e90610771565b60405180910390fd5b85856040516102979291906107c5565b60405180910390207fa1c241e337c4610a9d0f881111e977e9dc8690c85fe2108897bb1483c66e6a96898987876040516102d4949392919061084c565b60405180910390a250506102e661033e565b505050505050565b60026000541415610334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032b906108dd565b60405180910390fd5b6002600081905550565b6001600081905550565b600082825260208201905092915050565b7f6e6f742070617961626c65207265636569766500000000000000000000000000600082015250565b600061038f601383610348565b915061039a82610359565b602082019050919050565b600060208201905081810360008301526103be81610382565b9050919050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103fa826103cf565b9050919050565b61040a816103ef565b811461041557600080fd5b50565b60008135905061042781610401565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126104525761045161042d565b5b8235905067ffffffffffffffff81111561046f5761046e610432565b5b60208301915083600182028301111561048b5761048a610437565b5b9250929050565b6000819050919050565b6104a581610492565b81146104b057600080fd5b50565b6000813590506104c28161049c565b92915050565b6000806000806000608086880312156104e4576104e36103c5565b5b60006104f288828901610418565b955050602086013567ffffffffffffffff811115610513576105126103ca565b5b61051f8882890161043c565b94509450506040610532888289016104b3565b925050606061054388828901610418565b9150509295509295909350565b60008060008060008060a0878903121561056d5761056c6103c5565b5b600061057b89828a01610418565b965050602061058c89828a016104b3565b955050604087013567ffffffffffffffff8111156105ad576105ac6103ca565b5b6105b989828a0161043c565b945094505060606105cc89828a016104b3565b92505060806105dd89828a01610418565b9150509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061062482610492565b915061062f83610492565b925082821015610642576106416105ea565b5b828203905092915050565b600081905092915050565b50565b600061066860008361064d565b915061067382610658565b600082019050919050565b60006106898261065b565b9150819050919050565b7f436f756c64206e6f74207061792074686520726563697069656e740000000000600082015250565b60006106c9601b83610348565b91506106d482610693565b602082019050919050565b600060208201905081810360008301526106f8816106bc565b9050919050565b7f436f756c64206e6f742073656e642072656d61696e696e672066756e6473207460008201527f6f20746865207061796572000000000000000000000000000000000000000000602082015250565b600061075b602b83610348565b9150610766826106ff565b604082019050919050565b6000602082019050818103600083015261078a8161074e565b9050919050565b82818337600083830152505050565b60006107ac838561064d565b93506107b9838584610791565b82840190509392505050565b60006107d28284866107a0565b91508190509392505050565b6000819050919050565b60006108036107fe6107f9846103cf565b6107de565b6103cf565b9050919050565b6000610815826107e8565b9050919050565b60006108278261080a565b9050919050565b6108378161081c565b82525050565b61084681610492565b82525050565b6000608082019050610861600083018761082e565b61086e602083018661083d565b61087b604083018561083d565b610888606083018461082e565b95945050505050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006108c7601f83610348565b91506108d282610891565b602082019050919050565b600060208201905081810360008301526108f6816108ba565b905091905056fea26469706673582212202c2ce259d025d4574b4c9387ab104c04464ec63b42081fc6ebb7062dd97cfc3264736f6c63430008090033

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.