Jackpot Playground – 彩票游乐场区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Jackpot Playground – 彩票游乐场区块链毕设代写 是一篇很好的国外资料

Jackpot Playground

This repository contains a sample project made mainly to learn something about Solidity, Chainlink ecosystem and Hardhat.
It is based on:
https://github.com/pappas999/chainlink-hardhat-box
https://github.com/nomiclabs/hardhat-hackathon-boilerplate
and reuse a lot of them.

It is a dummy lottery. The user buys a ticket in one transaction and then draws a lot in another one, wins or loses.
It is not the best implementation of the lottery on Ethereum, it may be the worst one or at least too verbose one.

Requirements

  • NPM

Installation

npm install 

Default netowrk: kovan

Set environmental variables:

export KOVAN_RPC_URL='www.infura.io/asdfadsfafdadf' export PRIVATE_KEY='abcdef' export ALCHEMY_MAINNET_RPC_URL="https://eth-mainnet.alchemyapi.io/v2/your-api-key"

Building

npx hardhat compile

Unit testing

npx hardhat test --network hardhat 

Deploying – both contracts

npx hardhat deploy

Funding RandomVRF contract with link token

It needs that to take random numbers from an oracle.

npx hardhat fund-link --contract insert-vrf-contract-address-here

Interaction

Buying the lottery ticket for i.e. 0.05 ETH

npx hardhat buy-ticket --contract insert-contract-address-here

Roll – something like rolling a dice

npx hardhat roll --contract insert-contract-address-here

add typechain


Jackpot Playground

This repository contains a sample project made mainly to learn something about Solidity, Chainlink ecosystem and Hardhat.
It is based on:
https://github.com/pappas999/chainlink-hardhat-box
https://github.com/nomiclabs/hardhat-hackathon-boilerplate
and reuse a lot of them.

It is a dummy lottery. The user buys a ticket in one transaction and then draws a lot in another one, wins or loses.
It is not the best implementation of the lottery on Ethereum, it may be the worst one or at least too verbose one.

Requirements

  • NPM

Installation

npm install 

Default netowrk: kovan

Set environmental variables:

export KOVAN_RPC_URL='www.infura.io/asdfadsfafdadf' export PRIVATE_KEY='abcdef' export ALCHEMY_MAINNET_RPC_URL="https://eth-mainnet.alchemyapi.io/v2/your-api-key"

Building

npx hardhat compile

Unit testing

npx hardhat test --network hardhat 

Deploying – both contracts

npx hardhat deploy

Funding RandomVRF contract with link token

It needs that to take random numbers from an oracle.

npx hardhat fund-link --contract insert-vrf-contract-address-here

Interaction

Buying the lottery ticket for i.e. 0.05 ETH

npx hardhat buy-ticket --contract insert-contract-address-here

Roll – something like rolling a dice

npx hardhat roll --contract insert-contract-address-here

add typechain

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情