Contracts
BrickReserve
The vault's ETH and its log in one contract. ETH leaves only as numbered withdrawals, and boxes are appended, never removed.
BrickReserve, example entries
- In0.0511 ETH from BrickFeeRouter (harvest)
- Out #10.2600 ETH to the purchasing wallet, memo 10307 Eiffel Tower
- Box #00110307, $629.99, paid by withdrawal #1, hash 0x3b1c…
- Custody#001 In transit, tracking attached
- Custody#001 Vaulted, shelf photo with vault card
- Box #00221058, $129.99, paid by withdrawal #2
Append only. Nothing above this line can change.
Functions
| Function | Who | What it does |
|---|---|---|
receive() | Anyone | Accepts ETH. Harvests arrive this way. |
withdraw(to, amount, memo) | Owner | The only way ETH leaves. Numbered and stored. |
recordAcquisition(…) | Owner | Appends box #n with its cost, withdrawal and metadata hash. |
updateCustody(n, status, uri) | Owner | Ordered, In transit, Vaulted or Opened. |
amendMetadata(n, uri, hash, reason) | Owner | Replaces a document with a public reason. The old one stays in the event history. |
withdrawToken(asset, to, amount, memo) | Owner | Moves an ERC-20 someone sent the reserve. |
acquisition(n), acquisitions(from, count) | View | One box, or a page of the log. |
withdrawal(id), withdrawalCount() | View | Money out. |
totalReceived(), totalWithdrawn() | View | Running totals, in wei. |
What a record holds
An acquisition stores the set number, time, cost in cents, withdrawal id, custody state, metadata URI and metadata hash. A withdrawal stores its destination, time and amount. Both are readable by anyone, forever. How a box is logged walks through filling them in.
Events
Deposited(from, amount)Withdrawn(id, to, amount, memo)AcquisitionRecorded(number, setNumber, costUsdCents, withdrawalId, metadataURI, metadataHash)CustodyUpdated(number, status, evidenceURI)AcquisitionAmended(number, metadataURI, metadataHash, reason)
Rules it keeps
- Numbers start at 1 and only go up. There is no delete.
- A withdrawal id cited by a box must already exist.
- Ownership moves in two steps and can't be renounced, because a reserve with no owner would lock its ETH forever.