Back to Home

DepositContract

0x3244548f7861...e1f4182dc8b3
ByzantiumSource VerifiedEdit this contract
Deployed November 25, 2018 (7 years ago)Block 6,772,241

Version 2 of the Populous per-client deposit contract, extended from ERC20 custody to ether, ERC721 and ERC1155, and stamped with the client ID it belongs to.

Byzantium EraVerified Source

Historical Significance

ERC1155 was still a draft when this was deployed, and very little onchain in 2018 was written to hold all three token standards plus ether behind one authorisation check. What makes it readable now is the clientId slot: version 1 deposit contracts were anonymous, identifiable only by which client's records pointed at them, and version 2 put the identifier onchain. The receiver hooks are the other tell. They are the point at which a deposit address stopped being a passive balance and had to actively consent to what was sent to it.

Key Facts
Deployment Block
6,772,241
Deployment Date
Nov 25, 2018, 09:03 PM
Code Size
3.2 KB

Description

This is the second generation of the address Populous gave each client on its invoice financing platform. The first version held ERC20 tokens and nothing else. This one reports version 2 through getVersion, carries the client's identifier in a bytes32 storage slot readable through getClientId, and widens custody to every asset type the platform had started to touch.

transferEther sends ether out with a balance check and a send, logging EtherTransfer. transferERC721 calls safeTransferFrom on the token contract with this contract as the sender, and transferERC1155 calls safeTransfer. Each one is gated the same way version 1 was, on an AccessManager answering true to isServer or isPopulous, so widening the asset types did not widen who may act.

Because the contract is now a destination for safe transfers, it implements the two receiver hooks: onERC721Received returns 0x150b7a02 and onERC1155Received returns 0xf23a6e61, the magic values those standards require before a token contract will complete a transfer into a contract account. Without them these addresses would have been unable to receive the assets they were built to hold.

The read side follows: balanceOf branches on the zero address to report ether rather than a token balance, and balanceOfERC721 and balanceOfERC1155 query the respective token contracts. The source is Populous's own, DepositContract inheriting withAccessManager against the iERC20Token, ERC721Basic and ERC1155 interfaces.

Source Verified

Solidityeh_crack_source_verified
Compiler: v0.4.17

Bytecode Overview

Opcodes3,284
Unique Opcodes187
Jump Instructions179
Storage Operations31

External Links

Related contracts