All Projects → justinjmoses → eth-reveal

justinjmoses / eth-reveal

Licence: MIT license
Dig into Ethereum transactions and reveal their secrets; kinda like having Etherscan in your code.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to eth-reveal

online-ethereum-abi-encoder-decoder
A quick online tool to abi-encode and abi-decode constructor arguments used in ethereum's solidity. https://adibas03.github.io/online-ethereum-abi-encoder-decoder/
Stars: ✭ 37 (-40.32%)
Mutual labels:  abi, etherscan
hardhat-abi-exporter
🧰 Export Solidity contract ABIs on compilation ⚙️
Stars: ✭ 29 (-53.23%)
Mutual labels:  abi
TypeChain
🔌 TypeScript bindings for Ethereum smart contracts
Stars: ✭ 1,881 (+2933.87%)
Mutual labels:  abi
eth-sdk
Type-safe, lightweight SDKs for Ethereum smart contracts
Stars: ✭ 283 (+356.45%)
Mutual labels:  abi
lambda-libs
DEPRECATED: remove EVM from lambda chain
Stars: ✭ 20 (-67.74%)
Mutual labels:  abi
eth.rb
a straightforward library to build, sign, and broadcast ethereum transactions anywhere you can run ruby.
Stars: ✭ 111 (+79.03%)
Mutual labels:  abi
hardhat-contract-sizer
Output Ethereum contract sizes with Hardhat 📐
Stars: ✭ 55 (-11.29%)
Mutual labels:  abi
splunk-connect-for-ethereum
Splunk Connect for Ethereum
Stars: ✭ 50 (-19.35%)
Mutual labels:  abi
abi-to-sol
Generate Solidity interface from ABI JSON
Stars: ✭ 213 (+243.55%)
Mutual labels:  abi
abireport
Tool to create ABI reports from ELF binaries in packaging
Stars: ✭ 16 (-74.19%)
Mutual labels:  abi
ethjs-contract
A simple contract object for the Ethereum RPC layer.
Stars: ✭ 21 (-66.13%)
Mutual labels:  abi
abi-code-gen
Generic code generator from abi
Stars: ✭ 21 (-66.13%)
Mutual labels:  abi
etherscan-api
🎸 Golang client for Ethereum Etherscan API (and its families like BscScan) / Golang 以太坊 Etherscan API库(也支持同一家族的BscScan)
Stars: ✭ 126 (+103.23%)
Mutual labels:  etherscan
etherscan-python
A minimal, yet complete, python API for Etherscan.io.
Stars: ✭ 335 (+440.32%)
Mutual labels:  etherscan
sol-verifier
Verify Solidity smart contracts on Etherscan
Stars: ✭ 22 (-64.52%)
Mutual labels:  etherscan
ETH-transactions-storage
Indexer for Ethereum to get transaction list by ETH address
Stars: ✭ 155 (+150%)
Mutual labels:  ethereum-transactions
send-tx
🤝 Sign & send Ethereum transactions
Stars: ✭ 14 (-77.42%)
Mutual labels:  ethereum-transactions

Eth-Reveal

CircleCI npm version

Dive into Ethereum transactions from the CLI or via a module.

Use it live in Codepen: https://codepen.io/justinjmoses/full/vwexLj

Features

  • Decodes method calls, function parameters and logs (with formatted dates and numbers) using ABI from Etherscan (if any)
  • Looks for target of contract if any (i.e. a Proxy) and adds that ABI as well
  • Shows errors and revert reasons

Note: due to storage limitations of popular Ethereum providers, you won't get revert reasons for most transactions more than 128 blocks in the past unless you use an Infura archive node (see https://infura.io/docs/ethereum/add-ons/archiveData)

Browser API

<script src="//cdn.jsdelivr.net/npm/eth-reveal/browser.js"></script>
<script>
	// assumes browser supports modern JS (can use Babel preprocesser for this, see settings in Codepen linked above)
	(async () => {
		const { reveal } = window;
		const {
			hash,
			blockNumber,
			timestamp,
			to,
			from,
			isContract,
			contract,
			underlyingContract,
			method,
			decodedLogs,
			gasPrice,
			gasLimit,
			gasUsed,
			gasFormat, // handy format of gas price, limit and used params
			status,
			errorMessage,
			revertReason,
			value,
			nonce,
		} = await reveal({
			hash: '0x92031f1cafad71bdfaa2d326b222972df2c2dcdc2931b5e8c1a32bda2dc7b2c8',
			network: 'mainnet', // default (supports kovan, ropsten and rinkeby)
			etherscanKey: 'demo', // optionally for better ES performance
			// to access historical data such as previous proxy targets and revert reasons, either supply a provider URI
			providerURI: undefined,
			infuraProjectID: '123321', // or optionally an infura project ID for an archive node
		});
	})();
</script>

Node API

const reveal = require('eth-reveal');

(async () => {
	const {
		hash,
		blockNumber,
		timestamp,
		to,
		from,
		isContract,
		contract,
		underlyingContract,
		method,
		decodedLogs,
		gasPrice,
		gasLimit,
		gasUsed,
		gasFormat, // handy format of gas price, limit and used params
		status,
		errorMessage,
		revertReason,
		value,
		nonce,
	} = await reveal({
		hash: '0x92031f1cafad71bdfaa2d326b222972df2c2dcdc2931b5e8c1a32bda2dc7b2c8',
		network: 'mainnet', // default (supports kovan, ropsten and rinkeby)
		etherscanKey: process.env.ETHERSCAN_API_KEY, // optionally for better ES performance
		// to access historical data such as previous proxy targets and revert reasons, either supply a provider URI
		providerURI: undefined,
		infuraProjectID: '123321', // or optionally an infura project ID for an archive node
	});
})();

CLI Usage:

npx eth-reveal -h [hash]

e.g. npx eth-reveal -h 0x203d9f5ec035ddaa02fc3a61b113bcfc6a8c0ee965fed7508e3627fc39f1a18f (SynthetixFeePool.claimFees)

image

e.g. npx eth-reveal -h 0xa9cfa1dc823f35e230ba1b785f359df0fa3056fe6b3689516216f3c6fc7599ac (Send ETH to NEPay)

image

e.g. npx eth-reveal -h 0x7f370b9f6647762d1a04f55b6a34195da98b749da01bed58d600c87658cf7b90

image (DMSCOIN.transfer)

e.g. npx eth-reveal -h 0x7a8d26e929dba1146cb3eb3ef5ed48883d2460a365f0e7bab2acecbbbdf47f05 (Synthetix.burnSynths)

image

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].