/ 工具
■/ 工具查找器
109 个工具
/ Delegatecall 存储分析器
/ 所选工具
■Delegatecall 存储分析器 - 免费 Web3 工具
分析 delegatecall 和代理的存储布局兼容性
■ 01
什么是 Delegatecall?
Delegatecall 会在调用合约的上下文中执行另一个合约的代码。这意味着它使用调用者的存储,因此对于可升级的代理模式至关重要。
■ 02
它是如何工作的?
Delegatecall 在调用者的存储上下文中执行另一个合约的代码时,会保留 msg.sender 和 msg.value。存储槽通过位置(0、1、2...)访问,而非变量名。这使得代理能够……
■ 03
示例场景
涵盖 Aave V3 Pool(0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2)、Compound III(0xc3d67e4b63a3c385042d8d6b13e3e0ff485e0994)和 Safe 存储间隙模式,让你可以快速比较常见的输入与输出。
/ 相关工具
/ 代码
■所选工具的源代码,显示在此处,右侧为实时运行版本。
/ 源代码
TypeScript
typescript
// No external packages needed - pure TypeScript
interface StorageSlot {
name: string;
type: string;
slot: number;
offset: number;
size: number;
}