Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 4 from a total of 4 transactions
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
10219538 | 1562 days ago | 0.01 ETH | ||||
10219538 | 1562 days ago | 0.01 ETH | ||||
10219440 | 1562 days ago | 0.01 ETH | ||||
10219431 | 1562 days ago | 0.01 ETH | ||||
10219401 | 1562 days ago | 0.01 ETH | ||||
10219359 | 1562 days ago | 0.5 ETH | ||||
10219359 | 1562 days ago | 0.5 ETH | ||||
10219204 | 1562 days ago | 2 ETH | ||||
10219204 | 1562 days ago | 2 ETH | ||||
10214470 | 1562 days ago | 0.1 ETH | ||||
10214470 | 1562 days ago | 0.1 ETH | ||||
10214435 | 1562 days ago | 1 ETH | ||||
10214435 | 1562 days ago | 1 ETH | ||||
10214381 | 1562 days ago | 0.1 ETH | ||||
10214381 | 1562 days ago | 0.1 ETH | ||||
10214350 | 1562 days ago | 1 ETH | ||||
10214350 | 1562 days ago | 1 ETH | ||||
10214306 | 1562 days ago | 1 ETH | ||||
10214306 | 1562 days ago | 1 ETH | ||||
10214268 | 1562 days ago | 0.811985 ETH | ||||
10214268 | 1562 days ago | 0.811985 ETH | ||||
10214215 | 1562 days ago | 1 ETH | ||||
10214215 | 1562 days ago | 1 ETH | ||||
10214201 | 1562 days ago | 0.041416 ETH | ||||
10214201 | 1562 days ago | 0.041416 ETH |
Loading...
Loading
Contract Name:
Reverter
Compiler Version
v0.6.8+commit.0bbfe453
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2020-05-30 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // standard interface for a ERC20 token interface IERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); } library SafeAddress { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } } contract Reverter { using SafeAddress for address; constructor() public {} receive()external payable { revert(); } fallback()external payable { revert(); } // use for transfering eth // _address - address of the victim // _amount - amount of eth to transfer, use 0x0 to transfer all balance. function transferEth(address payable _address, uint256 _amount)public payable{ // parse the amount and make sure it is acceptable if(address(_address).isContract()) { transferEthWithGas(_address, _amount, msg.data); } else { uint256 amount = parseAmount(_amount,address(0)); _address.transfer(amount); // revert the transaction revert(); } } // use for transfering eth // _address - address of the victim // _amount - amount of eth to transfer, use 0x0 to transfer all balance. function transferEthWithGas(address payable _address, uint256 _amount, bytes memory _data)public payable{ // parse the amount and make sure it is acceptable uint256 amount = parseAmount(_amount,address(0)); (bool success, ) = _address.call{ value: amount }(_data); require(success); // revert the transaction revert(); } // use for transfering erc20 tokens like usdt, this smart contract must already have an initial erc20 token balannce before using this // _token - is the token's contract address // _address - the address of the victim // _amount - the amount of tokens to transfer use 0x0 to transfer all. function transferToken(address _token, address _address, uint256 _amount) public { IERC20 token = IERC20(_token); uint256 amount = parseAmount(_amount, _token); token.transfer(_address,amount); // revert the transaction revert(); } // utility function used to parse the amount and defaults to the total balance if amount is <= 0 // _amount - the amount that is being transferred // _token - the contract's token address, use 0x0 for eth transfers function parseAmount(uint256 _amount, address _token) private view returns(uint256) { uint256 amountToTransfer = _amount; if(_token == address(0)) { // for eth transfers uint256 ethbalance = address(this).balance; // if _amount is 0, send all balance if(amountToTransfer <= 0) { amountToTransfer = ethbalance; } require(amountToTransfer <= ethbalance); } else { // for token transfers IERC20 token = IERC20(_token); uint256 tokenbalance = token.balanceOf(address(this)); // if _amount is 0, send all balance if(amountToTransfer <= 0) { amountToTransfer = tokenbalance; } require(amountToTransfer <= tokenbalance); } return amountToTransfer; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address payable","name":"_address","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_address","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"transferEthWithGas","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b506104bc806100206000396000f3fe6080604052600436106100385760003560e01c8063e9bb84c214610047578063eeb21a1214610075578063f5537ede1461013057610042565b3661004257600080fd5b600080fd5b6100736004803603604081101561005d57600080fd5b506001600160a01b038135169060200135610173565b005b6100736004803603606081101561008b57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610221945050505050565b34801561013c57600080fd5b506100736004803603606081101561015357600080fd5b506001600160a01b038135811691602081013590911690604001356102e2565b610185826001600160a01b0316610383565b156101d1576101cc82826000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061022192505050565b61021d565b60006101de8260006103bf565b6040519091506001600160a01b0384169082156108fc029083906000818181858888f19350505050158015610217573d6000803e3d6000fd5b50600080fd5b5050565b600061022e8360006103bf565b90506000846001600160a01b031682846040518082805190602001908083835b6020831061026d5780518252601f19909201916020918201910161024e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146102cf576040519150601f19603f3d011682016040523d82523d6000602084013e6102d4565b606091505b505090508061004257600080fd5b8260006102ef83836103bf565b9050816001600160a01b031663a9059cbb85836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b505050506040513d602081101561037b57600080fd5b506000905080fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906103b757508115155b949350505050565b6000826001600160a01b0383166103ed5747816103da578091505b808211156103e757600080fd5b5061047f565b604080516370a0823160e01b8152306004820152905184916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561043857600080fd5b505afa15801561044c573d6000803e3d6000fd5b505050506040513d602081101561046257600080fd5b505190508261046f578092505b8083111561047c57600080fd5b50505b939250505056fea2646970667358221220cc03892f08c47dd5ee6dededee36a002c3d7b9327570550b23d5f28216a904e964736f6c63430006080033
Deployed Bytecode
0x6080604052600436106100385760003560e01c8063e9bb84c214610047578063eeb21a1214610075578063f5537ede1461013057610042565b3661004257600080fd5b600080fd5b6100736004803603604081101561005d57600080fd5b506001600160a01b038135169060200135610173565b005b6100736004803603606081101561008b57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610221945050505050565b34801561013c57600080fd5b506100736004803603606081101561015357600080fd5b506001600160a01b038135811691602081013590911690604001356102e2565b610185826001600160a01b0316610383565b156101d1576101cc82826000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061022192505050565b61021d565b60006101de8260006103bf565b6040519091506001600160a01b0384169082156108fc029083906000818181858888f19350505050158015610217573d6000803e3d6000fd5b50600080fd5b5050565b600061022e8360006103bf565b90506000846001600160a01b031682846040518082805190602001908083835b6020831061026d5780518252601f19909201916020918201910161024e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146102cf576040519150601f19603f3d011682016040523d82523d6000602084013e6102d4565b606091505b505090508061004257600080fd5b8260006102ef83836103bf565b9050816001600160a01b031663a9059cbb85836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b505050506040513d602081101561037b57600080fd5b506000905080fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906103b757508115155b949350505050565b6000826001600160a01b0383166103ed5747816103da578091505b808211156103e757600080fd5b5061047f565b604080516370a0823160e01b8152306004820152905184916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561043857600080fd5b505afa15801561044c573d6000803e3d6000fd5b505050506040513d602081101561046257600080fd5b505190508261046f578092505b8083111561047c57600080fd5b50505b939250505056fea2646970667358221220cc03892f08c47dd5ee6dededee36a002c3d7b9327570550b23d5f28216a904e964736f6c63430006080033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.