MADANA PAX Token Contract – MADANA PAX代币合约区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,MADANA PAX Token Contract – MADANA PAX代币合约区块链毕设代写 是一篇很好的国外资料

MADANA PAX Token Contract

Specifications

  • Initial balance: 100 million MDN tokens to be held by the owner account
  • Token standard: ERC-20
  • ERC20Detailed
    • Name: MADANA PAX
    • Symbol: MDN
    • Decimals: 18
  • ERC20Burnable
    • Supply can be decreased by the owner only by calling the burn function to burn tokens from its own account Note: token holders are not able to burn their tokens
  • Reclaimable
    • Allows to recover any ERC20 tokens accidentally sent to the smart contract by calling the reclaimToken function. The recovered tokens will be sent to the owner account. The owner can then send those tokens to the account claiming them. This functionality will only be available to the owner account
  • ERC20MultiTransfer
    • A token holder can distribute their tokens to multiple accounts at once using the multiTransfer functionality

Roles

  • Owner Role
    • Can decrease the total supply
    • Can reclaim ERC20 tokens accidentally sent to the MDN token smart contract Note: The owner can transfer the ownership to a different account if required

Deployment Instructions

  • Deploy MADANA contract
    • record contract address

Tool-chain Update:

When running the coverage command, the solidity-coverage package does not fully support all syntex of Solidity v5.0+. Keywords such as calldata, payable are cannot be parsed properly. When waiting for the update of the solidity-coverage package, the workaround of this issue is:

  1. Replace the content of /node_modules/solidity-parser-sc/build/parser.js with code written by @maxsam4 at https://raw.githubusercontent.com/maxsam4/solidity-parser/solidity-0.5/build/parser.js.
  2. This piece of code can also be found at tools/parser.js in case online source is updated or unavailable.

Linter

Please use this solidity VSCode plugin to ensure your contracts follows the solidity style and security guides. yarn test only runs, if no linter issues detected!

All security rules should be implemented according ConsenSys Guide for Smart Contracts.

All style guide rules should be implemented according Solidity Style Guide.

For more information look into the Solhint docs.

Requirements

The server side scripts requires NodeJS 8 to work properly. Go to NVM and follow the installation description.

Use correct NodeJS version for this project

Before installing any dependencies (yarn install), ensure, you are using the right node version.

nvm install nvm use 

NVM supports both Linux and OS X, but that’s not to say that Windows users have to miss out. There is a second project named nvm-windows which offers Windows users the possibility of easily managing Node environments.

nvmrc support for windows users is not given, please make sure you are using the right Node version (as defined in .nvmrc) for this project!

Yarn is required to be installed globally to minimize the risk of dependency issues. Go to Yarn and choose the right installer for your system.

For the Rinkeby and MainNet deployment, you need Geth on your machine. Follow the installation instructions for your OS.

Depending on your system the following components might be already available or have to be provided manually:

  • Python 2.7 Version only! Windows users should put python into the PATH by cheking the mark in installation process. The windows build tools contain python, so you don’t have to install this manually.
  • GIT, should already installed on *nix systems. Windows users have to install GIT manually.
  • On Windows systems, PowerShell is mandatory
  • On Windows systems, windows build tools are required (already installed via package.json)
  • make (on Ubuntu this is part of the commonly installed sudo apt-get install build-essential)
  • On OSX the build tools included in XCode are required

Every command must be executed from within the projects base directory!

Setup

Open your terminal and change into your project base directory. From here, install all needed dependencies.

yarn install 

This will install all required dependencies in the directory node_modules.

Compile, migrate, test and coverage

To compile, deploy and test the smart contracts, go into the projects root directory and use the task runner accordingly.

# Compile contract yarn compile  # Migrate contract yarn migrate  # Test the contract yarn test  # Run coverage tests yarn coverage 

Infura Testnet Deployment – Ropsten, Rinkeby, & Kovan

create a .secrets.json file in the config directory of this project and insert the following with your Infura API key and mnemonic. Double check and make sure that file name is included in the .gitignore file list. Never commit and push your mnemonics!

{     "rinkeby": {         "host": "https://rinkeby.infura.io/<APIKEY>",         "mnemonic": "<MNEMONIC>"     } } 

Contract Verification

The final step for the Rinkeby / MainNet deployment is the contract verification.

This can be dome on Etherscan or Rinkeby Etherscan.

  • Click on the Contract Creation link in the to column
  • Click on the Contract Code link

Fill in the following data.

Contract Address:       <CONTRACT_ADDRESS> Contract Name:          <CONTRACT_NAME> Compiler:               v0.5.10+commit.5a6ea5b1 Optimization:           YES Solidity Contract Code: <Copy & Paste from ./build/bundle/flattened_MADANA.sol> Constructor Arguments:  <ABI from deployment output> 

Visit Solc version number page for determining the correct version number for your project.

  • Confirm you are not a robot
  • Hit verify and publish button

Now your smart contract is verified.

fix: updated .gitattributes


MADANA PAX代币合约

规范

角色

部署说明

工具链更新:

Linter

需求

为此项目使用正确的NodeJS版本

设置

编译、迁移,测试和覆盖率;Kovan

合同验证

  • 初始余额:业主账户持有的1亿MDN代币
  • 代币标准:ERC-20
  • ERC20详细名称:MADANA PAX符号:MDN小数:18所有者只能通过调用burn函数从其自己的帐户中烧掉代币注:代币持有者不能烧掉他们的代币
  • 所有者只能通过调用burn函数从自己的账户中烧掉代币来减少供应量注:代币持有者不能燃烧他们的代币
  • 可回收允许通过调用reclaimToken函数来恢复意外发送到智能合约的任何ERC20令牌。恢复的令牌将被发送到所有者帐户。然后,所有者可以将这些令牌发送到请求它们的帐户。此功能仅对所有者帐户可用
  • 允许通过调用reclaimToken函数来恢复意外发送到智能合约的任何ERC20令牌。恢复的令牌将被发送到所有者帐户。然后,所有者可以将这些令牌发送到请求它们的帐户。此功能仅适用于所有者帐户
  • ERC20MultiTransfer代币持有人可以使用multiTransfer功能将其代币一次分配给多个帐户
  • 代币持有人可以使用多重转账功能将其代币一次分配给多个帐户角色可以减少总供应量可以回收意外发送到MDN令牌智能合约的ERC20令牌注意:所有者可以根据需要将所有权转移到其他帐户
  • 可以减少总供应量
  • 可以回收意外发送到MDN令牌智能合约的ERC20令牌注意:所有者可以转移如果需要,将所有权分配给其他帐户
  • 部署MADANA contract record contract address
  • 记录合同地址
  • 替换/nodeu modules/solidity parser sc/build的内容/解析器.js代码由@maxsam4在https://raw.githubusercontent.com/maxsam4/solidity-parser/solidity-0.5/build/parser.js。
  • 这段代码也可以在“工具”中找到/解析器.js以防在线源更新或不可用。
  • 仅Python2.7版本!Windows用户应该在安装过程中勾选标记,将python放入路径中。windows构建工具包含python,因此您不必手动安装它。
  • GIT应该已经安装在*nix系统上。Windows用户必须手动安装GIT。
  • 在Windows系统上,PowerShell是必需的
  • 在Windows系统上,需要Windows构建工具(已通过包.json)
  • make(在Ubuntu上,这是通常安装的sudo apt get install build essential的一部分)
  • 在OSX上,XCode中包含的构建工具是必需的
  • 单击“收件人”列中的“合同创建”链接
  • 单击“合同代码”链接
  • 确认您不是机器人
  • 点击“验证和发布”按钮
  • 规范

    • 初始余额:业主账户持有的1亿MDN代币
    • 代币标准:ERC-20
    • ERC20详细名称:MADANA PAX符号:MDN小数:18所有者只能通过调用burn函数从其自己的帐户中烧掉代币注:代币持有者不能烧掉他们的代币
    • ERC20MultiTransfer代币持有人可以使用multiTransfer功能将其代币一次分配给多个帐户
    • 可以减少总供应量
    • 部署MADANA contract record contract address

    角色

    • 替换/nodeu modules/solidity parser sc/build的内容/解析器.js代码由@maxsam4在https://raw.githubusercontent.com/maxsam4/solidity-parser/solidity-0.5/build/parser.js。

    部署说明

    • GIT应该已经安装在*nix系统上。Windows用户必须手动安装GIT。

    工具链更新:

    运行coverage命令时,solidity coverage包并不完全支持solidty v5.0+的所有syntex。无法正确解析calldata、Payment等关键字。在等待solidity coverage包更新时,此问题的解决方法是:

    1. 在Windows系统上,需要Windows构建工具(已通过包.json)
    2. make(在Ubuntu上,这是通常安装的sudo apt get install build essential的一部分)

    Linter

    请使用此solidity VSCode插件,以确保您的合同遵循solidity样式和安全指南。纱线测试只在没有检测到短绒问题的情况下运行!

    所有安全规则均应按照ConsenSys智能合约指南执行。

    所有样式指南规则都应根据Solidity样式指南执行。

    有关更多信息,请查看Solhint文档。

    需求

    服务器端脚本需要NodeJS 8才能正常工作。转到NVM并按照安装说明进行操作。

    为此项目使用正确的NodeJS版本

    在安装任何依赖项(yarn install)之前,请确保您使用的是正确的节点版本。

    nvm install nvm use 

    NVM同时支持Linux和OS X,但这并不是说Windows用户必须错过。第二个项目名为nvmwindows,它为windows用户提供了轻松管理节点环境的可能性。

    nvmrc对windows用户的支持没有提供,请确保您为这个项目使用了正确的节点版本(如.nvmrc中定义的那样)!

    纱线必须在全球范围内安装,以将依赖性问题的风险降至最低。进入Yarn并为您的系统选择正确的安装程序。

    对于Rinkeby和MainNet部署,您需要在您的机器上安装Geth。按照操作系统的安装说明进行操作。

    根据您的系统,以下组件可能已经可用或必须手动提供:

    • 在OSX上,XCode中包含的构建工具是必需的
    • 单击“收件人”列中的“合同创建”链接
    • 单击“合同代码”链接
    • 确认您不是机器人
    • 点击“验证和发布”按钮
    • On OSX the build tools included in XCode are required

    每个命令都必须从projects基本目录中执行!

    设置

    打开终端并切换到project base目录。从这里,安装所有需要的依赖项。

    yarn install 

    这将在目录节点u模块中安装所有必需的依赖项。

    编译、迁移,测试和覆盖率;Kovan

    要编译、部署和测试智能合约,请进入projects根目录并相应地使用task runner。

    # Compile contract yarn compile  # Migrate contract yarn migrate  # Test the contract yarn test  # Run coverage tests yarn coverage 

    合同验证

    创建一个。机密.json在这个项目的config目录中,插入以下带有infuraapi密钥和助记符的代码。仔细检查并确保文件名包含在.gitignore文件列表中。永远不要承诺和推动你的记忆!

    {     "rinkeby": {         "host": "https://rinkeby.infura.io/<APIKEY>",         "mnemonic": "<MNEMONIC>"     } } 

    Contract Verification

    Rinkeby/MainNet部署的最后一步是合同验证。

    这可以是Etherscan上的dome或Rinkeby Etherscan。

    • Click on the Contract Creation link in the to column
    • Click on the Contract Code link

    填写以下数据。

    Contract Address:       <CONTRACT_ADDRESS> Contract Name:          <CONTRACT_NAME> Compiler:               v0.5.10+commit.5a6ea5b1 Optimization:           YES Solidity Contract Code: <Copy & Paste from ./build/bundle/flattened_MADANA.sol> Constructor Arguments:  <ABI from deployment output> 

    请访问Solc版本号页面,以确定项目的正确版本号。

    • Confirm you are not a robot
    • Hit verify and publish button

    现在您的智能合约已验证。

    fix: updated .gitattributes

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

    www.interchains.cc

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

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

    提供最优质的资源集合

    立即查看 了解详情