New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

abi-to-yargs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abi-to-yargs

Read a JSON ABI definition and turn it into sensible yargs commands with options.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Add hearty bash commands to contracts what be stowed in ye's truffle project:

truffle-contract USDC.balanceOf \
  --at 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 \
  --address 0xdfcb116732ebc9ae2c8939b053363bcf48a37a99 \
  --network mainnet

CLI Standalone

npm install -g truffle-yargs
truffle-contract --dir path-to-your/truffle-project

Install

npm install --save truffle-yargs

Quick Usage

Roll your own CLI within your own truffle project.

For example, create a cli.js with your truffle project:

#!/usr/bin/env node

const path = require('path');
const yargs = require('yargs');
const truffleYargs = require('truffle-yargs')(yargs);

// by default, this will scan truffle default contracts location
truffleYargs()
  .demandCommand(1, 'Specify at least one command to run.')
  .strict()
  .help()
  .argv;

Options

provider (optional)

Manually configure a Web3 provider instead of detecting from truffle config

const customProvider = new Web3.providers.HttpProvider('http://localhost:8545');
truffleYargs({
  provider: customProvider
});

contracts (optional)

String glob pattern of contracts

truffleYargs({
  contracts: './custom-build-path/**/*.json'
});

Array of contracts

truffleYargs({
  contracts: [
    Token,
    OtherContract,
    SafeMath,
  ]
});

Object hash map of contracts

truffleYargs({
  contracts: {
    Token,    
    OtherContract,
    SafeMath,
  }
});

TODO

  • Detect deployed address from JSON using truffle config network ID
  • Document overrides of commands and options

Credits

  • Hook by Alena Artemova from the Noun Project
  • Eye Patch by Javier Sánchez from the Noun Project
  • Bone by TS Graphics from the Noun Project
  • Pirate Hat by Nakesha Upshaw from the Noun Project

Keywords

FAQs

Package last updated on 22 Oct 2019

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