From 90da08062528406dcba739e95459a86787da5adc Mon Sep 17 00:00:00 2001 From: lordforever Date: Thu, 13 Jul 2023 04:59:57 +0530 Subject: [PATCH 1/3] internal library --- .solhint.json | 2 +- contracts/DealStatus.sol | 47 ++++++++++++++-------- contracts/data-segment/Cid.sol | 6 +-- contracts/data-segment/Const.sol | 2 +- contracts/data-segment/Proof.sol | 33 ++++++--------- contracts/data-segment/ProofTypes.sol | 2 +- contracts/interfaces/IAggregatorOracle.sol | 11 +++-- hardhat.config.js | 14 +++---- 8 files changed, 64 insertions(+), 53 deletions(-) diff --git a/.solhint.json b/.solhint.json index f3e31e8..78c527b 100644 --- a/.solhint.json +++ b/.solhint.json @@ -1,7 +1,7 @@ { "extends": "solhint:recommended", "rules": { - "compiler-version": ["error", "^0.8.0"], + "compiler-version": ["error", "^0.8.17"], "func-visibility": ["warn", { "ignoreConstructors": true }] } } diff --git a/contracts/DealStatus.sol b/contracts/DealStatus.sol index 1356766..8722e3f 100644 --- a/contracts/DealStatus.sol +++ b/contracts/DealStatus.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.17; // Uncomment this line to use console.log // import "hardhat/console.sol"; @@ -8,14 +8,13 @@ import "./interfaces/IAggregatorOracle.sol"; import "./data-segment/Proof.sol"; import {MarketAPI} from "./mocks/MarketAPIMock.sol"; -import { MarketTypes } from "@zondax/filecoin-solidity/contracts/v0.8/types/MarketTypes.sol"; +import {MarketTypes} from "@zondax/filecoin-solidity/contracts/v0.8/types/MarketTypes.sol"; // Delta that implements the AggregatorOracle interface contract DealStatus is IAggregatorOracle, Proof { - uint256 private transactionId; - mapping (uint256 => bytes) private txIdToCid; - mapping (bytes => uint64[]) private cidToDealIds; + mapping(uint256 => bytes) private txIdToCid; + mapping(bytes => uint64[]) private cidToDealIds; event ActiveDeals(uint64[] activeDealIDs); event ExpiringDeals(uint64[] expiringDealIDs); @@ -24,9 +23,16 @@ contract DealStatus is IAggregatorOracle, Proof { transactionId = 0; } + function computeExpectedAuxDataPublic( + InclusionProof memory _proof, + InclusionVerifierData memory _verifierData + ) public pure returns (InclusionAuxData memory) { + return computeExpectedAuxData(_proof, _verifierData); + } + function submit(bytes memory _cid) external returns (uint256) { // Increment the transaction ID - transactionId++; + transactionId++; // Save _cid txIdToCid[transactionId] = _cid; @@ -36,7 +42,12 @@ contract DealStatus is IAggregatorOracle, Proof { return transactionId; } - function complete(uint256 _id, uint64 _dealId, InclusionProof memory _proof, InclusionVerifierData memory _verifierData) external returns (InclusionAuxData memory) { + function complete( + uint256 _id, + uint64 _dealId, + InclusionProof memory _proof, + InclusionVerifierData memory _verifierData + ) external returns (InclusionAuxData memory) { require(_id <= transactionId, "Delta.complete: invalid transaction id"); // Emit the event emit CompleteAggregatorRequest(_id, _dealId); @@ -45,14 +56,14 @@ contract DealStatus is IAggregatorOracle, Proof { bytes memory cid = txIdToCid[_id]; for (uint i = 0; i < cidToDealIds[cid].length; i++) { if (cidToDealIds[cid][i] == _dealId) { - return this.computeExpectedAuxData(_proof, _verifierData); + return this.computeExpectedAuxDataPublic(_proof, _verifierData); } } cidToDealIds[cid].push(_dealId); // Perform validation logic // return this.computeExpectedAuxDataWithDeal(_dealId, _proof, _verifierData); - return this.computeExpectedAuxData(_proof, _verifierData); + return this.computeExpectedAuxDataPublic(_proof, _verifierData); } // allDealIds should return all the deal ids created by the aggregator @@ -60,7 +71,7 @@ contract DealStatus is IAggregatorOracle, Proof { return cidToDealIds[_cid]; } - // getActiveDeals should return all the _cid's active dealIds + // getActiveDeals should return all the _cid's active dealIds function getActiveDeals(bytes memory _cid) external returns (uint64[] memory activeDealIDs) { // get all the deal ids for the cid activeDealIDs = this.getAllDeals(_cid); @@ -68,8 +79,9 @@ contract DealStatus is IAggregatorOracle, Proof { for (uint i = 0; i < activeDealIDs.length; i++) { uint64 dealID = activeDealIDs[i]; // get the deal's expiration epoch - MarketTypes.GetDealActivationReturn memory dealActivationStatus = MarketAPI.getDealActivation(dealID); - + MarketTypes.GetDealActivationReturn memory dealActivationStatus = MarketAPI + .getDealActivation(dealID); + if (dealActivationStatus.terminated > 0 || dealActivationStatus.activated == -1) { delete activeDealIDs[i]; } @@ -79,8 +91,11 @@ contract DealStatus is IAggregatorOracle, Proof { } // getExpiringDeals should return all the deals' dealIds if they are expiring within `epochs` - function getExpiringDeals(bytes memory _cid, uint64 epochs) external returns (uint64[] memory expiringDealIDs) { - // the logic is similar to the above, but use this api call: + function getExpiringDeals( + bytes memory _cid, + uint64 epochs + ) external returns (uint64[] memory expiringDealIDs) { + // the logic is similar to the above, but use this api call: // https://github.com/Zondax/filecoin-solidity/blob/master/contracts/v0.8/MarketAPI.sol#LL110C9-L110C9 expiringDealIDs = this.getAllDeals(_cid); @@ -88,7 +103,7 @@ contract DealStatus is IAggregatorOracle, Proof { uint64 dealID = expiringDealIDs[i]; // get the deal's expiration epoch MarketTypes.GetDealTermReturn memory dealTerm = MarketAPI.getDealTerm(dealID); - + if (block.timestamp < uint64(dealTerm.end) - epochs) { delete expiringDealIDs[i]; } @@ -96,4 +111,4 @@ contract DealStatus is IAggregatorOracle, Proof { emit ExpiringDeals(expiringDealIDs); } -} \ No newline at end of file +} diff --git a/contracts/data-segment/Cid.sol b/contracts/data-segment/Cid.sol index 07a045e..d70b527 100644 --- a/contracts/data-segment/Cid.sol +++ b/contracts/data-segment/Cid.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; +pragma solidity ^0.8.17; // Uncomment this line to use console.log // import "hardhat/console.sol"; @@ -7,7 +7,7 @@ import "./Const.sol"; library Cid { // cidToPieceCommitment converts a CID to a piece commitment. - function cidToPieceCommitment(bytes memory _cb) public pure returns (bytes32) { + function cidToPieceCommitment(bytes memory _cb) internal pure returns (bytes32) { require( _cb.length == CID_COMMP_HEADER_LENGTH + MERKLE_TREE_NODE_SIZE, "wrong length of CID" @@ -25,7 +25,7 @@ library Cid { } // pieceCommitmentToCid converts a piece commitment to a CID. - function pieceCommitmentToCid(bytes32 _commp) public pure returns (bytes memory) { + function pieceCommitmentToCid(bytes32 _commp) internal pure returns (bytes memory) { bytes memory cb = abi.encodePacked(CID_COMMP_HEADER, _commp); return cb; } diff --git a/contracts/data-segment/Const.sol b/contracts/data-segment/Const.sol index 58f0c4a..df8835b 100644 --- a/contracts/data-segment/Const.sol +++ b/contracts/data-segment/Const.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; +pragma solidity ^0.8.17; // Uncomment this line to use console.log // import "hardhat/console.sol"; diff --git a/contracts/data-segment/Proof.sol b/contracts/data-segment/Proof.sol index fb820db..9360e77 100644 --- a/contracts/data-segment/Proof.sol +++ b/contracts/data-segment/Proof.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; +pragma solidity ^0.8.17; // Uncomment this line to use console.log // import "hardhat/console.sol"; @@ -18,7 +18,7 @@ contract Proof { function computeExpectedAuxData( InclusionProof memory ip, InclusionVerifierData memory verifierData - ) public pure returns (InclusionAuxData memory) { + ) internal pure returns (InclusionAuxData memory) { require( isPow2(uint64(verifierData.sizePc)), "Size of piece provided by verifier is not power of two" @@ -41,10 +41,7 @@ contract Proof { ); bytes32 enNode = truncatedHash(serialize(en)); bytes32 assumedCommPa2 = computeRoot(ip.proofIndex, enNode); - require( - assumedCommPa == assumedCommPa2, - "aggregator's data commitments don't match" - ); + require(assumedCommPa == assumedCommPa2, "aggregator's data commitments don't match"); (bool ok2, uint64 assumedSizePa2) = checkedMultiply( uint64(1) << uint64(ip.proofIndex.path.length), @@ -63,7 +60,7 @@ contract Proof { uint64 dealId, InclusionProof memory ip, InclusionVerifierData memory verifierData - ) public returns (InclusionAuxData memory) { + ) internal returns (InclusionAuxData memory) { InclusionAuxData memory inclusionAuxData = computeExpectedAuxData(ip, verifierData); validateInclusionAuxData(dealId, inclusionAuxData); return inclusionAuxData; @@ -102,10 +99,7 @@ contract Proof { } // computeRoot computes the root of a Merkle tree given a leaf and a Merkle proof. - function computeRoot( - ProofData memory d, - bytes32 subtree - ) public pure returns (bytes32) { + function computeRoot(ProofData memory d, bytes32 subtree) internal pure returns (bytes32) { require(d.path.length < 64, "merkleproofs with depths greater than 63 are not supported"); require(d.index >> d.path.length == 0, "index greater than width of the tree"); @@ -126,7 +120,7 @@ contract Proof { } // computeNode computes the parent node of two child nodes - function computeNode(bytes32 left, bytes32 right) public pure returns (bytes32) { + function computeNode(bytes32 left, bytes32 right) internal pure returns (bytes32) { bytes32 digest = sha256(abi.encodePacked(left, right)); return truncate(digest); } @@ -177,15 +171,12 @@ contract Proof { ProofData memory proof, bytes32 root, bytes32 leaf - ) public pure returns (bool) { + ) internal pure returns (bool) { return computeRoot(proof, leaf) == root; } // processProof computes the root of the merkle tree given the leaf and the inclusion proof. - function processProof( - ProofData memory proof, - bytes32 leaf - ) internal pure returns (bytes32) { + function processProof(ProofData memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.path.length; i++) { computedHash = hashNode(computedHash, proof.path[i]); @@ -194,14 +185,14 @@ contract Proof { } // hashNode hashes the given node with the given left child. - function hashNode(bytes32 left, bytes32 right) public pure returns (bytes32) { + function hashNode(bytes32 left, bytes32 right) internal pure returns (bytes32) { bytes32 truncatedData = sha256(abi.encodePacked(left, right)); truncatedData &= TRUNCATOR; return truncatedData; } // truncatedHash computes the truncated hash of the given data. - function truncatedHash(bytes memory data) public pure returns (bytes32) { + function truncatedHash(bytes memory data) internal pure returns (bytes32) { bytes32 truncatedData = sha256(abi.encodePacked(data)); truncatedData &= TRUNCATOR; return truncatedData; @@ -222,7 +213,7 @@ contract Proof { } // computeChecksum computes the checksum of the given segment description. - function computeChecksum(SegmentDesc memory _sd) public pure returns (bytes16) { + function computeChecksum(SegmentDesc memory _sd) internal pure returns (bytes16) { bytes memory serialized = serialize(_sd); bytes32 digest = sha256(serialized); digest &= hex"ffffffffffffffffffffffffffffff3f"; @@ -230,7 +221,7 @@ contract Proof { } // serialize serializes the given segment description. - function serialize(SegmentDesc memory sd) public pure returns (bytes memory) { + function serialize(SegmentDesc memory sd) internal pure returns (bytes memory) { bytes memory result = new bytes(ENTRY_SIZE); // Pad commDs diff --git a/contracts/data-segment/ProofTypes.sol b/contracts/data-segment/ProofTypes.sol index 5584ef1..731e413 100644 --- a/contracts/data-segment/ProofTypes.sol +++ b/contracts/data-segment/ProofTypes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; +pragma solidity ^0.8.17; // Uncomment this line to use console.log // import "hardhat/console.sol"; diff --git a/contracts/interfaces/IAggregatorOracle.sol b/contracts/interfaces/IAggregatorOracle.sol index 972f154..196f79b 100644 --- a/contracts/interfaces/IAggregatorOracle.sol +++ b/contracts/interfaces/IAggregatorOracle.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.17; import "../data-segment/Proof.sol"; @@ -14,7 +14,12 @@ interface IAggregatorOracle { function submit(bytes memory cid) external returns (uint256 id); // Callback function that is called by the aggregator - function complete(uint256 _id, uint64 _dealId, InclusionProof memory _proof, InclusionVerifierData memory _verifierData) external returns (InclusionAuxData memory); + function complete( + uint256 _id, + uint64 _dealId, + InclusionProof memory _proof, + InclusionVerifierData memory _verifierData + ) external returns (InclusionAuxData memory); // Get all deal IDs for a specified cid function getAllDeals(bytes memory _cid) external returns (uint64[] memory); @@ -24,4 +29,4 @@ interface IAggregatorOracle { // getExpiringDeals should return all the deals' dealIds if they are expiring within `epochs` function getExpiringDeals(bytes memory _cid, uint64 epochs) external returns (uint64[] memory); -} \ No newline at end of file +} diff --git a/hardhat.config.js b/hardhat.config.js index f7018f0..1076e52 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -10,14 +10,14 @@ module.exports = { solidity: { version: "0.8.17", settings: { - optimizer: { - enabled: true, - runs: 1000, - details: { yul: false }, - }, + optimizer: { + enabled: true, + runs: 200, + details: { yul: false }, + }, }, - }, - defaultNetwork: "localnet", + }, + defaultNetwork: "calibrationnet", networks: { localnet: { chainId: 31415926, From 889bf7302ecf2e641028235c8fc995776e1efee4 Mon Sep 17 00:00:00 2001 From: lordforever Date: Sun, 6 Aug 2023 18:07:46 +0530 Subject: [PATCH 2/3] conflicts resolved --- .gitignore | 4 +- contracts/DealStatus.sol | 2 +- contracts/data-segment/Cid.sol | 2 +- contracts/data-segment/Proof.sol | 58 +++++++++++++++----------- deploy/00_deploy.js | 71 ++++++++++++++------------------ 5 files changed, 72 insertions(+), 65 deletions(-) diff --git a/.gitignore b/.gitignore index 236d2d5..d433056 100644 --- a/.gitignore +++ b/.gitignore @@ -101,4 +101,6 @@ lint/tmp/ gas-report.txt -contracts/test/fuzzing/crytic-export \ No newline at end of file +contracts/test/fuzzing/crytic-export + +yarn.lock \ No newline at end of file diff --git a/contracts/DealStatus.sol b/contracts/DealStatus.sol index 1758729..bcc60b6 100644 --- a/contracts/DealStatus.sol +++ b/contracts/DealStatus.sol @@ -54,7 +54,7 @@ contract DealStatus is IAggregatorOracle, Proof { bytes memory cid = txIdToCid[_id]; for (uint256 i = 0; i < cidToDeals[cid].length; i++) { if (cidToDeals[cid][i].dealId == _dealId) { - return this.computeExpectedAuxData(_proof, _verifierData); + return this.computeExpectedAuxDataPublic(_proof, _verifierData); } } diff --git a/contracts/data-segment/Cid.sol b/contracts/data-segment/Cid.sol index f94fd04..d70b527 100644 --- a/contracts/data-segment/Cid.sol +++ b/contracts/data-segment/Cid.sol @@ -7,7 +7,7 @@ import "./Const.sol"; library Cid { // cidToPieceCommitment converts a CID to a piece commitment. - function cidToPieceCommitment(bytes memory _cb) public pure returns (bytes32) { + function cidToPieceCommitment(bytes memory _cb) internal pure returns (bytes32) { require( _cb.length == CID_COMMP_HEADER_LENGTH + MERKLE_TREE_NODE_SIZE, "wrong length of CID" diff --git a/contracts/data-segment/Proof.sol b/contracts/data-segment/Proof.sol index 46967cc..a53d171 100644 --- a/contracts/data-segment/Proof.sol +++ b/contracts/data-segment/Proof.sol @@ -23,28 +23,30 @@ contract Proof { isPow2(uint64(verifierData.sizePc)), "Size of piece provided by verifier is not power of two" ); - function computeExpectedAuxData(InclusionProof memory ip, InclusionVerifierData memory verifierData) - public - pure - returns (InclusionAuxData memory) - { - require(isPow2(uint64(verifierData.sizePc)), "Size of piece provided by verifier is not power of two"); bytes32 commPc = verifierData.commPc.cidToPieceCommitment(); bytes32 assumedCommPa = computeRoot(ip.proofSubtree, commPc); - (bool ok, uint64 assumedSizePa) = - checkedMultiply(uint64(1) << uint64(ip.proofSubtree.path.length), uint64(verifierData.sizePc)); + (bool ok, uint64 assumedSizePa) = checkedMultiply( + uint64(1) << uint64(ip.proofSubtree.path.length), + uint64(verifierData.sizePc) + ); require(ok, "assumedSizePa overflow"); uint64 dataOffset = ip.proofSubtree.index * uint64(verifierData.sizePc); - SegmentDesc memory en = makeDataSegmentIndexEntry(Fr32(commPc), dataOffset, uint64(verifierData.sizePc)); + SegmentDesc memory en = makeDataSegmentIndexEntry( + Fr32(commPc), + dataOffset, + uint64(verifierData.sizePc) + ); bytes32 enNode = truncatedHash(serialize(en)); bytes32 assumedCommPa2 = computeRoot(ip.proofIndex, enNode); require(assumedCommPa == assumedCommPa2, "aggregator's data commitments don't match"); - (bool ok2, uint64 assumedSizePa2) = - checkedMultiply(uint64(1) << uint64(ip.proofIndex.path.length), BYTES_IN_DATA_SEGMENT_ENTRY); + (bool ok2, uint64 assumedSizePa2) = checkedMultiply( + uint64(1) << uint64(ip.proofIndex.path.length), + BYTES_IN_DATA_SEGMENT_ENTRY + ); require(ok2, "assumedSizePau64 overflow"); require(assumedSizePa == assumedSizePa2, "aggregator's data size doesn't match"); @@ -65,28 +67,39 @@ contract Proof { } // validateInclusionAuxData validates that the deal is activated and not terminated. - function validateInclusionAuxData(uint64 dealId, InclusionAuxData memory inclusionAuxData) internal { + function validateInclusionAuxData( + uint64 dealId, + InclusionAuxData memory inclusionAuxData + ) internal { // check that the deal is not terminated - MarketTypes.GetDealActivationReturn memory dealActivation = MarketAPI.getDealActivation(dealId); + MarketTypes.GetDealActivationReturn memory dealActivation = MarketAPI.getDealActivation( + dealId + ); require(dealActivation.terminated <= 0, "Deal is terminated"); require(dealActivation.activated > 0, "Deal is not activated"); - MarketTypes.GetDealDataCommitmentReturn memory dealDataCommitment = MarketAPI.getDealDataCommitment(dealId); - require(keccak256(dealDataCommitment.data) == keccak256(inclusionAuxData.commPa), "Deal commD doesn't match"); + MarketTypes.GetDealDataCommitmentReturn memory dealDataCommitment = MarketAPI + .getDealDataCommitment(dealId); + require( + keccak256(dealDataCommitment.data) == keccak256(inclusionAuxData.commPa), + "Deal commD doesn't match" + ); require(dealDataCommitment.size == inclusionAuxData.sizePa, "Deal size doesn't match"); } // validateIndexEntry validates that the index entry is in the correct position in the index. function validateIndexEntry(InclusionProof memory ip, uint64 assumedSizePa2) internal pure { uint64 idxStart = indexAreaStart(assumedSizePa2); - (bool ok3, uint64 indexOffset) = checkedMultiply(ip.proofIndex.index, BYTES_IN_DATA_SEGMENT_ENTRY); + (bool ok3, uint64 indexOffset) = checkedMultiply( + ip.proofIndex.index, + BYTES_IN_DATA_SEGMENT_ENTRY + ); require(ok3, "indexOffset overflow"); require(indexOffset >= idxStart, "index entry at wrong position"); } // computeRoot computes the root of a Merkle tree given a leaf and a Merkle proof. function computeRoot(ProofData memory d, bytes32 subtree) internal pure returns (bytes32) { - function computeRoot(ProofData memory d, bytes32 subtree) public pure returns (bytes32) { require(d.path.length < 64, "merkleproofs with depths greater than 63 are not supported"); require(d.index >> d.path.length == 0, "index greater than width of the tree"); @@ -159,7 +172,6 @@ contract Proof { bytes32 root, bytes32 leaf ) internal pure returns (bool) { - function verify(ProofData memory proof, bytes32 root, bytes32 leaf) public pure returns (bool) { return computeRoot(proof, leaf) == root; } @@ -187,11 +199,11 @@ contract Proof { } // makeDataSegmentIndexEntry creates a new data segment index entry. - function makeDataSegmentIndexEntry(Fr32 memory commP, uint64 offset, uint64 size) - internal - pure - returns (SegmentDesc memory) - { + function makeDataSegmentIndexEntry( + Fr32 memory commP, + uint64 offset, + uint64 size + ) internal pure returns (SegmentDesc memory) { SegmentDesc memory en; en.commDs = bytes32(commP.value); en.offset = offset; diff --git a/deploy/00_deploy.js b/deploy/00_deploy.js index 7f743db..f9302d5 100644 --- a/deploy/00_deploy.js +++ b/deploy/00_deploy.js @@ -8,46 +8,39 @@ const wallet = new ethers.Wallet(private_key, ethers.provider) module.exports = async ({ deployments }) => { // ethers is available in the global scope - const [deployer] = await ethers.getSigners(); - console.log( - "Deploying the contracts with the account:", - await deployer.getAddress() - ); - - console.log("Account balance:", (await deployer.getBalance()).toString()); - - const accounts = await ethers.getSigners(); - //console.log(accounts[0]) - - console.log("Wallet Ethereum Address:", wallet.address); - const chainId = network.config.chainId; - - //deploy DealStatus - const Cid = await ethers.getContractFactory('Cid', accounts[0]); - console.log('Deploying Cid...'); - const cid = await Cid.deploy(); - await cid.deployed() - console.log('Cid deployed to:', cid.address); - - //deploy DealStatus - const Proof = await ethers.getContractFactory('Proof', { - libraries: { - Cid: cid.address, - }, - }); - console.log('Deploying Proof...'); - const proof = await Proof.deploy(); - await proof.deployed() - console.log('Proof deployed to:', proof.address); + const [deployer] = await ethers.getSigners() + console.log("Deploying the contracts with the account:", await deployer.getAddress()) + + console.log("Account balance:", (await deployer.getBalance()).toString()) + + const accounts = await ethers.getSigners() + console.log(accounts[0]) + + console.log("Wallet Ethereum Address:", wallet.address) + const chainId = network.config.chainId + + // //deploy DealStatus + // const Cid = await ethers.getContractFactory('Cid', accounts[0]); + // console.log('Deploying Cid...'); + // const cid = await Cid.deploy(); + // await cid.deployed() + // console.log('Cid deployed to:', cid.address); + + // //deploy DealStatus + // const Proof = await ethers.getContractFactory('Proof', { + // libraries: { + // Cid: cid.address, + // }, + // }); + // console.log('Deploying Proof...'); + // const proof = await Proof.deploy(); + // await proof.deployed() + // console.log('Proof deployed to:', proof.address); //deploy DealStatus - const dealStatus = await ethers.getContractFactory('DealStatus', { - libraries: { - Cid: cid.address, - }, - }); - console.log('Deploying DealStatus...'); - const dealstatus = await dealStatus.deploy(); + const dealStatus = await ethers.getContractFactory("DealStatus", accounts[0]) + console.log("Deploying DealStatus...") + const dealstatus = await dealStatus.deploy() await dealstatus.deployed() - console.log('DealStatus deployed to:', dealstatus.address); + console.log("DealStatus deployed to:", dealstatus.address) } From fe9a063e859d3a4353ebe7b0b2318a75de49ecf2 Mon Sep 17 00:00:00 2001 From: lordforever Date: Sun, 6 Aug 2023 18:15:40 +0530 Subject: [PATCH 3/3] runs reinstated --- hardhat.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardhat.config.js b/hardhat.config.js index 1076e52..951a229 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -12,7 +12,7 @@ module.exports = { settings: { optimizer: { enabled: true, - runs: 200, + runs: 1000, details: { yul: false }, }, },