Deposit forwarder that re-points itself at a new destination before forwarding.
Historical Significance
Self updating deposit addresses solved a real problem for operators, who could not change an address already handed out to a customer. Putting the pointer refresh in the deposit path meant every incoming payment paid for the check, and the thousand gas cap on the forwarding call left very little room for the receiver to do any work.
Key Facts
Description
A deposit address that keeps its destination up to date on its own. Before forwarding anything it asks the current destination for a replacement through getUpgradeAddress(), and stores the answer when it is not the zero address. It then calls deposit(address) on the destination with the sender's address and the ether received, capped at a thousand gas. tryUpgrade() exposes the same refresh step so it can be triggered without sending funds. 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
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.4;
contract Upgradeable {
function getUpgradeAddress() returns (address);
function deposit(address _from) payable;
}
contract DepositForwarder {
Upgradeable target;
function () payable {
tryUpgrade();
target.deposit.value(msg.value).gas(1000)(msg.sender);
}
function tryUpgrade() {
address a = target.getUpgradeAddress();
if (a != 0) {
target = Upgradeable(a);
}
}
}