npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xgm/godmode

v0.1.6

Published

Test smart contracts in GodMode

Readme

GodMode Logo

GodMode (Core)

GodMode is a testing tool that allows you to easily modify the state of the Ethereum Virtual Machine. With the power of GodMode you can test the robustness of Ethereum protocols/smart contracts and run simulations.

This library provides a truffle framework friendly API and lets you install pre-compiled GodMode contracts for popular protocols such as MakerDao, Uniswap, and Compound.

Join our Discord to learn more.

Installation

npm install --save-dev @xgm/godmode

When using this library, you need to run GodMode Ganache CLI as well.

Usage

Getting started

To see a sample project that uses this library, see this repo:

Setting it up in the test environment

In your javascript test file, import the library

const { GM } = require('@xgm/godmode');

Initialize it with the GodMode Ganache endpoint (referenced above). The first argument indicates the network name -- use mainnet if you want to use pre-compiled contracts.

const provider = 'ws://localhost:8545'; // from godmode-ganache-cli
let GODMODE = new GM('dev', provider);

General interactions

await GODMODE.execute(
  targetContract.address, // Address of the deployed contract
  gmContract.abi, // ABI of the GM version of the contract
  gmContract.deployedBytecode, // Runtime bytecode of the GM contract
  "methodName", // Method to call in GM contract
  {
    args: [...], // List of method arguments. Order matters!
    from: txSender // Ethereum address of msg.sender
  }
);

Install pre-compiled protocol contracts

IMPORTANT: this only works on mainnet fork

When you install a protocol, all of the contracts for that protocol will be stored in your build/protocols directory. This is where godmode will look for them.

  • Install all GM protocols
npx godmode install --all
  • Install protocols from command line
npx godmode install --protocols Maker Compound UniswapV2
  • Install protocols from package.json
"godmode": {
  "protocols": [
    "Maker",
    "Compound",
    "UniswapV2"
  ]
}
npx godmode install

MakerDao

  • Mint DAI to an address: await GODMODE.Maker.mintDai(Alex, 10000);

Uniswap

  • Enable Fee collection in UniswapV2: await GODMODE.UniswapV2.Factory_setFeeTo(Beth);

Compound

  • Give the address cTokens: await GODMODE.Compound.mintCErc20("0x6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e", Carl, 100);

Testing

Tests are written in mocha.

npm run test

Contributing

Fork this repo and create a descriptive PR.

Releases

GodMode is in alpha so releases may be frequent. Core devs should create releases after merging in new features by running

npm run dist && npm run release

This will ask you for the release version, then automatically create a release and publish it to npm.