智能合约
:material-circle-edit-outline: 约 295 个字 :material-clock-time-two-outline: 预计阅读时间 1 分钟
智云课堂 软件安全原理和实践(本)2024-12-03第3-5节
05_smartcontract_security_a 05_smartcontract_security_b
05_smartcontract_security_d 05_smartcontract_security_e
以太坊的简介见 LAB/note/Ethereum.md
Basic Concepts
Ethereum Node
以太网本身是一个分布式网络,是区块链下的一种网络,有散布于全球各地的一个个结点组成
Ethereum can be treated as a transaction-based state machine,状态转移由交易驱动
States 包含 Account balance and nonce,Contract code and storage,Other consensus-related data
Accounts
可以看成储存 state 的一个 key
Two types of accounts: Externally owned accounts (EOA,外部账户),Smart contract account
Externally Owned Account (EOA, Valid Ethereum Address) 是通过公钥进行一定的运算得到的一个地址,其拥有权由私钥决定
- Can have a balance
- Has an associated nonce and a balance
- nonce is amount of transactions sent from the account,即该账号发送过多少交易
- codeHash,Hash of associated account code,账户储存的代码对应的 hash
Metamask 上的就是一种 EOF 网络
Ethereum 是一个主网,真金白银的,当然还有测试网络,资产没有价值
Transactions 交易
EOA 和合约都可以调合约,前者为外部,后者为内部