Lottery Smart Contract in Solidity – 可靠的彩票智能合约区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Lottery Smart Contract in Solidity – 可靠的彩票智能合约区块链毕设代写 是一篇很好的国外资料

Lottery Smart Contract in Solidity

Description

This is a smart contract written in Solidity following a section of Stephen Grider’s Udemy course. The code has been refactored to work with Solidity 0.7.0.

Instructions

  1. Clone respository, navigate to the directory path on your terminal and run npm install.

  2. Run touch .env to generate a file to store your local environment variables.

  3. Sign up for Infura, create a project and copy the endpoint for the network you wish to deploy to.

  4. Add a 12 phrase mnemonic and your Infura endpoint to your .env file as ‘MNEMONIC’ and ‘INFURA_ENDPOINT’.

  5. Run node deploy.js.

  6. Copy the contract’s address from the console output, and verify the contract’s deployment on Etherscan. Make sure you’re checking the right network on Etherscan if you’re not deploying the the Ethereum main net.

Additional notes

If you would like to modify the smart contract, make sure you recompile the solidity file.

For this project I used solc, which I have installed globally on my machine.

To compile to bytecode from the base of your directory, run solcjs ./contracts/Lottery.sol --bin to create plain text file in your directory with the contract’s bytecode.

Run solcjs ./contracts/Lottery.sol --abi for a file with the smart contract’s application binary interface (abi).


Solidity中的彩票智能合约

说明

这是一份在斯蒂芬·格里德(Stephen Grider)Udemy课程之后用Solidity编写的智能合约。代码已经过重构,可以使用solidity0.7.0。

附加说明

  1. 克隆存储库,导航到终端上的目录路径并运行npm install。
  2. 运行touch.env生成一个文件来存储本地环境变量。
  3. 注册Infura,创建一个项目并复制要部署到的网络的端点。
  4. 在.env文件中添加一个12短语助记符和Infura端点,作为“助记符”和“Infura_endpoint”。
  5. 运行节点部署.js.
  6. 从控制台输出复制契约的地址,并验证契约在Etherscan上的部署。如果你没有部署以太坊eth主网,请确保你在Etherscan上检查了正确的网络。在

Additional notes

如果要修改智能合约,请确保重新编译solidity文件。

对于这个项目,我使用solc,它已经在我的机器上全局安装。

要从目录的底部编译为字节码,请运行solcjs./contracts/彩票.sol–bin在目录中创建带有合同字节码的纯文本文件。

运行solcjs./contracts/彩票.sol–abi用于具有智能合约的应用程序二进制接口(abi)的文件。

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

www.interchains.cc

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

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Lottery Smart Contract in Solidity – 可靠的彩票智能合约区块链毕设代写

提供最优质的资源集合

立即查看 了解详情