GithubHelp home page GithubHelp logo

eth-tools's Introduction

eth-tools

eth-tools is a set of smart contract utilities that can be easly composed with each other.

install all tools in one go

go install github.com/seblw/eth-tools/cmd/...@latest

contract-fetch

Usage: contract-fetch <addr> <outDir>

addr	- contract address (required)
outDir	- output directory (optional, default: ./lib/)

Flags:
  ETH_TOOLS_APIKEY (required)
  ETH_TOOLS_URL (optional, default: https://api.etherscan.io)

install

go install github.com/seblw/eth-tools/cmd/contract-fetch@latest

example

$ contract-fetch 0xB92336759618F55bd0F8313bd843604592E27bd8
lib/Replica/node_modules/@summa-tx/memview-sol/contracts/TypedMemView.sol
lib/Replica/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
lib/Replica/node_modules/@summa-tx/memview-sol/contracts/SafeMath.sol
lib/Replica/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
lib/Replica/node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
lib/Replica/packages/contracts-core/contracts/Replica.sol
lib/Replica/packages/contracts-core/contracts/NomadBase.sol
lib/Replica/packages/contracts-core/contracts/libs/Message.sol
lib/Replica/packages/contracts-core/contracts/libs/Merkle.sol
lib/Replica/node_modules/@openzeppelin/contracts-upgradeable/proxy/Initializable.sol
lib/Replica/packages/contracts-core/contracts/interfaces/IMessageRecipient.sol
lib/Replica/node_modules/@openzeppelin/contracts/cryptography/ECDSA.sol
lib/Replica/packages/contracts-core/contracts/Version0.sol
lib/Replica/packages/contracts-core/contracts/libs/TypeCasts.sol

contract-remappings

accepts list of files as standard input (stdin), prints foundry compatible dependency remappings for @-prefixed entries to standard output (stdout).

install

go install github.com/seblw/eth-tools/cmd/contract-remappings@latest

example

$ contract-fetch 0xB92336759618F55bd0F8313bd843604592E27bd8 | contract-remappings
@summa-tx=lib/Replica/node_modules/@summa-tx
@openzeppelin=lib/Replica/node_modules/@openzeppelin

contract-abi

prints contract's ABI with additional metadata in three first rows.

install

go install github.com/seblw/eth-tools/cmd/contract-abi@latest

example

$ contract-abi 0xB92336759618F55bd0F8313bd843604592E27bd8 | head -n 12
// ContractName: Replica
// CompilerVersion: v0.7.6+commit.7338295f
// LicenseType: 
[
  {
    "inputs": [
      {
        "internalType": "uint32",
        "name": "_localDomain",
        "type": "uint32"
      }
    ],

contract-interface

accepts contract ABI in JSON format as standard input (stdin), prints solidity interface representation to standard output (stdout).

install

go install github.com/seblw/eth-tools/cmd/contract-interface@latest

example

$ contract-abi 0xB92336759618F55bd0F8313bd843604592E27bd8 | contract-interface
constructor(uint32 _localDomain) public
event NewUpdater(address oldUpdater, address newUpdater)
function process(bytes _message) external nonpayable returns (bool _success)
function prove(bytes32 _leaf, bytes32[32] _proof, uint256 _index) external nonpayable returns (bool)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.