{"id":15538832,"url":"https://github.com/xgodmode/godmode","last_synced_at":"2025-07-13T23:04:17.670Z","repository":{"id":40387961,"uuid":"264094541","full_name":"xGodMode/godmode","owner":"xGodMode","description":"Use GodMode to get full control of any Ethereum contract or account","archived":false,"fork":false,"pushed_at":"2024-03-25T22:06:28.000Z","size":2851,"stargazers_count":42,"open_issues_count":7,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-13T23:02:22.754Z","etag":null,"topics":["ethereum","godmode","smart-contracts","truffle"],"latest_commit_sha":null,"homepage":"http://godmode.work","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xGodMode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-15T04:21:38.000Z","updated_at":"2024-11-25T01:56:38.000Z","dependencies_parsed_at":"2024-10-22T18:25:58.001Z","dependency_job_id":null,"html_url":"https://github.com/xGodMode/godmode","commit_stats":{"total_commits":137,"total_committers":6,"mean_commits":"22.833333333333332","dds":"0.14598540145985406","last_synced_commit":"4705e40799a8910c315b2a580fcd3ce48b74287a"},"previous_names":["martinetlee/godmode-in-testnet"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/xGodMode/godmode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xGodMode%2Fgodmode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xGodMode%2Fgodmode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xGodMode%2Fgodmode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xGodMode%2Fgodmode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xGodMode","download_url":"https://codeload.github.com/xGodMode/godmode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xGodMode%2Fgodmode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265218738,"owners_count":23729527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","godmode","smart-contracts","truffle"],"created_at":"2024-10-02T12:06:51.468Z","updated_at":"2025-07-13T23:04:17.611Z","avatar_url":"https://github.com/xGodMode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GodMode Logo](https://godmode-public-assets.s3.amazonaws.com/godmode_logo.jpg)\n\n# GodMode (Core)\n\nGodMode 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.\n\nThis library provides a truffle framework friendly API and lets you install pre-compiled GodMode contracts for popular protocols such as MakerDao, Uniswap, and Compound.\n\n[Join our Discord](https://discord.gg/UPpgH2w) to learn more.\n\n## Installation\n\n```sh\nnpm install --save-dev @xgm/godmode\n```\n\nWhen using this library, you need to run GodMode Ganache CLI as well.\n\n-   [GODMODE Ganache-cli](https://github.com/xGodMode/godmode-ganache-cli)\n-   See also: [GODMODE Ganache-core](https://github.com/xGodMode/godmode-ganache-core)\n\n## Usage\n\n### Getting started\n\nTo see a sample project that uses this library, see this repo:\n\n-   [GODMODE Sample Project](https://github.com/xGodMode/godmode-sample-project)\n\n### Setting it up in the test environment\n\nIn your javascript test file, import the library\n\n```js\nconst { GM } = require('@xgm/godmode');\n```\n\nInitialize 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.\n\n```js\nconst provider = 'ws://localhost:8545'; // from godmode-ganache-cli\nlet GODMODE = new GM('dev', provider);\n```\n\n### General interactions\n\n```js\nawait GODMODE.execute(\n  targetContract.address, // Address of the deployed contract\n  gmContract.abi, // ABI of the GM version of the contract\n  gmContract.deployedBytecode, // Runtime bytecode of the GM contract\n  \"methodName\", // Method to call in GM contract\n  {\n    args: [...], // List of method arguments. Order matters!\n    from: txSender // Ethereum address of msg.sender\n  }\n);\n```\n\n### Install pre-compiled protocol contracts\n\n**IMPORTANT: this only works on mainnet fork**\n\nWhen 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.\n\n-   Install all GM protocols\n\n```sh\nnpx godmode install --all\n```\n\n-   Install protocols from command line\n\n```sh\nnpx godmode install --protocols Maker Compound UniswapV2\n```\n\n-   Install protocols from package.json\n\n```json\n\"godmode\": {\n  \"protocols\": [\n    \"Maker\",\n    \"Compound\",\n    \"UniswapV2\"\n  ]\n}\n```\n\n```sh\nnpx godmode install\n```\n\n#### MakerDao\n\n-   Mint DAI to an address: `await GODMODE.Maker.mintDai(Alex, 10000);`\n\n#### Uniswap\n\n-   Enable Fee collection in UniswapV2: `await GODMODE.UniswapV2.Factory_setFeeTo(Beth);`\n\n#### Compound\n\n-   Give the address cTokens: `await GODMODE.Compound.mintCErc20(\"0x6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e\", Carl, 100); `\n\n## Testing\n\nTests are written in [mocha](https://mochajs.org/).\n\n```sh\nnpm run test\n```\n\n## Contributing\n\nFork this repo and create a descriptive PR.\n\n## Releases\n\nGodMode is in **alpha** so releases may be frequent.\nCore devs should create releases after merging in new features by running\n\n`npm run dist \u0026\u0026 npm run release`\n\nThis will ask you for the release version, then automatically create a release and publish it to npm.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxgodmode%2Fgodmode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxgodmode%2Fgodmode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxgodmode%2Fgodmode/lists"}