Back to Home

AgentAccount

0x2a7c5ec68188...63cb791e0f4b
ByzantiumSource VerifiedEdit this contract
Deployed July 20, 2018 (8 years ago)Block 5,997,299

A holding account driven entirely by tx.origin: one owner key can move ether, move tokens, or grant an allowance, each with a single call.

Byzantium EraVerified Source

Historical Significance

tx.origin authorisation was already understood to be dangerous when this was deployed; the Solidity documentation had warned against it for years. Seeing it at the centre of a widely replicated agent account is a reminder that the pattern persisted because it solved a real ergonomic problem, letting an operator route calls through whatever helper contract they liked without re-plumbing permissions, and that the phishing risk it carries was treated as acceptable when the account holds working balances rather than reserves.

Key Facts
Deployment Block
5,997,299
Deployment Date
Jul 20, 2018, 09:29 AM
Code Size
879.0 B

Description

Storage holds one address. Every state-changing function checks tx.origin against it and does nothing else by way of access control. transferEth makes a raw call with caller-supplied value and gas limit, so the account can pay a contract that needs more than the transfer stipend. transferToken and approveToken are the ERC-20 counterparts, forwarding to transfer and approve on a token the caller names. blockVersion returns the literal string AgentAccount.1.0, which is how a fleet operator tells deployments apart when none of them are verified.

The fallback is payable and empty, so the account can be funded like a wallet.

Authorising on tx.origin rather than msg.sender is the decision that shapes everything else. It means the owner can reach this account through any intermediary contract, which is convenient for a relayer or batching front end, and it means any contract the owner is ever induced to call can turn round and drain this one.

Source Verified

Solidityeh_crack_source_verified
Compiler: v0.4.24

Bytecode Overview

Opcodes879
Unique Opcodes131
Jump Instructions47
Storage Operations7

External Links