@0xcert/ethereum-gateway-contracts 中文文档教程
以太坊区块链网关使用的智能合约。
0xcert Framework 是一个免费的开源 JavaScript 库,它提供用于构建强大的去中心化应用程序的工具。 请参阅官方文档了解更多详情。
该模块是 0xcert Framework 的组成部分之一。 它是用 TypeScript 编写的,并且得到积极维护。 源代码可在 GitHub 上找到,您还可以在其中找到我们的 问题跟踪器。
关于部署网关智能合约的警告
为了防止重放攻击(在测试网上创建的签名订单可以在主网上执行),订单签署机制包括您签署的订单中的合约地址。 这样,只有特定的智能合约地址才能执行已签名的订单。
以太坊 CREATE2
和其他方法提供了在结束的不同网络上部署相同合约的方法使用相同的合约地址。 这就是此警告存在的原因。 如果您自己部署网关或使用您不信任的第三方部署,这可能成为一个漏洞。
文档中提供了所有 0xcert 部署的地址。 我们绝不会以分配相同合约地址的方式在不同网络上部署智能合约。
Build
默认情况下,此包中的合约是为君士坦丁堡 EVM 构建的。 如果您想将这些智能合约用于 Wanchain
或其他使用 EVM 的不同版本的区块链,您需要为所需版本重建它们。
Smart contracts used by the gateway on the Ethereum blockchain.
The 0xcert Framework is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the official documentation for more details.
This module is one of the bricks of the 0xcert Framework. It's written with TypeScript and it's actively maintained. The source code is available on GitHub where you can also find our issue tracker.
Warning about deploying Gateway smart contract
To prevent replay attacks (signed order created on testnet can be executed on mainnet), the order signing mechanism includes the contract address in the order you sign. This way, only a specific smart contract address can execute the signed order.
Ethereum CREATE2
and other methods provide ways of deploying the same contract on different networks that end up with the same contract address. This is the reason this warning exists. If you are deploying the Gateway yourself or if you are using a third-party deployment that you do not trust, this could become a possible vulnerability.
All 0xcert-deployed addresses are available in Documentation. We will never deploy smart contracts on different networks in a way that would assign it the same contract addresses.
Build
By default, the contracts in this package are built for Constantinople EVM. If you would like to use these smart contracts for Wanchain
or other blockchains using EVM for a different version, you will need to rebuild them for the desired version.