abi-to-sol – abi至sol区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,abi-to-sol – abi至sol区块链毕设代写 是一篇很好的国外资料

abi-to-sol

abi-to-sol - abi至sol abi-to-sol - abi至sol

Generate Solidity interface source from a given ABI JSON!

Installation

No need to install – just use npx (e.g. npx abi-to-sol).

Alternatively, install globally via:

$ npm install -g abi-to-sol

Usage

Pipe ABI JSON to stdin, get Solidity on stdout.

abi-to-sol [--solidity-version=<solidityVersion>] [--license=<license>] [--validate] [<name>] abi-to-sol -h | --help abi-to-sol --version

Options:

<name>   Name of generated interface. Default: MyInterface  --validate   Validate JSON before starting  -V --solidity-version   Version of Solidity (for pragma). Default: >=0.5.0 <0.8.0  -L --license   SPDX license identifier. default: UNLICENSED  -h --help     Show this screen. --version     Show version.

Example

Run the following command:

$ echo '[{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"resolver","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"label","type":"bytes32"},{"name":"owner","type":"address"}],"name":"setSubnodeOwner","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"ttl","type":"uint64"}],"name":"setTTL","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"ttl","outputs":[{"name":"","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"owner","type":"address"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":true,"name":"label","type":"bytes32"},{"indexed":false,"name":"owner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"resolver","type":"address"}],"name":"NewResolver","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"ttl","type":"uint64"}],"name":"NewTTL","type":"event"}]'    | npx abi-to-sol ENS

Get this output:

// SPDX-License-Identifier: UNLICENSED // !! THIS FILE WAS AUTOGENERATED BY abi-to-sol. SEE BELOW FOR SOURCE. !! pragma solidity ^0.7.0; pragma experimental ABIEncoderV2;  interface ENS {   function resolver(bytes32 node) external view returns (address);    function owner(bytes32 node) external view returns (address);    function setSubnodeOwner(     bytes32 node,     bytes32 label,     address owner   ) external;    function setTTL(bytes32 node, uint64 ttl) external;    function ttl(bytes32 node) external view returns (uint64);    function setResolver(bytes32 node, address resolver) external;    function setOwner(bytes32 node, address owner) external;    event Transfer(bytes32 indexed node, address owner);   event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);   event NewResolver(bytes32 indexed node, address resolver);   event NewTTL(bytes32 indexed node, uint64 ttl); }  // THIS FILE WAS AUTOGENERATED FROM THE FOLLOWING ABI JSON: /* ... */ 

Currently unsupported (PRs welcome! 😉)

  • Detect internalType for enums and emit stub declaration.
  • Detect internalType for function pointers (parameter type function) and emit parameter.
  • Omit pragma experimental ABIEncoderV2; when it’s not necessary

Merge pull request


abi-to-sol

abi-to-sol - abi至sol abi-to-sol - abi至sol

Generate Solidity interface source from a given ABI JSON!

Installation

No need to install – just use npx (e.g. npx abi-to-sol).

Alternatively, install globally via:

$ npm install -g abi-to-sol

Usage

Pipe ABI JSON to stdin, get Solidity on stdout.

abi-to-sol [--solidity-version=<solidityVersion>] [--license=<license>] [--validate] [<name>] abi-to-sol -h | --help abi-to-sol --version

Options:

<name>   Name of generated interface. Default: MyInterface  --validate   Validate JSON before starting  -V --solidity-version   Version of Solidity (for pragma). Default: >=0.5.0 <0.8.0  -L --license   SPDX license identifier. default: UNLICENSED  -h --help     Show this screen. --version     Show version.

Example

Run the following command:

$ echo '[{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"resolver","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"label","type":"bytes32"},{"name":"owner","type":"address"}],"name":"setSubnodeOwner","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"ttl","type":"uint64"}],"name":"setTTL","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"ttl","outputs":[{"name":"","type":"uint64"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"owner","type":"address"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":true,"name":"label","type":"bytes32"},{"indexed":false,"name":"owner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"resolver","type":"address"}],"name":"NewResolver","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"ttl","type":"uint64"}],"name":"NewTTL","type":"event"}]'    | npx abi-to-sol ENS

Get this output:

// SPDX-License-Identifier: UNLICENSED // !! THIS FILE WAS AUTOGENERATED BY abi-to-sol. SEE BELOW FOR SOURCE. !! pragma solidity ^0.7.0; pragma experimental ABIEncoderV2;  interface ENS {   function resolver(bytes32 node) external view returns (address);    function owner(bytes32 node) external view returns (address);    function setSubnodeOwner(     bytes32 node,     bytes32 label,     address owner   ) external;    function setTTL(bytes32 node, uint64 ttl) external;    function ttl(bytes32 node) external view returns (uint64);    function setResolver(bytes32 node, address resolver) external;    function setOwner(bytes32 node, address owner) external;    event Transfer(bytes32 indexed node, address owner);   event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);   event NewResolver(bytes32 indexed node, address resolver);   event NewTTL(bytes32 indexed node, uint64 ttl); }  // THIS FILE WAS AUTOGENERATED FROM THE FOLLOWING ABI JSON: /* ... */ 

Currently unsupported (PRs welcome! 😉)

  • Detect internalType for enums and emit stub declaration.
  • Detect internalType for function pointers (parameter type function) and emit parameter.
  • Omit pragma experimental ABIEncoderV2; when it’s not necessary

Merge pull request

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情