基于区块链的毕业设计📃 Provable pToken ERC777 Smart-Contract – 📃 可证pToken ERC777智能合约
本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计📃 Provable pToken ERC777 Smart-Contract – 📃 可证pToken ERC777智能合约 是一篇很好的国外资料
📃 Provable pToken ERC777 Smart-Contract
The ETH smart-contract for the Provable pToken! This repo also contains and a bytecode generator for easy bytecode creation with custom constructor arguments.
default operators
constructor argument for this ERC777 Token is provided as a single item array containing the zero ETH address by default.
👉 Usage
After installing dependencies with npm i
, run the tool via:
node ./bytecode-generator.js --token-name='pToken' --token-symbol='PTKN'
Output of the tool:
./example.sh 608060405...00000000
-
There exists an
example.sh
script in the./scripts/
directory you can run to see how the tool works. -
The tool will compile the smart-contract for you whether the artifact exists or not, so as to ensure it is compiled with the constructor arguments requested.
💂♂️ Smart-Contract Tests:
- Install dependencies:
❍ npm install
- Start truffle via:
❍ npx truffle develop
- Run the tests via:
❍ truffle_develop> test
Test output:
Contract: pToken/ERC777GSN ✓ Should transfer via relayer (639ms) ✓ When transferring via relay, it should pay fee in token (489ms) Contract: pToken/ERC777OptionalAckOnMint ✓ Should mint to an externally owned account (95ms) ✓ Should mint to a contract that does not support ERC1820 (165ms) ✓ Should mint to a contract that supports ERC1820, and call `tokensReceivedHook` (225ms) Contract: pToken/ERC777WithAdminOperator ✓ OWNER cannot change the admin operator (57ms) ✓ Admin operator can change the admin operator address (44ms) ✓ adminTransfer() should fail if the caller is not the admin operator (38ms) ✓ adminTransfer() should transfer tokens (65ms) Contract: pToken ✓ `redeem()` function should burn tokens & emit correct events (753ms) ✓ `operatorRedeem()` should burn tokens & emit correct events (727ms) ✓ `mint()` w/out data should mint tokens & emit correct events (77ms) ✓ `mint()` w/out data should return true if successful ✓ `mint()` cannot mint to zero address (60ms) ✓ 'mint()' only 0xc49b...2754 can mint (40ms) ✓ `mint()` w/ data should mint tokens & emit correct events (63ms) ✓ 0xc49b...2754 can change 'pNetwork' (53ms) ✓ Only 0xc49b...2754 can change 'pNetwork' (64ms) ✓ pNetwork cannot be the zero address (51ms) 19 passing (10s)
📋 To Do:
- Test additions to the standard open-zeppelin ERC777 contract.
- Bytecode generator.
- Enforce
0x0000...0000
default operator in bytecode generator.
📃 可证明pToken ERC777智能合约👉 用法💂♂️ 智能合约测试:
📋 待办事项:
可证明的pToken的ETH智能合约!这个repo还包含和一个字节码生成器,用于使用自定义构造函数参数轻松创建字节码。
📯 注意:在使用字节码生成器时,对于pToken的permissionless要求,默认情况下,此ERC777令牌的default operators构造函数参数作为包含零ETH地址的单项数组提供。
📋 待办事项:
用npm i安装依赖项后,通过:
node ./bytecode-generator.js --token-name='pToken' --token-symbol='PTKN'
运行工具的输出:
./example.sh 608060405...00000000
- 存在示例.sh可以运行./scripts/目录中的脚本来查看工具的工作方式。
- 无论工件是否存在,该工具都将为您编译智能合约,以确保使用请求的构造函数参数进行编译。
💂♂️ Smart-Contract Tests:
- 安装依赖项:
❍ npm install
- 启动块菌通过:
❍ npx truffle develop
- 运行测试通过:
❍ truffle_develop> test
测试输出:
Contract: pToken/ERC777GSN ✓ Should transfer via relayer (639ms) ✓ When transferring via relay, it should pay fee in token (489ms) Contract: pToken/ERC777OptionalAckOnMint ✓ Should mint to an externally owned account (95ms) ✓ Should mint to a contract that does not support ERC1820 (165ms) ✓ Should mint to a contract that supports ERC1820, and call `tokensReceivedHook` (225ms) Contract: pToken/ERC777WithAdminOperator ✓ OWNER cannot change the admin operator (57ms) ✓ Admin operator can change the admin operator address (44ms) ✓ adminTransfer() should fail if the caller is not the admin operator (38ms) ✓ adminTransfer() should transfer tokens (65ms) Contract: pToken ✓ `redeem()` function should burn tokens & emit correct events (753ms) ✓ `operatorRedeem()` should burn tokens & emit correct events (727ms) ✓ `mint()` w/out data should mint tokens & emit correct events (77ms) ✓ `mint()` w/out data should return true if successful ✓ `mint()` cannot mint to zero address (60ms) ✓ 'mint()' only 0xc49b...2754 can mint (40ms) ✓ `mint()` w/ data should mint tokens & emit correct events (63ms) ✓ 0xc49b...2754 can change 'pNetwork' (53ms) ✓ Only 0xc49b...2754 can change 'pNetwork' (64ms) ✓ pNetwork cannot be the zero address (51ms) 19 passing (10s)
📋 To Do:
- 测试添加到标准open zeppelin ERC777合同。
- 字节码生成器。
- 在字节码生成器中强制0x0000…0000默认运算符。你知道吗
部分转自网络,侵权联系删除区块链源码网
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计📃 Provable pToken ERC777 Smart-Contract – 📃 可证pToken ERC777智能合约