基于区块链的毕业设计SolidState Solidity – 固态固体

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计SolidState Solidity – 固态固体 是一篇很好的国外资料

SolidState Solidity

Warning: this library is in a pre-release state; contracts are not sufficiently tested for production use, documentation may be missing or inaccurate, and the API may change at any time.

SolidState is an upgradeable-first Solidity smart contract development library.

It consists of the following packages:

package description ?
@solidstate/contracts core contracts ?
@solidstate/spec portable tests which may be run against third-party implementations of core contracts ?
@solidstate/library functions for interacting with and validating contracts ?

Contracts

All contracts are designed to either be deployed through the standard constructor method, or referenced by a proxy. To this end, the diamond storage pattern is employed exclusively.

Spec

Where possible, automated tests are designed to be imported by repositories which make use of the SolidState contracts and run against any derived contracts. This is to help prevent unintended changes to to the base contract behavior.

For example, consider a custom ERC20Base implementation:

import '@solidstate/contracts/token/ERC20/ERC20Base.sol';  contract CustomToken is ERC20Base {   // custom code... }

Rather than rewrite the ERC20Base tests or assume that all core behavior remains untouched, one can import the included tests and run them against the custom implementation:

describe('CustomToken', function () {   const deploy = async function () {     const factory = await ethers.getContractFactory('CustomToken');     const instance = await factory.deploy();     return await instance.deployed();   }    // eslint-disable-next-line mocha/no-setup-in-describe   describeBehaviorOfERC20Base({ deploy });    // custom tests... });

Development

Install dependencies via Yarn:

yarn install

Link local packages and install remaining dependencies via Lerna:

yarn run lerna bootstrap

Compile contracts via Hardhat:

yarn run hardhat compile

Networks

By default, Hardhat uses the Hardhat Network in-process.

To use an external network via URL, set the URL environment variable and append commands with --network generic:

URL="[NODE_URL]" yarn run hardhat test --network generic

Publication

Publish packages via Lerna:

yarn run lerna publish

Testing

Test contracts via Hardhat:

yarn run hardhat test

Activate gas usage reporting by setting the REPORT_GAS environment variable to "true":

REPORT_GAS=true yarn run hardhat test

Generate a code coverage report using solidity-coverage:

yarn run hardhat coverage

Sponsor

SolidState Solidity - 固态固体


稳定度

警告:此库处于预发布状态;合同没有经过充分的生产使用测试,文档可能丢失或不准确,API可能随时更改

SolidState是第一个可升级的Solidity智能合约开发库

它由以下包组成:

package description ?
@SolidState/合同 核心合同 ?
@solidstate/spec 可针对核心合约的第三方实现运行的便携式测试 ?
@solidstate/library 用于与契约交互和验证契约的函数 ?

合同

所有契约设计为通过标准构造函数方法部署,或由代理引用。为此,专门采用钻石储存模式

规范

在可能的情况下,自动化测试被设计成由使用SolidState契约的存储库导入,并针对任何派生契约运行。这有助于防止对基本契约行为的意外更改

例如,考虑一个定制的ERC20Base实现:

import '@solidstate/contracts/token/ERC20/ERC20Base.sol';  contract CustomToken is ERC20Base {   // custom code... }

而不是重写ERC20Base测试或假设所有核心行为保持不变,您可以导入包含的测试并针对自定义实现运行它们:

describe('CustomToken', function () {   const deploy = async function () {     const factory = await ethers.getContractFactory('CustomToken');     const instance = await factory.deploy();     return await instance.deployed();   }    // eslint-disable-next-line mocha/no-setup-in-describe   describeBehaviorOfERC20Base({ deploy });    // custom tests... });

开发

通过Yarn安装依赖项:

yarn install

链接本地包并通过Lerna安装其余的依赖项:

yarn run lerna bootstrap

通过Hardhat编译契约:

yarn run hardhat compile

网络

默认情况下,Hardhat使用Hardhat网络进程内

要通过URL使用外部网络,设置URL环境变量并使用–network generic:

URL="[NODE_URL]" yarn run hardhat test --network generic

出版

通过Lerna发布包:

yarn run lerna publish

测试

通过Hardhat测试合同:

yarn run hardhat test

通过将REPORTu gas环境变量设置为“true”来激活气体使用情况报告:

REPORT_GAS=true yarn run hardhat test

使用solidity coverage生成代码覆盖率报告:

yarn run hardhat coverage

赞助商

SolidState Solidity - 固态固体

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/22507.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计SolidState Solidity – 固态固体

提供最优质的资源集合

立即查看 了解详情