Skip to content

Commit

Permalink
deploy with libs #46
Browse files Browse the repository at this point in the history
  • Loading branch information
SK0M0R0H authored and NickVolynkin committed Aug 11, 2023
1 parent bfc2f80 commit 4d93c7c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion deploy/contracts/gate/gate0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//---------------------------------------------------------------------------//
pragma solidity >=0.8.4;

import "../../../contracts/types.sol";
import "@nilfoundation/evm-placeholder-verification/contracts/types.sol";
import "./gate_argument.sol";

library template_gate0{
Expand Down
2 changes: 1 addition & 1 deletion deploy/contracts/gate/gate15.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//---------------------------------------------------------------------------//
pragma solidity >=0.8.4;

import "../../../contracts/types.sol";
import "@nilfoundation/evm-placeholder-verification/contracts/types.sol";
import "./gate_argument.sol";

library template_gate15{
Expand Down
8 changes: 4 additions & 4 deletions deploy/contracts/gate/gate_argument.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
//---------------------------------------------------------------------------//
pragma solidity >=0.8.4;

import "../../../contracts/types.sol";
import "../../../contracts/basic_marshalling.sol";
import "../../../contracts/commitments/batched_lpc_verifier.sol";
import "../../../contracts/interfaces/gate_argument.sol";
import "@nilfoundation/evm-placeholder-verification/contracts/types.sol";
import "@nilfoundation/evm-placeholder-verification/contracts/basic_marshalling.sol";
import "@nilfoundation/evm-placeholder-verification/contracts/commitments/batched_lpc_verifier.sol";
import "@nilfoundation/evm-placeholder-verification/contracts/interfaces/gate_argument.sol";

import "./gate0.sol";
import "./gate15.sol";
Expand Down
26 changes: 13 additions & 13 deletions deploy/tasks/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {task} from 'hardhat/config'
const hre = require('hardhat')
// import {hre} from 'hardhat'
import * as fs from 'fs';

task("deploy")
.setAction(async (taskArgs, {ethers, run}) => {

const {deployments, getNamedAccounts} = hre;
const {deploy} = deployments;
// const {deployments, getNamedAccounts} = hre;
// const {deploy} = deployments;

// https://sepolia.etherscan.io/address/0x489dbc0762b3d9bd9843db11eecd2a177d84ba2b
const sepoliaPlaceholderVerifierAddress = '0x489Dbc0762b3D9Bd9843Db11EECd2A177D84ba2b';
Expand All @@ -20,19 +20,19 @@ task("deploy")

let deployedLib = {}
for (let lib of libs) {
await deploy(lib, {
log: true,
});
deployedLib[lib] = (await hre.deployments.get(lib)).address
const libFactory = await ethers.getContractFactory(lib);
const libContract = await libFactory.deploy();
await libContract.deployed();
deployedLib[lib] = libContract.address
}

const gateArgument = await deploy('template_gate_argument_split_gen', {
libraries: deployedLib,
log: true,
});
// const gateArgument = await deploy('template_gate_argument_split_gen', {
// libraries: deployedLib,
// log: true,
// });

// const GateArgument = await ethers.getContractFactory("template_gate_argument_split_gen");
// const gateArgument = await GateArgument.deploy();
const GateArgument = await ethers.getContractFactory("template_gate_argument_split_gen", { libraries: deployedLib});
const gateArgument = await GateArgument.deploy();
await gateArgument.deployed();
console.log("GateArgument at: ", gateArgument.address)

Expand Down

0 comments on commit 4d93c7c

Please sign in to comment.