Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

abidoc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abidoc


Version published
Maintainers
1
Created
Source

Application Binary Inteface (ABI) Documentation Generator For Ethereum & Co.

abidoc - application binary interface (abi) documentation generator for Ethereum & Co. (blockchain) contracts

  • home :: github.com/rubycocos/blockchain
  • bugs :: github.com/rubycocos/blockchain/issues
  • gem :: rubygems.org/gems/abidoc
  • rdoc :: rubydoc.info/gems/abidoc

Usage

Let's try to generate the contract abi docs for punks v1 (anno 2017):

require 'abidoc'

punks_v1    = '0x6ba6f2207e343923ba692e5cae646fb0f566db8d'

abi = ABI.read( "./abis/#{punks_v1}.json" )
buf = abi.generate_doc( title: 'Contract ABI for Punks V1' )
write_text( "./o/punks_v1.md", buf )

resulting in:


Contract ABI for Punks V1

Constructor

  • constructor()

1 Payable Function(s)

  • function buyPunk(uint256 punkIndex) payable

7 Transact Functions(s)

  • function reservePunksForOwner(uint256 maxForThisRun)
  • function withdraw()
  • function transferPunk(address to, uint256 punkIndex)
  • function offerPunkForSaleToAddress(uint256 punkIndex, uint256 minSalePriceInWei, address toAddress)
  • function offerPunkForSale(uint256 punkIndex, uint256 minSalePriceInWei)
  • function getPunk(uint256 punkIndex)
  • function punkNoLongerForSale(uint256 punkIndex)

14 Query Functions(s)

  • function name() ⇒ (string _) readonly
  • function punksOfferedForSale(uint256 _) ⇒ (bool isForSale, uint256 punkIndex, address seller, uint256 minValue, address onlySellTo) readonly
  • function totalSupply() ⇒ (uint256 _) readonly
  • function decimals() ⇒ (uint8 _) readonly
  • function imageHash() ⇒ (string _) readonly
  • function nextPunkIndexToAssign() ⇒ (uint256 _) readonly
  • function punkIndexToAddress(uint256 _) ⇒ (address _) readonly
  • function standard() ⇒ (string _) readonly
  • function balanceOf(address _) ⇒ (uint256 _) readonly
  • function symbol() ⇒ (string _) readonly
  • function numberOfPunksToReserve() ⇒ (uint256 _) readonly
  • function numberOfPunksReserved() ⇒ (uint256 _) readonly
  • function punksRemainingToAssign() ⇒ (uint256 _) readonly
  • function pendingWithdrawals(address _) ⇒ (uint256 _) readonly

Let's try to generate the contract abi docs for punk blocks (anno 2022):

punk_blocks = '0x58e90596c2065befd3060767736c829c18f3474c'

abi = ABI.read( "./address/#{punk_blocks}.json" )

buf =  abi.generate_doc( title: 'Contract ABI for Punk Blocks' )
write_text( "./punk_blocks.md", buf )

resulting in:


Contract ABI for Punk Blocks

Constructor

  • constructor()

1 Transact Functions(s)

  • function registerBlock(bytes _dataMale, bytes _dataFemale, uint8 _layer, string _name)

8 Query Functions(s)

  • function blocks(bytes32 _) ⇒ (uint8 layer, bytes dataMale, bytes dataFemale) readonly
  • function getBlocks(uint256 _fromID, uint256 _count) ⇒ (tuple[] _, uint256 _) readonly
  • function index(uint256 _) ⇒ (bytes32 _) readonly
  • function nextId() ⇒ (uint256 _) readonly
  • function svgFromIDs(uint256[] _ids) ⇒ (string _) readonly
  • function svgFromKeys(bytes32[] _attributeKeys) ⇒ (string _) readonly
  • function svgFromNames(string[] _attributeNames) ⇒ (string _) readonly
  • function svgFromPunkID(uint256 _tokenID) ⇒ (string _) readonly

and so on.

Bonus - Awesome Contracts

See the Awesome (Ethereum) Contracts / Blockchain Services @ Open Blockchains repo. that is a cache of (ethereum) contract ABIs (application binary interfaces) and open source code (if verified / available) with auto-generated docs via abidoc & friends.

License

The scripts are dedicated to the public domain. Use it as you please with no restrictions whatsoever.

Questions? Comments?

Post them on the D.I.Y. Punk (Pixel) Art reddit. Thanks.

FAQs

Package last updated on 09 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc