Skip to content

Instantly share code, notes, and snippets.

@gitpusha
Created October 27, 2020 14:32
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/a6032809024830babefe7ca288e51157 to your computer and use it in GitHub Desktop.
Save gitpusha/a6032809024830babefe7ca288e51157 to your computer and use it in GitHub Desktop.
Where buidler-ganache has an invalid opcode bug for gelatoCore.unstakeExecutor(), hardhat has none
// running `npx hardhat run` automatically makes use of buidler-waffle plugin
const hre = require("hardhat");
const { ethers } = hre;
const GelatoCoreLib = require("@gelatonetwork/core");
const { sleep } = GelatoCoreLib;
(async function main() {
if (hre.network.name !== "hardhat") {
console.error("Test Suite is meant to be run on hardhat only");
process.exit(1);
}
// ===== GELATO LOCAL SETUP ==================
const gelatoCore = await ethers.getContractAt(
GelatoCoreLib.GelatoCore.abi,
hre.network.config.GelatoCore
);
// DEBUG: buidler-ganache INVALID OPCODE bug
// NO BUG on hardhat
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