Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 17 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
5701021 | 10 days ago | 0 ETH | ||||
5701021 | 10 days ago | 0.00002 ETH | ||||
5701021 | 10 days ago | 0 ETH | ||||
5701021 | 10 days ago | 0 ETH | ||||
5701021 | 10 days ago | 0 ETH | ||||
5701021 | 10 days ago | 0 ETH | ||||
5700894 | 10 days ago | 0 ETH | ||||
5700894 | 10 days ago | 0.00099 ETH | ||||
5700894 | 10 days ago | 0 ETH | ||||
5700894 | 10 days ago | 0 ETH | ||||
5700894 | 10 days ago | 0.001 ETH | ||||
5700816 | 10 days ago | 0 ETH | ||||
5700816 | 10 days ago | 0.00099 ETH | ||||
5700816 | 10 days ago | 0 ETH | ||||
5700816 | 10 days ago | 0 ETH | ||||
5700816 | 10 days ago | 0.001 ETH | ||||
5700167 | 10 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
CustomFeeTransaction
Compiler Version
v0.8.24+commit.e11b9ed9
ZkSolc Version
v1.5.7
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; contract CustomFeeTransaction { address public owner; mapping(address => uint256) public collectedFees; event TransactionSent(address indexed from, address indexed to, uint256 amount, uint256 fee); event FeeWithdrawn(address indexed recipient, uint256 amount); constructor() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner, "Not the contract owner"); _; } // Function to send a transaction with a custom fee function sendTransactionWithFee(address payable _to) external payable { require(msg.value > 0, "Amount must be greater than 0"); // Calculate fee (e.g., 1% of transaction value) uint256 fee = (msg.value * 1) / 100; uint256 transferAmount = msg.value - fee; // Store collected fee collectedFees[msg.sender] += fee; // Transfer the remaining amount to recipient (bool success, ) = _to.call{value: transferAmount}(""); require(success, "Transfer failed"); emit TransactionSent(msg.sender, _to, transferAmount, fee); } // Function to withdraw collected fees function withdrawFees() external { uint256 amount = collectedFees[msg.sender]; require(amount > 0, "No fees to withdraw"); collectedFees[msg.sender] = 0; (bool success, ) = payable(msg.sender).call{value: amount}(""); require(success, "Withdrawal failed"); emit FeeWithdrawn(msg.sender, amount); } // Function to get collected fees for an address function getCollectedFees(address _address) external view returns (uint256) { return collectedFees[_address]; } }
{ "evmVersion": "paris", "optimizer": { "enabled": true, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi", "metadata" ], "": [ "ast" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": false, "libraries": {} }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"TransactionSent","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"collectedFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getCollectedFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"sendTransactionWithFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
9c4d535b000000000000000000000000000000000000000000000000000000000000000001000081f66441f50eb8a6577d00c1fa2dae3ad2fbefa9c3ae9da5b40c3a4be100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x000200000000000200030000000000020000006003100270000000630330019700010000003103550000008004000039000000400040043f0000000100200190000000160000c13d000000040030008c0000006d0000413d000000000201043b000000e002200270000000660020009c000000230000a13d000000670020009c000000390000613d000000680020009c0000005f0000613d000000690020009c000000270000613d0000006d0000013d0000000001000416000000000001004b0000006d0000c13d000000000100041a00000064011001970000000002000411000000000121019f000000000010041b0000002001000039000001000010044300000120000004430000006501000041000001890001042e0000006a0020009c000000670000613d0000006b0020009c0000006d0000c13d000000240030008c0000006d0000413d0000000002000416000000000002004b0000006d0000c13d0000000401100370000000000101043b0000006c0010009c0000006d0000213d000000000010043f0000000101000039000000200010043f00000000010000190188016d0000040f000000000101041a000000800010043f0000006d01000041000001890001042e0000000001000416000000000001004b0000006d0000c13d0000000001000411000000000010043f0000000101000039000300000001001d000000200010043f0000000001000414000000630010009c0000006301008041000000c0011002100000006e011001c70000801002000039018801830000040f00000001002001900000006d0000613d000000000101043b000000000101041a000000000001004b0000007c0000c13d000000400100043d00000044021000390000007603000041000000000032043500000024021000390000001303000039000000000032043500000074020000410000000000210435000000040210003900000020030000390000000000320435000000630010009c0000006301008041000000400110021000000075011001c70000018a000104300000000001000416000000000001004b0000006d0000c13d000000000100041a0000006c01100197000000800010043f0000006d01000041000001890001042e000000240030008c0000006d0000413d0000000401100370000000000301043b0000006c0030009c0000006f0000a13d00000000010000190000018a000104300000000001000416000000000001004b000000920000c13d0000007401000041000000800010043f0000002001000039000000840010043f0000001d01000039000000a40010043f0000007c01000041000000c40010043f0000007d010000410000018a00010430000200000001001d0000000001000411000000000010043f0000000101000039000000200010043f0000000001000414000000630010009c0000006301008041000000c0011002100000006e011001c70000801002000039018801830000040f00000001002001900000006d0000613d000000000101043b000000000001041b00000000010004140000000008000411000000040080008c000000b10000c13d0000000001000031000000c00000013d0000000001000411000000000010043f0000000101000039000000200010043f0000000001000414000000630010009c0000006301008041000000c0011002100000006e011001c70000801002000039000300000003001d018801830000040f000000030300002900000001002001900000006d0000613d0000000004000416000000640940011a000000000101043b000000000201041a000000000092001a000001670000413d0000006c0830019700000000039400490000000002920019000000000021041b0000000001000414000000040080008c000000010a000039000000f40000c13d0000000001000031000001070000013d000000630010009c0000006301008041000000c0011002100000006f011001c700008009020000390000000203000029000000000408001900000000050000190188017e0000040f0000000008000411000300010020019300010000000103550000006001100270000000630010019d0000006301100197000000000001004b000000cb0000c13d000000400100043d000000030000006b000001410000c13d00000044021000390000007303000041000000000032043500000024021000390000001103000039000000540000013d000000700010009c0000013b0000213d0000001f031000390000007e033001970000003f033000390000007e04300197000000400300043d0000000004430019000000000034004b00000000050000390000000105004039000000700040009c0000013b0000213d00000001005001900000013b0000c13d000000400040043f00000000051304360000007e021001980000001f0310018f00000000012500190000000104000367000000e60000613d000000000604034f000000006706043c0000000005750436000000000015004b000000e20000c13d000000000003004b000000c20000613d000000000224034f0000000303300210000000000401043300000000043401cf000000000434022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000242019f0000000000210435000000c20000013d000000630010009c0000006301008041000000c0011002100000006f011001c7000080090200003900000000040800190000000005000019000300000008001d000200000009001d000100000003001d0188017e0000040f000000010300002900000002090000290000000308000029000000010a20018f00010000000103550000006001100270000000630010019d0000006301100197000000000001004b000001120000c13d000000400100043d00000000000a004b000001510000c13d00000044021000390000007b03000041000000000032043500000024021000390000000f03000039000000540000013d000000770010009c0000013b0000813d0000001f041000390000007e044001970000003f044000390000007e04400197000000400600043d0000000004460019000000000064004b00000000050000390000000105004039000000700040009c0000013b0000213d00000001005001900000013b0000c13d000000400040043f00000000051604360000007e021001980000001f0b10018f000000000125001900000001040003670000012d0000613d000000000604034f000000006706043c0000000005750436000000000015004b000001290000c13d00000000000b004b000001090000613d000000000224034f0000000305b00210000000000401043300000000045401cf000000000454022f000000000202043b0000010005500089000000000252022f00000000025201cf000000000242019f0000000000210435000001090000013d0000007801000041000000000010043f0000004101000039000000040010043f00000079010000410000018a0001043000000002020000290000000000210435000000630010009c000000630100804100000040011002100000000002000414000000630020009c0000006302008041000000c002200210000000000112019f00000071011001c70000800d02000039000000020300003900000072040000410000000005080019000001620000013d000000200210003900000000009204350000000000310435000000630010009c000000630100804100000040011002100000000002000414000000630020009c0000006302008041000000c002200210000000000112019f0000006e011001c70000800d0200003900000003030000390000007a04000041000000000500041100000000060800190188017e0000040f00000001002001900000006d0000613d0000000001000019000001890001042e0000007801000041000000000010043f0000001101000039000000040010043f00000079010000410000018a000104300000000002000414000000630020009c0000006302008041000000c002200210000000630010009c00000063010080410000004001100210000000000121019f0000006e011001c70000801002000039018801830000040f00000001002001900000017c0000613d000000000101043b000000000001042d00000000010000190000018a0001043000000181002104210000000102000039000000000001042d0000000002000019000000000001042d00000186002104230000000102000039000000000001042d0000000002000019000000000001042d0000018800000432000001890001042e0000018a00010430000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000020000000000000000000000000000004000000100000000000000000000000000000000000000000000000000000000000000000000000000476343ed00000000000000000000000000000000000000000000000000000000476343ee000000000000000000000000000000000000000000000000000000008da5cb5b00000000000000000000000000000000000000000000000000000000a3daed99000000000000000000000000000000000000000000000000000000001330f7a9000000000000000000000000000000000000000000000000000000001cead9a7000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000002000000080000000000000000002000000000000000000000000000000000000400000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff020000000000000000000000000000000000002000000000000000000000000078473f3f373f7673597f4f0fa5873cb4d375fea6d4339ad6b56dbd411513cb3f5769746864726177616c206661696c656400000000000000000000000000000008c379a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000004e6f206665657320746f2077697468647261770000000000000000000000000000000000000000000000000000000000000000000000000100000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000006d3e038844bf8184d1da4779d878e2ac8180f3ac69e7ade46be2c69d7d86f30f5472616e73666572206661696c65640000000000000000000000000000000000416d6f756e74206d7573742062652067726561746572207468616e20300000000000000000000000000000000000000000000064000000800000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00000000000000000000000000000000000000000000000000000000000000000d1629c20d2ea623d4893cac9495f56d17d86facc1fa70f80904eefc06aafb59f
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.