Skip to content

Instantly share code, notes, and snippets.

@gitpusha
Created October 27, 2020 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitpusha/11fd6cfd3b83360f66e2a2d01c01964a to your computer and use it in GitHub Desktop.
Save gitpusha/11fd6cfd3b83360f66e2a2d01c01964a to your computer and use it in GitHub Desktop.
a small script to showcase a buidler-ganache invalid opcode bug
// running `npx buidler run` automatically makes use of buidler-waffle plugin
// => only dependency we need is "chai"
const bre = require("@nomiclabs/buidler");
const { ethers } = bre;
const GelatoCoreLib = require("@gelatonetwork/core");
const { sleep } = GelatoCoreLib;
(async function main() {
if (bre.network.name !== "ganache") {
console.error("Test Suite is meant to be run on ganache only");
process.exit(1);
}
// ===== GELATO LOCAL SETUP ==================
const gelatoCore = await ethers.getContractAt(
GelatoCoreLib.GelatoCore.abi,
bre.network.config.GelatoCore
);
// DEBUG: buidler-ganache INVALID OPCODE bug
await gelatoCore.stakeExecutor({ value: ethers.utils.parseEther("2") });
await gelatoCore.unstakeExecutor();
await sleep(20000);
// DEBUG END
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment