官方的 MASTR 标志 MASTR 支持这项工作
目录
← 知识库首页

区块链基础

Contract storage: the persistent state a transaction changes

Code executes, but balances, permissions and configuration survive in the contract's storage.

Technical reference · EVM state · 1 min read

研究文章和参考条目以英语发布。导航提供七种语言。

本文目录
  1. Persistent data
  2. Upgrades make layout consequential
  3. 来源与原始文件

Persistent data

An EVM contract can keep values in persistent storage. Solidity assigns slots according to its storage-layout rules, with specific arrangements for packed values, mappings and dynamic arrays. A transaction can update that state when execution succeeds, and later calls read the new values.

This is where an application may record an owner, a user's debt, an allowance, a pause flag or an implementation address. Reading source code without checking the deployed state leaves important questions unanswered: which account is the owner now, is the contract paused, and which parameters are active?

Upgrades make layout consequential

An upgrade can execute new logic over old storage. If the replacement logic interprets a slot differently, data that used to represent one value can acquire a different meaning. Compatibility is therefore more than whether the new functions compile.

For an investigation, preserve both the code identity and the block at which state was read. Proxy upgrades explain how logic changes while an address remains the same. Evidence snapshots explain why a current read cannot establish what the storage contained before a disputed transaction.

来源与原始文件

相关阅读

MASTR

支持独立研究

这里的调查、原始证据和指南均可免费阅读。自愿捐赠帮助支付研究成本,让 MASTR 能够继续提供工具。

打开钱包