Crowdsourcing Fundamentals, Execution and Prepration. – 众包基础,执行和准备。区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Crowdsourcing Fundamentals, Execution and Prepration. – 众包基础,执行和准备。区块链毕设代写 是一篇很好的国外资料

Crowdsourcing Fundamentals, Execution and Prepration.

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

Premise

Our company has decided to crowdsale their new ERC20 token, PupperCoin, in exchange for ETH to fund further network development. We have been tasked with writing the smart contracts to facilitate the offering. The offering must be capped at a total of 300 ETH raised, be able to run for 24 weeks, and be able to refund purchases should the crowdsale be successful.

Contracts

There are two solidity files, containing a total of three smart contracts which will provide all needed functionality for the crowdsale of tokens. PupperCoin.sol and Crowdsale.sol.

  • PupperCoin.sol
    • This file contains the standard code needed for ERC20 tokens. It uses OpenZeppelin’s contract caches: ERC20, ERC20Detailed, ERC20Mintable. When the contract is deployed, these smart contract functions allow for the initial enumeration of the PupperCoin, as well as setting out the minting instructions for the creation of the actual tokens to be sent to crowdsale participants.

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • Crowdsale.sol
    • This files contains the totality of the code for, unsurprisingly, the crowdsale itself. It uses OpenZeppelin’s contract caches: Crowdsale, MintedCrowdsale, CappedCrowdsale, TimedCrowdsale, RefundablePostDeliveryCrowdsale. Each one of these aptly named libraries takes parameters from the constructor function to then execute or provide the specific requirements previously stated. These functions will control everything from accepting payment for tokens, distributing newly minted tokens, tracking the time left in the crowdsale, to refunding purchases after the sale’s completion.

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。 Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

Usage

Smart Contract Deployment

In order for crowdsale contracts to function accurately, smart contracts should be executed in the following order.

  • Connect to the network to Kovan testnet with Metamask and MyCrypto. Pre-fund the primary address to ensure successful deployment of the contract.

  • The first contract to deploy is PupperCoin (this code must be initiated first, otherwise Crowdsale.sol cannot function). Parameters required for deployment: name (PupperCoin), symbol (PUP), initial_supply (0).

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。 Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • The second contract to deploy is PupperCoinSaleDeployer. Parameters required: name, symbol, wallet (this wallet address will hold the paid ETH/wei generated from the crowdsale) and goal (the total ETH demoninated in wei to raise via PupperCoin sales).
    • Once deployed, the contract will create Token_Address & Token_Sale_Address under the ‘Deployed Contracts’ tab. These addresses will be useful later.

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。 Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • The final contract to deploy is PupperCoinSale. This needs to be done with the previously generated Token_Sale_Address in the ‘At_Address’ section beneath the standard deployment button.

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

Token Interactions

  • Buy Tokens under PupperCoinSale on Remix

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。 Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • Validate the transaction on Etherscan

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • Add Custom Tokens (PUP) to Metamask
    • Under Assets, click on Add Tokens
    • Under Add Tokens, click on Custom Tokens
    • Parameters (These will pre-populate):
      • Token Address – Token_Address
      • Name – Token_Name
      • Decimal – 18

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • Metamask wallet: ETH and PUP

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • View Tokens on MyCrypto Wallet Access your wallet address on MyCrypto to view the updated balances (You may need to add the PUP like above).

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。


众包基础,执行和准备。

我们公司决定众售他们的新ERC20代币PupperCoin,以换取ETH为进一步的网络发展提供资金。我们的任务是编写智能合约,以方便提供服务。发售的上限必须是总共募集300 ETH,能够运行24周,如果众筹成功,还可以退款购买。

前提

有两个solidity文件,共包含三个智能合约,将提供众售代币所需的所有功能。木偶胶.sol以及众售.sol.

契约

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • 木偶胶.sol此文件包含ERC20令牌所需的标准代码。它使用OpenZeppelin的合同缓存:ERC20,ERC20Detailed,erc20maintable。部署契约时,这些智能契约功能允许对PupperCoin进行初始枚举,并为创建要发送给众售参与者的实际代币设定铸币指令。

要使众售合同准确运行,智能合同应按以下顺序执行。

  • 众售.sol这些文件包含了众包销售本身的全部代码。它使用OpenZeppelin的合同缓存:众售、MintedCrowdsale、CappedCrowdsale、TimedCrowdsale、ReturnablePostDeliveryCrowdSale。这些命名恰当的库中的每一个都从构造函数中获取参数,然后执行或提供前面所述的特定需求。这些功能将控制从接受代币付款、分发新铸造的代币、跟踪众售剩余时间到销售完成后退款的一切。

使用Metamask和MyCrypto将网络连接到Kovan testnet。预先为主要地址提供资金,以确保合同的成功部署。

使用

智能契约部署

要部署的第一个协定是PupperCoin(必须首先启动此代码,否则众售.sol无法运行)。部署所需的参数:名称(PupperCoin)、符号(PUP)、初始供应(0)。<<Crowdsourcing Fundamentals, Execution and Prepration.<Crowdsourcing Fundamentals, Execution and Prepration.<<Crowdsourcing Fundamentals, Execution and Prepration.<<<Crowdsourcing Fundamentals, Execution and Prepration.<<<<<<<

  • 使用Metamask和MyCrypto将网络连接到Kovan testnet。预先为主要地址提供资金,以确保合同的成功部署。
  • 要部署的第一个协定是PupperCoin(必须首先启动此代码,否则众售.sol无法运行)。部署所需的参数:名称(PupperCoin)、符号(PUP)、初始供应(0)。

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。 Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • 要部署的第二个合同是PupperCoinSaleDeployer。所需参数:名称、符号、钱包(此钱包地址将保存众筹产生的已付ETH/wei)和目标(通过PupperCoin销售以wei显示的总ETH)。一旦部署,合同将在“部署的合同”选项卡下创建令牌地址和令牌销售地址。这些地址以后会有用的。

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。 Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • 部署的最终合同是PupperCoinSale。这需要使用标准部署按钮下“Atu Address”部分中先前生成的令牌u Saleu地址来完成。

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

令牌交互

  • 在PupperCoinSale on Remix下购买代币

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。 Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • 在Etherscan上验证交易

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • 将自定义代币(PUP)添加到资产下的元掩码中,单击Add Tokens下的Add Tokens,单击Custom Tokens Parameters(这些参数将预先填充):Token Address-Tokenu Address Name-Tokenu Name Decimal-18资产,单击Add Tokens下的Add Tokens,单击Custom Tokens参数(这些参数将预先填充):Token Address-Tokenu Address Name-Tokenu Name Decimal-18MyCrypto钱包上的令牌访问MyCrypto上的钱包地址以查看更新的余额(您可能需要像上面那样添加PUP)。你知道吗

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • Metamask wallet: ETH and PUP

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

  • View Tokens on MyCrypto Wallet Access your wallet address on MyCrypto to view the updated balances (You may need to add the PUP like above).

Crowdsourcing Fundamentals, Execution and Prepration. - 众包基础,执行和准备。

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

www.interchains.cc

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

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Crowdsourcing Fundamentals, Execution and Prepration. – 众包基础,执行和准备。区块链毕设代写

提供最优质的资源集合

立即查看 了解详情