基于区块链的毕业设计Boilerplate for ethereum solidity smart contract development – 以太坊固态智能合约开发样板

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Boilerplate for ethereum solidity smart contract development – 以太坊固态智能合约开发样板 是一篇很好的国外资料

Boilerplate for ethereum solidity smart contract development

INSTALL

yarn

TEST

yarn test

SCRIPTS

Here is the list of npm scripts you can execute:

Some of them relies on ./scripts.js to allow parameterizing it via command line argument (have a look inside if you need modifications)

yarn prepare

As a standard lifecycle npm script, it is executed automatically upon install. It generate config file and typechain to get you started with type safe contract interactions

yarn lint, yarn lint:fix, yarn format and yarn format:fix

These will lint and format check your code. the :fix version will modifiy the files to match the requirement specified in .eslintrc and .prettierrc.

yarn compile

These will compile your contracts

yarn void:deploy

This will deploy your contracts on the in-memory hardhat network and exit, leaving no trace. quick way to ensure deployments work as intended without consequences

yarn test [mocha args...]

These will execute your tests using mocha. you can pass extra arguments to mocha

yarn coverage

These will produce a coverage report in the coverage/ folder

yarn gas

These will produce a gas report for function used in the tests

yarn dev

These will run a local hardhat network on localhost:8545 and deploy your contracts on it. Plus it will watch for any changes and redeploy them.

yarn local:dev

This assumes a local node it running on localhost:8545. It will deploy your contracts on it. Plus it will watch for any changes and redeploy them.

yarn exec <network> <file.ts> [args...]

This will execute the script <file.ts> against the specified network

yarn deploy <network> [args...]

This will deploy the contract on the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it

yarn export <network> <file.json>

This will export the abi+address of deployed contract to <file.json>

yarn fork:run <network> [--blockNumber <blockNumber>] [--deploy] <file.ts> [args...]

This will execute the script <file.ts> against a temporary fork of the specified network

if --deploy is used, deploy scripts will be executed

yarn fork:deploy <network> [--blockNumber <blockNumber>] [args...]

This will deploy the contract against a temporary fork of the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it

yarn fork:test <network> [--blockNumber <blockNumber>] [mocha args...]

This will test the contract against a temporary fork of the specified network.

yarn fork:dev <network> [--blockNumber <blockNumber>] [args...]

This will deploy the contract against a fork of the specified network and it will keep running as a node.

Behind the scene it uses hardhat node command so you can append any argument for it

Simple ERC20 and ERC721


以太坊ethsolidity智能合约开发样板

安装

yarn

测试

yarn test

脚本

下面是您可以执行的npm脚本列表:

其中一些脚本依赖于/脚本.js要允许通过命令行参数对其进行参数化(如果需要修改,请查看内部)

yarn prepare

作为标准的生命周期npm脚本,它将在安装时自动执行。它生成配置文件和typechain,让您开始使用类型安全契约交互线头:固定纱线规格和纱线格式:fix

这些将对代码进行lint和格式化检查。:fix版本将修改文件以符合.eslintrc和.prettierrc中指定的要求。

纱线编译

这些将编译您的合同

纱线无效:部署

这将在内存中的安全帽网络上部署合同并退出,不留下任何痕迹。确保部署按预期工作而不产生任何后果的快速方法

This will deploy your contracts on the in-memory hardhat network and exit, leaving no trace. quick way to ensure deployments work as intended without consequences

纱线测试[mocha args…]

这些将使用mocha执行测试。您可以将额外的参数传递给mocha

yarn coverage

yarn coverage

这些参数将在coverage/文件夹中生成coverage报告

These will produce a gas report for function used in the tests

yarn gas

这些参数将为测试中使用的函数生成gas报告

yarn local:dev

yarn dev

这些参数将在本地主机:8545和部署你的合同。此外,它将监视任何更改并重新部署它们。

纱线本地:dev

这假设它运行在一个本地节点上本地主机:8545。它会在上面部署你的合同。此外,它将监视任何更改并重新部署它们。

纱线执行&lt;网络&gt;&lt;文件.ts&gt;[args…]

这将执行脚本&lt;文件.ts&gt;针对指定的网络部署&lt;network&gt;[args…]

这将在指定的网络上部署契约。

在场景后面,它使用hardhat deploy命令,因此您可以为它附加任何参数

yarn export&lt;network&gt;&lt;文件.json&gt;

这会将已部署合约的abi+地址导出到&lt;文件.json&gt;

纱线分叉:运行&lt;网络&gt;[–blockNumber&lt;blockNumber&gt;][–deploy]&lt;文件.ts&gt;[args…]

这将执行脚本&lt;文件.ts&gt;针对指定网络的临时分支

如果使用–deploy,则将执行部署脚本分叉:部署&lt;网络&gt;[–blockNumber&lt;blockNumber&gt;][args…]

这将针对指定网络的临时分支部署协定。

在场景后面,它使用hardhat deploy命令,因此您可以为它添加任何参数

fork:测试&lt;网络&gt;[–blockNumber&lt;blockNumber&gt;][mocha args…]

这将根据指定网络的临时分支测试契约。

纱线fork:dev&lt;网络&gt;[–blockNumber&lt;blockNumber&gt;][args…]

这将针对指定网络的分支部署契约,并将作为节点继续运行。

Simple ERC20 and ERC721

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

www.interchains.cc

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

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Boilerplate for ethereum solidity smart contract development – 以太坊固态智能合约开发样板

提供最优质的资源集合

立即查看 了解详情