Skip to Content
精通区块链
book

精通区块链

by Lorne Lantz, Daniel Cawrey
March 2022
Intermediate to advanced
293 pages
5h 31m
Chinese
China Electric Power Press Ltd.
Content preview from 精通区块链
130 | 第 5 章
将不会完成。这就像收到一封邮寄的信,然后把它退回去。同样地,一个
请求代币转移的智能合约可以收到
tokensToSend
钩子,当该钩子被调用
时,可以选择回退该交易。这种情况不太可能发生,因为这是启动代币转
移的智能合约——这就像去邮局寄信,但在即将交信时又改变主意。
send(address to, uint256 amount, bytes data)
推送交易包括一个数据字段,不仅允许发送者向合约发送代币,还可以包
含触发接收合约中的函数的专门逻辑。这类似于以太坊交易的执行方式。
尽管
ERC-777
标准是对
ERC-20
的改进,但它还没有被业界采用,因为所有
的利益相关者要转向新的标准有巨大的转换成本。许多项目将不得不创建新
的代币合约,然后说服代币持有人使用新的标准将现有的代币换成等量的代
币。交易所和一些
DApp
也必须更新他们的系统以支持新标准。
5.2.4 ERC-1155
这个标准是为了追踪游戏中的虚拟物品而设计的。例如,射击游戏中的默认
武器可能是手枪,但有可能购买三管火箭发射武器,一枪打死一百个敌人。
这些游戏内物品的理想代币标准将具有
ERC-20
和
ERC-721
的混合属性:
• ERC-20
(同质化),这样你就可以给虚拟物品附加一个价格,然后用户
可以购买和交易该物品
• ERC-721
(非同质化),这样虚拟物品就可以有独特的属性,例如,它可
以容纳多少火箭,或者武器的威力有多大。
与
ERC-777
代币标准一样,这个标准包括一个运营者的概念,另一个授权代
表你转移你的代币的地址。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
机器学习流水线实战

机器学习流水线实战

Hannes Hapke, Catherine Nelson
Python和NLTK实现自然语言处理

Python和NLTK实现自然语言处理

Posts & Telecom Press, Nitin Hardeniya
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9787519863166