Skip to content

Commit

Permalink
update lib imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sragss committed Feb 1, 2023
1 parent 5d7176a commit 9d08d38
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion zkdrops-contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
typechain
artifacts
cache
local
local
typechain-types
2 changes: 1 addition & 1 deletion zkdrops-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "ts-mocha"
"test": "npx hardhat test"
},
"author": "sragss",
"license": "ISC",
Expand Down
4 changes: 2 additions & 2 deletions zkdrops-contracts/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ethers, waffle } from "hardhat";
import { abi as ERC20_ABI, bytecode as ERC20_BYTECODE } from "@openzeppelin/contracts/build/contracts/ERC20PresetFixedSupply.json";
import { BigNumber } from "@ethersproject/bignumber";
import { PrivateAirdrop } from "../typechain";
import { PrivateAirdrop } from "../typechain-types";
import { readMerkleTreeAndSourceFromFile } from "../utils/TestUtils";
import { toHex } from "zkp-merkle-airdrop-lib";
import { toHex } from "zkdrops-lib";


/**
Expand Down
2 changes: 1 addition & 1 deletion zkdrops-contracts/test/MerkleTreeTest.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from "chai"
import { MerkleTree } from "zkp-merkle-airdrop-lib";
import { MerkleTree } from "zkdrops-lib";
import { generateMerkleTreeAndKeys } from "../utils/TestUtils";

describe("MerkleTree", () => {
Expand Down
8 changes: 4 additions & 4 deletions zkdrops-contracts/test/PrivateAirdropIntegration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect } from "chai";
import { ethers, waffle } from "hardhat";
import { PlonkVerifier, PrivateAirdrop } from "../typechain"
import { PlonkVerifier, PlonkVerifier__factory, PrivateAirdrop, PrivateAirdrop__factory } from "../typechain-types"
import { abi as ERC20_ABI, bytecode as ERC20_BYTECODE } from "@openzeppelin/contracts/build/contracts/ERC20PresetFixedSupply.json";
import { Contract } from "@ethersproject/contracts";
import { Signer } from "@ethersproject/abstract-signer";
import { BigNumber } from "@ethersproject/bignumber";
import { readFileSync } from "fs";
import { MerkleTree, generateProofCallData, pedersenHashConcat, pedersenHash, toHex } from "zkp-merkle-airdrop-lib";
import { MerkleTree, generateProofCallData, pedersenHashConcat, pedersenHash, toHex } from "zkdrops-lib";
import { randomBigInt, readMerkleTreeAndSourceFromFile } from "../utils/TestUtils";

// Test constants
Expand Down Expand Up @@ -204,10 +204,10 @@ async function deployContracts(
BigNumber.from(ERC20_SUPPLY),
erc20SupplyHolder
])
let plonkFactory = await ethers.getContractFactory("PlonkVerifier", ownerSigner)
let plonkFactory = new PlonkVerifier__factory(ownerSigner)
let verifier = await plonkFactory.deploy()

let airdropFactory = await ethers.getContractFactory("PrivateAirdrop", ownerSigner)
let airdropFactory = new PrivateAirdrop__factory(ownerSigner)
let airdrop: PrivateAirdrop = (
await airdropFactory.deploy(
erc20.address,
Expand Down
2 changes: 1 addition & 1 deletion zkdrops-contracts/utils/TestUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as crypto from "crypto";
import { readFileSync, writeFileSync } from 'fs';

import { MerkleTree, pedersenHashConcat, toHex } from 'zkp-merkle-airdrop-lib';
import { MerkleTree, pedersenHashConcat, toHex } from 'zkdrops-lib';

/** MerkleTree and inputs used to derive. */
export interface MerkleTreeAndSource {
Expand Down

0 comments on commit 9d08d38

Please sign in to comment.