Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aodhgan
committed
Jul 12, 2021
1 parent
21cf937
commit e96b685
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const packageDotJson = require("../package.json") | ||
const hardhat = require("hardhat") | ||
const { ethers } = require("hardhat") | ||
|
||
function yellow() { | ||
console.log(chalk.yellow.call(chalk, ...arguments)) | ||
} | ||
|
||
async function run () { | ||
const packageVersion = packageDotJson.version | ||
yellow(`Checking NPM package version ${packageVersion} matches contract VERSION constant..`) | ||
|
||
const deployments = await deployments.all() | ||
|
||
// get PrizePool VERSION | ||
const prizePoolArtifact = await hardhat.artifacts.readArtifact("PrizePool") | ||
const prizePool = await ethers.getContractAt("PrizePool", deployments["CompoundPrizePool"]) | ||
const prizePoolVersion = await prizePool.VERSION() | ||
|
||
// get PrizeStrategy VERSION | ||
const prizeStrategy = await hardhat.ethers.getContract("PeriodicPrizeStrategy") | ||
const prizeStrategyVersion = await prizeStrategy.VERSION() | ||
|
||
// assert packgeVersion == prizePoolVersion == prizeStrategyVersion | ||
|
||
} | ||
run() |