Unoptimized collector that pushes ether and ERC-20 balances to a fixed wallet.
Historical Significance
A clear example of why 'anyone can call it' is not automatically a vulnerability: the only reachable effect is moving funds to an address baked in at deployment. It also shows how much larger unoptimized 0.4.x output is. The optimizer would have cut this contract down substantially.
Key Facts
Description
A small collector with one stored address, exposed as the public getter wallet(). Its payable fallback accepts ether. collect(uint256) sends a caller-chosen amount of the contract's ether to the stored wallet using send() and reverts if that fails, while doTransfer(address,uint256) calls transfer on a caller-supplied ERC-20 contract to move tokens to the same wallet. Neither function has an access check, so anyone may trigger a payout. That is harmless only because the destination is fixed at deployment and cannot be changed. Compiled with the optimizer disabled, which is visible in the bytecode as full-width address masks rather than the compact form the optimizer emits. The runtime code matches the deployed bytecode byte for byte; only the trailing swarm metadata hash differs, because the EthereumHistory attribution comment changes the source text. Sourcify records this as a partial match and Etherscan shows it as verified.
Source Verified
Byzantium Era
First Metropolis hard fork. Added zk-SNARK precompiles, REVERT opcode, and staticcall.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
pragma solidity ^0.4.18;
contract ERC20 {
function transfer(address to, uint256 value) public returns (bool);
}
contract Collector {
address public wallet;
function () public payable { }
function doTransfer(address token, uint256 amount) public {
ERC20(token).transfer(wallet, amount);
}
function collect(uint256 amount) public {
require(wallet.send(amount));
}
}