Created
October 27, 2020 14:27
-
-
Save gitpusha/11fd6cfd3b83360f66e2a2d01c01964a to your computer and use it in GitHub Desktop.
a small script to showcase a buidler-ganache invalid opcode bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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