基于区块链的毕业设计UmbriaAirdrop – 翁布里亚空投

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计UmbriaAirdrop – 翁布里亚空投 是一篇很好的国外资料

UmbriaAirdrop

Airdrop solidity contracts and migrations code, for early Umbria and Umbria-ETH LP holders.

This set of contracts and its respective migrations code is designed to be tested by the community, before deployment. This is for two reasons:

  • A) Transparency of operations – the community should know how the aidrop is being deployed
  • B) Auditing – maybe there is a mistake in the code that you can spot?

Getting started

I used Truffle, Ganache and VSCode for this deployment


Setting up truffle

npm install -g truffle

Creating a new truffle project

truffle init

After that, you can replace the contracts and migrations folders from this project into your project

Your truffle config should look something like this
module.exports = {    networks: {      test: {        host: "127.0.0.1",        port: 7545,        network_id: 5777,      },        },    compilers: {      solc: {        version: "0.7.4",        settings: {          optimizer: {            enabled: true,            runs: 9999, // Optimize for how many times you intend to run the code          },        },      },    },  }; 

Setting up Ganache

Start by Downloading Ganache
  • Open Ganache
  • Press the QUICKSTART button
  • Make sure the NETWORK ID and RPC SERVER values in the GUI match your truffle config
  • You can configure both NETWORK ID and RPC SERVER in the Ganache settings (Gear Icon)

Deploying the Airdrop Contracts, and Testing Their Functionality

The contract deployment occurs in two phases:

  1. 1_initial_migration.js runs first. This code does very little, it pretty much just records the time of deployment on the blockchain.
  2. 2_do_airdrop.js runs second. This code deploys the airdrop contract and all supporting contracts for executing the airdrop. Add your own deployments, tests etc to this deployment.

Expected Results

The airdrop contracts are expected to have the following functionality:

  • ✔️ msg.sender should be able to set a list of UMBR holders and their respective balances after March 1st
  • ✔️ msg.sender should be able to set a list of UMBR-ETH LP (Uniswap LP Token) holders and their respective balances after March 1st
  • ✔️ Anyone should be able to see their wallet’s UMBR or UMBR-ETH LP balance at the time of the snapshot. If they had a balance of 0, the contract should throw an error
  • ✔️ The contract should store a mapping of users who have claimed the airdrop based on holding UMBR
  • ✔️ The contract should store a mapping of users who have claimed the airdrop based on holding UMBR-ETH LP
  • ✔️ The contract should throw an error if a user tries to double-claim
  • ✔️ The contract should store an amount of UMBR
  • ✔️ Airdrop amount should be contigent on UMBR/LP Balance vs Airdrop Max Supply
  • ✔️ The contract should allow users to claim using UMBR-ETH LP snapshot balance
  • ✔️ The contract should allow users to claim using UMBR snapshot balance
  • ✔️ The contract should emit an Airdrop even whenever a user claims

Finished V1 testing


UmbriaAirdrop

Airdrop solidity contracts and migrations code, for early Umbria and Umbria-ETH LP holders.

This set of contracts and its respective migrations code is designed to be tested by the community, before deployment. This is for two reasons:

  • A) Transparency of operations – the community should know how the aidrop is being deployed
  • B) Auditing – maybe there is a mistake in the code that you can spot?

Getting started

I used Truffle, Ganache and VSCode for this deployment


Setting up truffle

npm install -g truffle

Creating a new truffle project

truffle init

After that, you can replace the contracts and migrations folders from this project into your project

Your truffle config should look something like this
module.exports = {    networks: {      test: {        host: "127.0.0.1",        port: 7545,        network_id: 5777,      },        },    compilers: {      solc: {        version: "0.7.4",        settings: {          optimizer: {            enabled: true,            runs: 9999, // Optimize for how many times you intend to run the code          },        },      },    },  }; 

Setting up Ganache

Start by Downloading Ganache
  • Open Ganache
  • Press the QUICKSTART button
  • Make sure the NETWORK ID and RPC SERVER values in the GUI match your truffle config
  • You can configure both NETWORK ID and RPC SERVER in the Ganache settings (Gear Icon)

Deploying the Airdrop Contracts, and Testing Their Functionality

The contract deployment occurs in two phases:

  1. 1_initial_migration.js runs first. This code does very little, it pretty much just records the time of deployment on the blockchain.
  2. 2_do_airdrop.js runs second. This code deploys the airdrop contract and all supporting contracts for executing the airdrop. Add your own deployments, tests etc to this deployment.

Expected Results

The airdrop contracts are expected to have the following functionality:

  • ✔️ msg.sender should be able to set a list of UMBR holders and their respective balances after March 1st
  • ✔️ msg.sender should be able to set a list of UMBR-ETH LP (Uniswap LP Token) holders and their respective balances after March 1st
  • ✔️ Anyone should be able to see their wallet’s UMBR or UMBR-ETH LP balance at the time of the snapshot. If they had a balance of 0, the contract should throw an error
  • ✔️ The contract should store a mapping of users who have claimed the airdrop based on holding UMBR
  • ✔️ The contract should store a mapping of users who have claimed the airdrop based on holding UMBR-ETH LP
  • ✔️ The contract should throw an error if a user tries to double-claim
  • ✔️ The contract should store an amount of UMBR
  • ✔️ Airdrop amount should be contigent on UMBR/LP Balance vs Airdrop Max Supply
  • ✔️ The contract should allow users to claim using UMBR-ETH LP snapshot balance
  • ✔️ The contract should allow users to claim using UMBR snapshot balance
  • ✔️ The contract should emit an Airdrop even whenever a user claims

Finished V1 testing

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情