diff --git a/.solhint.json b/.solhint.json index bdb70287..4c13066c 100644 --- a/.solhint.json +++ b/.solhint.json @@ -6,6 +6,7 @@ "func-visibility": ["warn", { "ignoreConstructors": true }], "not-rely-on-time": "off", "avoid-low-level-calls": "off", - "no-inline-assembly": "off" + "no-inline-assembly": "off", + "max-states-count": "off" } } diff --git a/abi/Paranet.json b/abi/Paranet.json index 374eb50e..7eca7ac3 100644 --- a/abi/Paranet.json +++ b/abi/Paranet.json @@ -63,32 +63,6 @@ "name": "ParanetHasAlreadyBeenRegistered", "type": "error" }, - { - "inputs": [ - { - "internalType": "address", - "name": "knowledgeAssetStorageAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "poolType", - "type": "string" - }, - { - "internalType": "address", - "name": "poolAddress", - "type": "address" - } - ], - "name": "ParanetIncentivesPoolAlreadyExists", - "type": "error" - }, { "inputs": [ { @@ -433,45 +407,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "paranetKAStorageContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "paranetKATokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tracToNeuroEmissionMultiplier", - "type": "uint256" - }, - { - "internalType": "uint16", - "name": "paranetOperatorRewardPercentage", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "paranetIncentivizationProposalVotersRewardPercentage", - "type": "uint16" - } - ], - "name": "deployNeuroIncentivesPool", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "hashingProxy", diff --git a/abi/ParanetIncentivesPoolFactory.json b/abi/ParanetIncentivesPoolFactory.json new file mode 100644 index 00000000..c276757b --- /dev/null +++ b/abi/ParanetIncentivesPoolFactory.json @@ -0,0 +1,200 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "hubAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "knowledgeAssetStorageAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "address", + "name": "poolAddress", + "type": "address" + } + ], + "name": "ParanetIncentivesPoolAlreadyExists", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "string", + "name": "poolType", + "type": "string" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "indexed": false, + "internalType": "struct ParanetStructs.IncentivesPool", + "name": "incentivesPool", + "type": "tuple" + } + ], + "name": "ParanetIncetivesPoolDeployed", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "paranetKAStorageContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "paranetKATokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tracToNeuroEmissionMultiplier", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "paranetOperatorRewardPercentage", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "paranetIncentivizationProposalVotersRewardPercentage", + "type": "uint16" + } + ], + "name": "deployNeuroIncentivesPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "hub", + "outputs": [ + { + "internalType": "contract HubV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "paranetsRegistry", + "outputs": [ + { + "internalType": "contract ParanetsRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_status", + "type": "bool" + } + ], + "name": "setStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "status", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + } +] diff --git a/abi/ParanetNeuroIncentivesPool.json b/abi/ParanetNeuroIncentivesPool.json index 224e665e..288bf3eb 100644 --- a/abi/ParanetNeuroIncentivesPool.json +++ b/abi/ParanetNeuroIncentivesPool.json @@ -244,21 +244,38 @@ "type": "function" }, { - "inputs": [], - "name": "claimedMinersNeuro", - "outputs": [ + "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], + "name": "claimedMinerRewards", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [], - "name": "claimedOperatorNeuro", + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "claimedMinerRewardsIndexes", "outputs": [ { "internalType": "uint256", @@ -270,8 +287,38 @@ "type": "function" }, { - "inputs": [], - "name": "claimedVotersNeuro", + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "claimedOperatorRewards", + "outputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "claimedOperatorRewardsIndexes", "outputs": [ { "internalType": "uint256", @@ -302,6 +349,69 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "getAllRewardedMiners", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "internalType": "struct ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllRewardedOperators", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "claimedNeuro", + "type": "uint256" + } + ], + "internalType": "struct ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getClaimableAllKnowledgeMinersRewardAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getClaimableAllProposalVotersRewardAmount", @@ -343,7 +453,7 @@ }, { "inputs": [], - "name": "getClaimableSingleProposalVoterRewardAmount", + "name": "getClaimableProposalVoterRewardAmount", "outputs": [ { "internalType": "uint256", @@ -416,6 +526,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getTotalAllKnowledgeMinersIncentiveEstimation", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getTotalAllProposalVotersIncentiveEstimation", @@ -457,7 +580,7 @@ }, { "inputs": [], - "name": "getTotalSingleProposalVoterIncentiveEstimation", + "name": "getTotalProposalVoterIncentiveEstimation", "outputs": [ { "internalType": "uint256", @@ -630,6 +753,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "minerAddress", + "type": "address" + } + ], + "name": "minerClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "name", @@ -685,6 +827,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "operatorAddress", + "type": "address" + } + ], + "name": "operatorClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "paranetIncentivizationProposalVotersRewardPercentage", @@ -763,6 +924,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "totalMinersClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "totalNeuroReceived", @@ -776,6 +950,32 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "totalOperatorsClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalVotersClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -815,6 +1015,25 @@ "stateMutability": "pure", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "voterAddress", + "type": "address" + } + ], + "name": "voterClaimedNeuro", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/contracts/v2/Staking.sol b/contracts/v2/Staking.sol index ab0933db..0e7b95d1 100644 --- a/contracts/v2/Staking.sol +++ b/contracts/v2/Staking.sol @@ -397,9 +397,9 @@ contract StakingV2 is Named, Versioned, ContractStatusV2, Initializable { ); } - function finishOperatorFeeChange(uint72 identityId) external onlyAdmin(identityId) { - // Function signature needed for ABI backwards compatibility - } + // Function signature needed for ABI backwards compatibility + // solhint-disable-next-line no-empty-blocks + function finishOperatorFeeChange(uint72 identityId) external onlyAdmin(identityId) {} function _checkAdmin(uint72 identityId) internal view virtual { if (!identityStorage.keyHasPurpose(identityId, keccak256(abi.encodePacked(msg.sender)), ADMIN_KEY)) { diff --git a/contracts/v2/paranets/Paranet.sol b/contracts/v2/paranets/Paranet.sol index 17159920..4553c0f6 100644 --- a/contracts/v2/paranets/Paranet.sol +++ b/contracts/v2/paranets/Paranet.sol @@ -9,7 +9,6 @@ import {ParanetKnowledgeAssetsRegistry} from "../storage/paranets/ParanetKnowled import {ParanetKnowledgeMinersRegistry} from "../storage/paranets/ParanetKnowledgeMinersRegistry.sol"; import {ParanetsRegistry} from "../storage/paranets/ParanetsRegistry.sol"; import {ParanetServicesRegistry} from "../storage/paranets/ParanetServicesRegistry.sol"; -import {ParanetNeuroIncentivesPool} from "./ParanetNeuroIncentivesPool.sol"; import {ServiceAgreementStorageProxy} from "../../v1/storage/ServiceAgreementStorageProxy.sol"; import {HashingProxy} from "../../v1/HashingProxy.sol"; import {ContractStatusV2} from "../abstract/ContractStatus.sol"; @@ -19,7 +18,6 @@ import {Versioned} from "../../v1/interface/Versioned.sol"; import {ContentAssetStructs} from "../../v1/structs/assets/ContentAssetStructs.sol"; import {ParanetStructs} from "../structs/paranets/ParanetStructs.sol"; import {ParanetErrors} from "../errors/paranets/ParanetErrors.sol"; -import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {HASH_FUNCTION_ID} from "../../v1/constants/assets/ContentAssetConstants.sol"; @@ -69,7 +67,7 @@ contract Paranet is Named, Versioned, ContractStatusV2, Initializable { ); string private constant _NAME = "Paranet"; - string private constant _VERSION = "2.1.2"; + string private constant _VERSION = "2.1.3"; ParanetsRegistry public paranetsRegistry; ParanetServicesRegistry public paranetServicesRegistry; @@ -130,58 +128,6 @@ contract Paranet is Named, Versioned, ContractStatusV2, Initializable { return pr.registerParanet(paranetKAStorageContract, paranetKATokenId, paranetName, paranetDescription); } - function deployNeuroIncentivesPool( - address paranetKAStorageContract, - uint256 paranetKATokenId, - uint256 tracToNeuroEmissionMultiplier, - uint16 paranetOperatorRewardPercentage, - uint16 paranetIncentivizationProposalVotersRewardPercentage - ) external onlyKnowledgeAssetOwner(paranetKAStorageContract, paranetKATokenId) returns (address) { - HubV2 h = hub; - ParanetsRegistry pr = paranetsRegistry; - - if ( - pr.hasIncentivesPoolByType( - keccak256(abi.encodePacked(paranetKAStorageContract, paranetKATokenId)), - "Neuroweb" - ) - ) { - revert ParanetErrors.ParanetIncentivesPoolAlreadyExists( - paranetKAStorageContract, - paranetKATokenId, - "Neuroweb", - pr.getIncentivesPoolAddress( - keccak256(abi.encodePacked(paranetKAStorageContract, paranetKATokenId)), - "Neuroweb" - ) - ); - } - - ParanetNeuroIncentivesPool incentivesPool = new ParanetNeuroIncentivesPool( - address(h), - h.getContractAddress("ParanetsRegistry"), - h.getContractAddress("ParanetKnowledgeMinersRegistry"), - keccak256(abi.encodePacked(paranetKAStorageContract, paranetKATokenId)), - tracToNeuroEmissionMultiplier, - paranetOperatorRewardPercentage, - paranetIncentivizationProposalVotersRewardPercentage - ); - - pr.setIncentivesPoolAddress( - keccak256(abi.encodePacked(paranetKAStorageContract, paranetKATokenId)), - "Neuroweb", - address(incentivesPool) - ); - - emit ParanetIncetivesPoolDeployed( - paranetKAStorageContract, - paranetKATokenId, - ParanetStructs.IncentivesPool({poolType: "Neuroweb", addr: address(incentivesPool)}) - ); - - return address(incentivesPool); - } - function updateParanetMetadata( address paranetKAStorageContract, uint256 paranetKATokenId, @@ -601,6 +547,7 @@ contract Paranet is Named, Versioned, ContractStatusV2, Initializable { ) ) ); + // solhint-disable-next-line no-empty-blocks } catch {} } } diff --git a/contracts/v2/paranets/ParanetIncentivesPoolFactory.sol b/contracts/v2/paranets/ParanetIncentivesPoolFactory.sol new file mode 100644 index 00000000..89be712a --- /dev/null +++ b/contracts/v2/paranets/ParanetIncentivesPoolFactory.sol @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.16; + +import {HubV2} from "../Hub.sol"; +import {ParanetsRegistry} from "../storage/paranets/ParanetsRegistry.sol"; +import {ParanetNeuroIncentivesPool} from "./ParanetNeuroIncentivesPool.sol"; +import {ContractStatusV2} from "../abstract/ContractStatus.sol"; +import {Initializable} from "../../v1/interface/Initializable.sol"; +import {Named} from "../../v1/interface/Named.sol"; +import {Versioned} from "../../v1/interface/Versioned.sol"; +import {ParanetStructs} from "../structs/paranets/ParanetStructs.sol"; +import {ParanetErrors} from "../errors/paranets/ParanetErrors.sol"; +import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; + +contract ParanetIncentivesPoolFactory is Named, Versioned, ContractStatusV2, Initializable { + event ParanetIncetivesPoolDeployed( + address indexed paranetKAStorageContract, + uint256 indexed paranetKATokenId, + ParanetStructs.IncentivesPool incentivesPool + ); + + string private constant _NAME = "ParanetIncentivesPoolFactory"; + string private constant _VERSION = "2.0.0"; + + ParanetsRegistry public paranetsRegistry; + + // solhint-disable-next-line no-empty-blocks + constructor(address hubAddress) ContractStatusV2(hubAddress) {} + + modifier onlyKnowledgeAssetOwner(address knowledgeAssetStorageContract, uint256 knowledgeAssetTokenId) { + _checkKnowledgeAssetOwner(knowledgeAssetStorageContract, knowledgeAssetTokenId); + _; + } + + function initialize() public onlyHubOwner { + paranetsRegistry = ParanetsRegistry(hub.getContractAddress("ParanetsRegistry")); + } + + function name() external pure virtual override returns (string memory) { + return _NAME; + } + + function version() external pure virtual override returns (string memory) { + return _VERSION; + } + + function deployNeuroIncentivesPool( + address paranetKAStorageContract, + uint256 paranetKATokenId, + uint256 tracToNeuroEmissionMultiplier, + uint16 paranetOperatorRewardPercentage, + uint16 paranetIncentivizationProposalVotersRewardPercentage + ) external onlyKnowledgeAssetOwner(paranetKAStorageContract, paranetKATokenId) returns (address) { + HubV2 h = hub; + ParanetsRegistry pr = paranetsRegistry; + + if ( + pr.hasIncentivesPoolByType( + keccak256(abi.encodePacked(paranetKAStorageContract, paranetKATokenId)), + "Neuroweb" + ) + ) { + revert ParanetErrors.ParanetIncentivesPoolAlreadyExists( + paranetKAStorageContract, + paranetKATokenId, + "Neuroweb", + pr.getIncentivesPoolAddress( + keccak256(abi.encodePacked(paranetKAStorageContract, paranetKATokenId)), + "Neuroweb" + ) + ); + } + + ParanetNeuroIncentivesPool incentivesPool = new ParanetNeuroIncentivesPool( + address(h), + h.getContractAddress("ParanetsRegistry"), + h.getContractAddress("ParanetKnowledgeMinersRegistry"), + keccak256(abi.encodePacked(paranetKAStorageContract, paranetKATokenId)), + tracToNeuroEmissionMultiplier, + paranetOperatorRewardPercentage, + paranetIncentivizationProposalVotersRewardPercentage + ); + + pr.setIncentivesPoolAddress( + keccak256(abi.encodePacked(paranetKAStorageContract, paranetKATokenId)), + "Neuroweb", + address(incentivesPool) + ); + + emit ParanetIncetivesPoolDeployed( + paranetKAStorageContract, + paranetKATokenId, + ParanetStructs.IncentivesPool({poolType: "Neuroweb", addr: address(incentivesPool)}) + ); + + return address(incentivesPool); + } + + function _checkKnowledgeAssetOwner( + address knowledgeAssetStorageContract, + uint256 knowledgeAssetTokenId + ) internal view virtual { + require(hub.isAssetStorage(knowledgeAssetStorageContract), "Given address isn't KA Storage"); + require( + IERC721(knowledgeAssetStorageContract).ownerOf(knowledgeAssetTokenId) == msg.sender, + "Caller isn't the owner of the KA" + ); + } +} diff --git a/contracts/v2/paranets/ParanetNeuroIncentivesPool.sol b/contracts/v2/paranets/ParanetNeuroIncentivesPool.sol index 6dfa4b9c..81b8ed36 100644 --- a/contracts/v2/paranets/ParanetNeuroIncentivesPool.sol +++ b/contracts/v2/paranets/ParanetNeuroIncentivesPool.sol @@ -27,7 +27,7 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { event ParanetIncentivizationProposalVoterRewardClaimed(address indexed voter, uint256 amount); string private constant _NAME = "ParanetNeuroIncentivesPool"; - string private constant _VERSION = "2.1.1"; + string private constant _VERSION = "2.1.2"; HubV2 public hub; ParanetsRegistry public paranetsRegistry; @@ -57,9 +57,15 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { // Address which can set Voters list and update Total NEURO Emission multiplier address public votersRegistrar; - uint256 public claimedMinersNeuro; - uint256 public claimedOperatorNeuro; - uint256 public claimedVotersNeuro; + uint256 public totalMinersClaimedNeuro; + uint256 public totalOperatorsClaimedNeuro; + uint256 public totalVotersClaimedNeuro; + + ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile[] public claimedMinerRewards; + mapping(address => uint256) public claimedMinerRewardsIndexes; + + ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile[] public claimedOperatorRewards; + mapping(address => uint256) public claimedOperatorRewardsIndexes; ParanetStructs.ParanetIncentivizationProposalVoter[] public voters; mapping(address => uint256) public votersIndexes; @@ -76,7 +82,8 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { ) { require( paranetOperatorRewardPercentage_ + paranetIncentivizationProposalVotersRewardPercentage_ < - PERCENTAGE_SCALING_FACTOR + PERCENTAGE_SCALING_FACTOR, + "Invalid rewards ratio" ); hub = HubV2(hubAddress); @@ -144,7 +151,7 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { } function totalNeuroReceived() external view returns (uint256) { - return address(this).balance + claimedMinersNeuro + claimedOperatorNeuro + claimedVotersNeuro; + return address(this).balance + totalMinersClaimedNeuro + totalOperatorsClaimedNeuro + totalVotersClaimedNeuro; } function getNeuroBalance() external view returns (uint256) { @@ -159,6 +166,34 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { votersRegistrar = newRegistrar; } + function minerClaimedNeuro(address minerAddress) external view returns (uint256) { + return claimedMinerRewards[claimedMinerRewardsIndexes[minerAddress]].claimedNeuro; + } + + function getAllRewardedMiners() + external + view + returns (ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile[] memory) + { + return claimedMinerRewards; + } + + function operatorClaimedNeuro(address operatorAddress) external view returns (uint256) { + return claimedOperatorRewards[claimedOperatorRewardsIndexes[operatorAddress]].claimedNeuro; + } + + function getAllRewardedOperators() + external + view + returns (ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile[] memory) + { + return claimedOperatorRewards; + } + + function voterClaimedNeuro(address voterAddress) external view returns (uint256) { + return voters[votersIndexes[voterAddress]].claimedNeuro; + } + function addVoters( ParanetStructs.ParanetIncentivizationProposalVoterInput[] calldata voters_ ) external onlyVotersRegistrar { @@ -264,7 +299,7 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { } function finalizeNeuroEmissionMultiplierUpdate() external onlyVotersRegistrar { - require(neuroEmissionMultipliers.length > 0, "No emission multiplier updates initiated"); + require(neuroEmissionMultipliers.length > 0, "No emission multiplier updates"); require( !neuroEmissionMultipliers[neuroEmissionMultipliers.length - 1].finalized, "Last update already finalized" @@ -308,6 +343,16 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { paranetIncentivizationProposalVotersRewardPercentage)) / PERCENTAGE_SCALING_FACTOR; } + function getTotalAllKnowledgeMinersIncentiveEstimation() public view returns (uint256) { + return + _getIncentiveEstimation( + PERCENTAGE_SCALING_FACTOR - + paranetOperatorRewardPercentage - + paranetIncentivizationProposalVotersRewardPercentage, + totalMinersClaimedNeuro + ); + } + function getClaimableKnowledgeMinerRewardAmount() public view returns (uint256) { uint256 neuroReward = getTotalKnowledgeMinerIncentiveEstimation(); @@ -316,17 +361,34 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { // Following the example from the above, if we have 100 NEURO as a total reward, Miners should never get // more than 80 NEURO. minersRewardLimit = 80 NEURO uint256 minersRewardLimit = ((address(this).balance + - claimedMinersNeuro + - claimedOperatorNeuro + - claimedVotersNeuro) * + totalMinersClaimedNeuro + + totalOperatorsClaimedNeuro + + totalVotersClaimedNeuro) * (PERCENTAGE_SCALING_FACTOR - paranetOperatorRewardPercentage - paranetIncentivizationProposalVotersRewardPercentage)) / PERCENTAGE_SCALING_FACTOR; return - claimedMinersNeuro + neuroReward <= minersRewardLimit + totalMinersClaimedNeuro + neuroReward <= minersRewardLimit ? neuroReward - : minersRewardLimit - claimedMinersNeuro; + : minersRewardLimit - totalMinersClaimedNeuro; + } + + function getClaimableAllKnowledgeMinersRewardAmount() public view returns (uint256) { + uint256 neuroReward = getTotalAllKnowledgeMinersIncentiveEstimation(); + + uint256 minersRewardLimit = ((address(this).balance + + totalMinersClaimedNeuro + + totalOperatorsClaimedNeuro + + totalVotersClaimedNeuro) * + (PERCENTAGE_SCALING_FACTOR - + paranetOperatorRewardPercentage - + paranetIncentivizationProposalVotersRewardPercentage)) / PERCENTAGE_SCALING_FACTOR; + + return + totalMinersClaimedNeuro + neuroReward <= minersRewardLimit + ? neuroReward + : minersRewardLimit - totalMinersClaimedNeuro; } function claimKnowledgeMinerReward() external onlyParanetKnowledgeMiner { @@ -364,7 +426,21 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { ); pkmr.addCumulativeAwardedNeuro(msg.sender, parentParanetId, claimableNeuroReward); - claimedMinersNeuro += claimableNeuroReward; + if ( + claimedMinerRewards.length == 0 || + claimedMinerRewards[claimedMinerRewardsIndexes[msg.sender]].addr != msg.sender + ) { + claimedMinerRewardsIndexes[msg.sender] = claimedMinerRewards.length; + claimedMinerRewards.push( + ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile({ + addr: msg.sender, + claimedNeuro: claimableNeuroReward + }) + ); + } else { + claimedMinerRewards[claimedMinerRewardsIndexes[msg.sender]].claimedNeuro += claimableNeuroReward; + } + totalMinersClaimedNeuro += claimableNeuroReward; payable(msg.sender).transfer(claimableNeuroReward); @@ -372,34 +448,21 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { } function getTotalParanetOperatorIncentiveEstimation() public view returns (uint256) { - uint256 effectiveNeuroEmissionMultiplier = getEffectiveNeuroEmissionMultiplier(block.timestamp); - uint96 cumulativeKnowledgeValueOperatorPart = (paranetsRegistry.getCumulativeKnowledgeValue(parentParanetId) * - paranetOperatorRewardPercentage) / PERCENTAGE_SCALING_FACTOR; - uint96 rewardedTracSpentOperatorPart = uint96( - (claimedOperatorNeuro * EMISSION_MULTIPLIER_SCALING_FACTOR) / effectiveNeuroEmissionMultiplier - ); - - if (cumulativeKnowledgeValueOperatorPart - rewardedTracSpentOperatorPart < TOKENS_DIGITS_DIFF) { - return 0; - } - - return - ((cumulativeKnowledgeValueOperatorPart * effectiveNeuroEmissionMultiplier) / - EMISSION_MULTIPLIER_SCALING_FACTOR) - claimedOperatorNeuro; + return _getIncentiveEstimation(paranetOperatorRewardPercentage, totalOperatorsClaimedNeuro); } function getClaimableParanetOperatorRewardAmount() public view returns (uint256) { uint256 neuroReward = getTotalParanetOperatorIncentiveEstimation(); uint256 operatorRewardLimit = ((address(this).balance + - claimedMinersNeuro + - claimedOperatorNeuro + - claimedVotersNeuro) * paranetOperatorRewardPercentage) / PERCENTAGE_SCALING_FACTOR; + totalMinersClaimedNeuro + + totalOperatorsClaimedNeuro + + totalVotersClaimedNeuro) * paranetOperatorRewardPercentage) / PERCENTAGE_SCALING_FACTOR; return - claimedOperatorNeuro + neuroReward <= operatorRewardLimit + totalOperatorsClaimedNeuro + neuroReward <= operatorRewardLimit ? neuroReward - : operatorRewardLimit - claimedOperatorNeuro; + : operatorRewardLimit - totalOperatorsClaimedNeuro; } function claimParanetOperatorReward() external onlyParanetOperator { @@ -409,31 +472,28 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { revert ParanetErrors.NoRewardAvailable(parentParanetId, msg.sender); } - claimedOperatorNeuro += claimableNeuroReward; + if ( + claimedOperatorRewards.length == 0 || + claimedOperatorRewards[claimedOperatorRewardsIndexes[msg.sender]].addr != msg.sender + ) { + claimedOperatorRewardsIndexes[msg.sender] = claimedOperatorRewards.length; + claimedOperatorRewards.push( + ParanetStructs.ParanetIncentivesPoolClaimedRewardsProfile({ + addr: msg.sender, + claimedNeuro: claimableNeuroReward + }) + ); + } else { + claimedOperatorRewards[claimedOperatorRewardsIndexes[msg.sender]].claimedNeuro += claimableNeuroReward; + } + totalOperatorsClaimedNeuro += claimableNeuroReward; payable(msg.sender).transfer(claimableNeuroReward); emit ParanetOperatorRewardClaimed(msg.sender, claimableNeuroReward); } - function getTotalAllProposalVotersIncentiveEstimation() public view returns (uint256) { - uint256 effectiveNeuroEmissionMultiplier = getEffectiveNeuroEmissionMultiplier(block.timestamp); - uint96 cumulativeKnowledgeValueVotersPart = (paranetsRegistry.getCumulativeKnowledgeValue(parentParanetId) * - paranetIncentivizationProposalVotersRewardPercentage) / PERCENTAGE_SCALING_FACTOR; - uint96 rewardedTracSpentVotersPart = uint96( - (claimedVotersNeuro * EMISSION_MULTIPLIER_SCALING_FACTOR) / effectiveNeuroEmissionMultiplier - ); - - if (cumulativeKnowledgeValueVotersPart - rewardedTracSpentVotersPart < TOKENS_DIGITS_DIFF) { - return 0; - } - - return - ((cumulativeKnowledgeValueVotersPart * effectiveNeuroEmissionMultiplier) / - EMISSION_MULTIPLIER_SCALING_FACTOR) - claimedVotersNeuro; - } - - function getTotalSingleProposalVoterIncentiveEstimation() public view returns (uint256) { + function getTotalProposalVoterIncentiveEstimation() public view returns (uint256) { uint256 effectiveNeuroEmissionMultiplier = getEffectiveNeuroEmissionMultiplier(block.timestamp); uint96 cumulativeKnowledgeValueSingleVoterPart = (((paranetsRegistry.getCumulativeKnowledgeValue( parentParanetId @@ -453,33 +513,38 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { EMISSION_MULTIPLIER_SCALING_FACTOR) - voters[votersIndexes[msg.sender]].claimedNeuro; } - function getClaimableAllProposalVotersRewardAmount() public view returns (uint256) { - uint256 neuroReward = getTotalAllProposalVotersIncentiveEstimation(); + function getTotalAllProposalVotersIncentiveEstimation() public view returns (uint256) { + return _getIncentiveEstimation(paranetIncentivizationProposalVotersRewardPercentage, totalVotersClaimedNeuro); + } - uint256 votersRewardLimit = ((address(this).balance + - claimedMinersNeuro + - claimedOperatorNeuro + - claimedVotersNeuro) * paranetIncentivizationProposalVotersRewardPercentage) / PERCENTAGE_SCALING_FACTOR; + function getClaimableProposalVoterRewardAmount() public view returns (uint256) { + uint256 neuroReward = getTotalProposalVoterIncentiveEstimation(); + + uint256 voterRewardLimit = ((((address(this).balance + + totalMinersClaimedNeuro + + totalOperatorsClaimedNeuro + + totalVotersClaimedNeuro) * paranetIncentivizationProposalVotersRewardPercentage) / + PERCENTAGE_SCALING_FACTOR) * voters[votersIndexes[msg.sender]].weight) / MAX_CUMULATIVE_VOTERS_WEIGHT; return - claimedVotersNeuro + neuroReward <= votersRewardLimit + voters[votersIndexes[msg.sender]].claimedNeuro + neuroReward <= voterRewardLimit ? neuroReward - : votersRewardLimit - claimedVotersNeuro; + : voterRewardLimit - voters[votersIndexes[msg.sender]].claimedNeuro; } - function getClaimableSingleProposalVoterRewardAmount() public view returns (uint256) { - uint256 neuroReward = getTotalSingleProposalVoterIncentiveEstimation(); + function getClaimableAllProposalVotersRewardAmount() public view returns (uint256) { + uint256 neuroReward = getTotalAllProposalVotersIncentiveEstimation(); - uint256 voterRewardLimit = ((((address(this).balance + - claimedMinersNeuro + - claimedOperatorNeuro + - claimedVotersNeuro) * paranetIncentivizationProposalVotersRewardPercentage) / PERCENTAGE_SCALING_FACTOR) * - voters[votersIndexes[msg.sender]].weight) / MAX_CUMULATIVE_VOTERS_WEIGHT; + uint256 votersRewardLimit = ((address(this).balance + + totalMinersClaimedNeuro + + totalOperatorsClaimedNeuro + + totalVotersClaimedNeuro) * paranetIncentivizationProposalVotersRewardPercentage) / + PERCENTAGE_SCALING_FACTOR; return - voters[votersIndexes[msg.sender]].claimedNeuro + neuroReward <= voterRewardLimit + totalVotersClaimedNeuro + neuroReward <= votersRewardLimit ? neuroReward - : voterRewardLimit - voters[votersIndexes[msg.sender]].claimedNeuro; + : votersRewardLimit - totalVotersClaimedNeuro; } function claimIncentivizationProposalVoterReward() external onlyParanetIncentivizationProposalVoter { @@ -491,20 +556,40 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { ); } - uint256 claimableNeuroReward = getClaimableSingleProposalVoterRewardAmount(); + uint256 claimableNeuroReward = getClaimableProposalVoterRewardAmount(); if (claimableNeuroReward == 0) { revert ParanetErrors.NoRewardAvailable(parentParanetId, msg.sender); } voters[votersIndexes[msg.sender]].claimedNeuro += claimableNeuroReward; - claimedVotersNeuro += claimableNeuroReward; + totalVotersClaimedNeuro += claimableNeuroReward; payable(msg.sender).transfer(claimableNeuroReward); emit ParanetIncentivizationProposalVoterRewardClaimed(msg.sender, claimableNeuroReward); } + function _getIncentiveEstimation( + uint16 rewardPercentage, + uint256 totalClaimedNeuro + ) internal view returns (uint256) { + uint256 effectiveNeuroEmissionMultiplier = getEffectiveNeuroEmissionMultiplier(block.timestamp); + uint96 cumulativeKnowledgeValuePart = (paranetsRegistry.getCumulativeKnowledgeValue(parentParanetId) * + rewardPercentage) / PERCENTAGE_SCALING_FACTOR; + uint96 rewardedTracSpentPart = uint96( + (totalClaimedNeuro * EMISSION_MULTIPLIER_SCALING_FACTOR) / effectiveNeuroEmissionMultiplier + ); + + if (cumulativeKnowledgeValuePart - rewardedTracSpentPart < TOKENS_DIGITS_DIFF) { + return 0; + } + + return + ((cumulativeKnowledgeValuePart * effectiveNeuroEmissionMultiplier) / EMISSION_MULTIPLIER_SCALING_FACTOR) - + totalClaimedNeuro; + } + function _checkHubOwner() internal view virtual { require(msg.sender == hub.owner(), "Fn can only be used by hub owner"); } @@ -514,7 +599,7 @@ contract ParanetNeuroIncentivesPool is Named, Versioned { } function _checkParanetOperator() internal view virtual { - require(isParanetOperator(msg.sender), "Caller isn't the owner of the Paranet Knowledge Asset"); + require(isParanetOperator(msg.sender), "Fn can only be used by operator"); } function _checkParanetIncentivizationProposalVoter() internal view virtual { diff --git a/contracts/v2/storage/NodeOperatorFeesStorage.sol b/contracts/v2/storage/NodeOperatorFeesStorage.sol index 219f9335..4fcd0fd9 100644 --- a/contracts/v2/storage/NodeOperatorFeesStorage.sol +++ b/contracts/v2/storage/NodeOperatorFeesStorage.sol @@ -45,7 +45,7 @@ contract NodeOperatorFeesStorage is Named, Versioned, HubDependentV2 { function migrateOldOperatorFees(NodeOperatorStructs.OperatorFees[] memory legacyFees) external timeLimited { for (uint i; i < legacyFees.length; ) { - require(operatorFees[legacyFees[i].identityId].length == 0); + require(operatorFees[legacyFees[i].identityId].length == 0, "Fee already migrated"); operatorFees[legacyFees[i].identityId] = legacyFees[i].fees; unchecked { diff --git a/contracts/v2/storage/paranets/ParanetKnowledgeAssetsRegistry.sol b/contracts/v2/storage/paranets/ParanetKnowledgeAssetsRegistry.sol index 696c6094..cd316391 100644 --- a/contracts/v2/storage/paranets/ParanetKnowledgeAssetsRegistry.sol +++ b/contracts/v2/storage/paranets/ParanetKnowledgeAssetsRegistry.sol @@ -12,7 +12,7 @@ contract ParanetKnowledgeAssetsRegistry is Named, Versioned, HubDependentV2 { string private constant _VERSION = "2.0.0"; // Knowledge Asset ID => Knowledge Asset On Paranet - mapping(bytes32 => ParanetStructs.KnowledgeAsset) knowledgeAssets; + mapping(bytes32 => ParanetStructs.KnowledgeAsset) internal knowledgeAssets; // solhint-disable-next-line no-empty-blocks constructor(address hubAddress) HubDependentV2(hubAddress) {} diff --git a/contracts/v2/storage/paranets/ParanetKnowledgeMinersRegistry.sol b/contracts/v2/storage/paranets/ParanetKnowledgeMinersRegistry.sol index 7152f0ba..58fbb44b 100644 --- a/contracts/v2/storage/paranets/ParanetKnowledgeMinersRegistry.sol +++ b/contracts/v2/storage/paranets/ParanetKnowledgeMinersRegistry.sol @@ -15,7 +15,7 @@ contract ParanetKnowledgeMinersRegistry is Named, Versioned, HubDependentV2 { ParanetsRegistry public paranetsRegistry; // Address => Knowledge Miner Profile - mapping(address => ParanetStructs.KnowledgeMiner) knowledgeMiners; + mapping(address => ParanetStructs.KnowledgeMiner) internal knowledgeMiners; // solhint-disable-next-line no-empty-blocks constructor(address hubAddress) HubDependentV2(hubAddress) {} @@ -379,7 +379,7 @@ contract ParanetKnowledgeMinersRegistry is Named, Versioned, HubDependentV2 { function _checkSender(bytes32 paranetId) internal view virtual { require( hub.isContract(msg.sender) || paranetsRegistry.hasIncentivesPoolByAddress(paranetId, msg.sender), - "Fn can only be called by the hub contracts or Paranet incentives pool" + "Hub/IncentivesPool function" ); } } diff --git a/contracts/v2/storage/paranets/ParanetServicesRegistry.sol b/contracts/v2/storage/paranets/ParanetServicesRegistry.sol index 81968311..f1eb7ecd 100644 --- a/contracts/v2/storage/paranets/ParanetServicesRegistry.sol +++ b/contracts/v2/storage/paranets/ParanetServicesRegistry.sol @@ -12,7 +12,7 @@ contract ParanetServicesRegistry is Named, Versioned, HubDependentV2 { string private constant _VERSION = "2.1.0"; // Paranet Service ID => Paranet Service Object - mapping(bytes32 => ParanetStructs.ParanetService) paranetServices; + mapping(bytes32 => ParanetStructs.ParanetService) internal paranetServices; // solhint-disable-next-line no-empty-blocks constructor(address hubAddress) HubDependentV2(hubAddress) {} diff --git a/contracts/v2/storage/paranets/ParanetsRegistry.sol b/contracts/v2/storage/paranets/ParanetsRegistry.sol index f6012d89..3db06ffe 100644 --- a/contracts/v2/storage/paranets/ParanetsRegistry.sol +++ b/contracts/v2/storage/paranets/ParanetsRegistry.sol @@ -16,7 +16,7 @@ contract ParanetsRegistry is Named, Versioned, HubDependentV2 { string private constant _VERSION = "2.1.0"; // Paranet ID => Paranet Object - mapping(bytes32 => ParanetStructs.Paranet) paranets; + mapping(bytes32 => ParanetStructs.Paranet) internal paranets; // solhint-disable-next-line no-empty-blocks constructor(address hubAddress) HubDependentV2(hubAddress) {} diff --git a/contracts/v2/structs/paranets/ParanetStructs.sol b/contracts/v2/structs/paranets/ParanetStructs.sol index a587d471..a2419ec3 100644 --- a/contracts/v2/structs/paranets/ParanetStructs.sol +++ b/contracts/v2/structs/paranets/ParanetStructs.sol @@ -97,6 +97,11 @@ library ParanetStructs { bool finalized; } + struct ParanetIncentivesPoolClaimedRewardsProfile { + address addr; + uint256 claimedNeuro; + } + struct ParanetIncentivizationProposalVoterInput { address addr; uint96 weight; diff --git a/deploy/024_deploy_paranets_registry.ts b/deploy/024_deploy_paranets_registry.ts index 9256b715..dab48c2b 100644 --- a/deploy/024_deploy_paranets_registry.ts +++ b/deploy/024_deploy_paranets_registry.ts @@ -2,10 +2,6 @@ import { DeployFunction } from 'hardhat-deploy/types'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - if (!hre.network.name.startsWith('otp') && !hre.network.name.startsWith('hardhat')) { - return; - } - await hre.helpers.deploy({ newContractName: 'ParanetsRegistry', }); diff --git a/deploy/025_deploy_paranet_services_registry.ts b/deploy/025_deploy_paranet_services_registry.ts index 1d3e3821..fee4e025 100644 --- a/deploy/025_deploy_paranet_services_registry.ts +++ b/deploy/025_deploy_paranet_services_registry.ts @@ -2,10 +2,6 @@ import { DeployFunction } from 'hardhat-deploy/types'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - if (!hre.network.name.startsWith('otp') && !hre.network.name.startsWith('hardhat')) { - return; - } - await hre.helpers.deploy({ newContractName: 'ParanetServicesRegistry', }); diff --git a/deploy/026_deploy_paranet_knowledge_assets_registry.ts b/deploy/026_deploy_paranet_knowledge_assets_registry.ts index 87f74bb7..d49cb753 100644 --- a/deploy/026_deploy_paranet_knowledge_assets_registry.ts +++ b/deploy/026_deploy_paranet_knowledge_assets_registry.ts @@ -2,10 +2,6 @@ import { DeployFunction } from 'hardhat-deploy/types'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - if (!hre.network.name.startsWith('otp') && !hre.network.name.startsWith('hardhat')) { - return; - } - await hre.helpers.deploy({ newContractName: 'ParanetKnowledgeAssetsRegistry', }); diff --git a/deploy/027_deploy_paranet_knowledge_miners_registry.ts b/deploy/027_deploy_paranet_knowledge_miners_registry.ts index 181fb244..8d7825e4 100644 --- a/deploy/027_deploy_paranet_knowledge_miners_registry.ts +++ b/deploy/027_deploy_paranet_knowledge_miners_registry.ts @@ -2,10 +2,6 @@ import { DeployFunction } from 'hardhat-deploy/types'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - if (!hre.network.name.startsWith('otp') && !hre.network.name.startsWith('hardhat')) { - return; - } - await hre.helpers.deploy({ newContractName: 'ParanetKnowledgeMinersRegistry', }); diff --git a/deploy/045_deploy_paranet.ts b/deploy/045_deploy_paranet.ts index 692d5ae6..af645aa3 100644 --- a/deploy/045_deploy_paranet.ts +++ b/deploy/045_deploy_paranet.ts @@ -2,10 +2,6 @@ import { DeployFunction } from 'hardhat-deploy/types'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - if (!hre.network.name.startsWith('otp') && !hre.network.name.startsWith('hardhat')) { - return; - } - await hre.helpers.deploy({ newContractName: 'Paranet', }); diff --git a/deploy/046_deploy_paranet_incentives_pool_factory.ts b/deploy/046_deploy_paranet_incentives_pool_factory.ts new file mode 100644 index 00000000..909877d3 --- /dev/null +++ b/deploy/046_deploy_paranet_incentives_pool_factory.ts @@ -0,0 +1,16 @@ +import { DeployFunction } from 'hardhat-deploy/types'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + if (!hre.network.name.startsWith('otp') && !hre.network.name.startsWith('hardhat')) { + return; + } + + await hre.helpers.deploy({ + newContractName: 'ParanetIncentivesPoolFactory', + }); +}; + +export default func; +func.tags = ['ParanetIncentivesPoolFactory', 'v2']; +func.dependencies = ['HubV2', 'ParanetsRegistry']; diff --git a/deployments/gnosis_chiado_dev_contracts.json b/deployments/gnosis_chiado_dev_contracts.json index c850cf8f..cc8f0c61 100644 --- a/deployments/gnosis_chiado_dev_contracts.json +++ b/deployments/gnosis_chiado_dev_contracts.json @@ -272,6 +272,60 @@ "deploymentBlock": 10291472, "deploymentTimestamp": 1718285932780, "deployed": true + }, + "ParanetsRegistry": { + "evmAddress": "0x92DA04556bdfd62ddFFf983Ee004e6F4a98bE671", + "version": "2.1.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e", + "deploymentBlock": 10357784, + "deploymentTimestamp": 1718619599253, + "deployed": true + }, + "ParanetServicesRegistry": { + "evmAddress": "0xD94CD8Adc95697266553bd24FcbA3E47122D4bDa", + "version": "2.1.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e", + "deploymentBlock": 10357786, + "deploymentTimestamp": 1718619609325, + "deployed": true + }, + "ParanetKnowledgeAssetsRegistry": { + "evmAddress": "0xe46CAaee3fd9556692f90181aDa517e20d9eD9cC", + "version": "2.0.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e", + "deploymentBlock": 10357788, + "deploymentTimestamp": 1718619619120, + "deployed": true + }, + "ParanetKnowledgeMinersRegistry": { + "evmAddress": "0xC1FD9aC1987652F540A4eE5b8A5e9901bE013A8c", + "version": "2.0.1", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e", + "deploymentBlock": 10357790, + "deploymentTimestamp": 1718619629017, + "deployed": true + }, + "Paranet": { + "evmAddress": "0x9E41D4c1338e3eACeD512c0d6CDc670c5563764f", + "version": "2.1.3", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e", + "deploymentBlock": 10357793, + "deploymentTimestamp": 1718619642976, + "deployed": true + }, + "ParanetIncentivesPoolFactory": { + "evmAddress": "0xEA7932aDfA759BA6D78c42bCE6De6258768F7b4e", + "version": "2.0.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e", + "deploymentBlock": 10357795, + "deploymentTimestamp": 1718619653053, + "deployed": true } } } diff --git a/deployments/gnosis_chiado_test_contracts.json b/deployments/gnosis_chiado_test_contracts.json index 3b98a0dc..0b232a8d 100644 --- a/deployments/gnosis_chiado_test_contracts.json +++ b/deployments/gnosis_chiado_test_contracts.json @@ -272,6 +272,51 @@ "deploymentBlock": 9396771, "deploymentTimestamp": 1713792119057, "deployed": true + }, + "ParanetsRegistry": { + "evmAddress": "0x3Dd6e2baEd8e28fB8bB20a6C7d520eB111c7b85A", + "version": "2.1.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "bbf78d963b46a63c4c55fd6a82fc0bbdb59c40bc", + "deploymentBlock": 10360038, + "deploymentTimestamp": 1718630966354, + "deployed": true + }, + "ParanetServicesRegistry": { + "evmAddress": "0x5978e2507a818c469CC4b1202493e48365eD74A4", + "version": "2.1.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "bbf78d963b46a63c4c55fd6a82fc0bbdb59c40bc", + "deploymentBlock": 10360039, + "deploymentTimestamp": 1718630972351, + "deployed": true + }, + "ParanetKnowledgeAssetsRegistry": { + "evmAddress": "0xEA68509e996305002965BFa5c8314529457136F7", + "version": "2.0.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "bbf78d963b46a63c4c55fd6a82fc0bbdb59c40bc", + "deploymentBlock": 10360040, + "deploymentTimestamp": 1718630978043, + "deployed": true + }, + "ParanetKnowledgeMinersRegistry": { + "evmAddress": "0x7D61Ab26c2B644b2ae20AA5E16845bA3Ea6d25f7", + "version": "2.0.1", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "bbf78d963b46a63c4c55fd6a82fc0bbdb59c40bc", + "deploymentBlock": 10360042, + "deploymentTimestamp": 1718630988275, + "deployed": true + }, + "Paranet": { + "evmAddress": "0x69Ca47Ccb0c9838417Ef001eCE184350b41f9Ff7", + "version": "2.1.3", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "bbf78d963b46a63c4c55fd6a82fc0bbdb59c40bc", + "deploymentBlock": 10360044, + "deploymentTimestamp": 1718630997982, + "deployed": true } } } diff --git a/deployments/gnosis_mainnet_contracts.json b/deployments/gnosis_mainnet_contracts.json index e09ffc06..cd6fa710 100644 --- a/deployments/gnosis_mainnet_contracts.json +++ b/deployments/gnosis_mainnet_contracts.json @@ -280,6 +280,51 @@ "deploymentBlock": 34206991, "deploymentTimestamp": 1717062353134, "deployed": true + }, + "ParanetsRegistry": { + "evmAddress": "0xe0Be6F5a415eF20CE763e9927d901145c00f8aB4", + "version": "2.1.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "4cef06a0b27b03e64d68215f5b3df091b73e31e2", + "deploymentBlock": 34510987, + "deploymentTimestamp": 1718631494369, + "deployed": true + }, + "ParanetServicesRegistry": { + "evmAddress": "0xe8cF6A3b5Ae913F280A27F94461eEb0F2a8969b9", + "version": "2.1.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "4cef06a0b27b03e64d68215f5b3df091b73e31e2", + "deploymentBlock": 34510989, + "deploymentTimestamp": 1718631509049, + "deployed": true + }, + "ParanetKnowledgeAssetsRegistry": { + "evmAddress": "0x1f7ce865a32928E202346136f5f73EB1757067dD", + "version": "2.0.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "4cef06a0b27b03e64d68215f5b3df091b73e31e2", + "deploymentBlock": 34510991, + "deploymentTimestamp": 1718631518947, + "deployed": true + }, + "ParanetKnowledgeMinersRegistry": { + "evmAddress": "0x7c9ea1bCa803F02B2985C84038e6233c51213930", + "version": "2.0.1", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "4cef06a0b27b03e64d68215f5b3df091b73e31e2", + "deploymentBlock": 34510993, + "deploymentTimestamp": 1718631529879, + "deployed": true + }, + "Paranet": { + "evmAddress": "0xb3271af260275d16f73d4a033B61d0bD8c45f264", + "version": "2.1.3", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "4cef06a0b27b03e64d68215f5b3df091b73e31e2", + "deploymentBlock": 34510996, + "deploymentTimestamp": 1718631542236, + "deployed": true } } } diff --git a/deployments/otp_devnet_contracts.json b/deployments/otp_devnet_contracts.json index 5eb53534..93e0a1b1 100644 --- a/deployments/otp_devnet_contracts.json +++ b/deployments/otp_devnet_contracts.json @@ -298,13 +298,23 @@ "deployed": true }, "Paranet": { - "evmAddress": "0xF1920c4adDC7331a539c51D982F3333ABADEbAEc", - "substrateAddress": "5EMjsd1AaaFrX9VpFayhKrebBj2jSyjSGBkAoSVGMc9cseAQ", - "version": "2.1.2", - "gitBranch": "improvement/paranet-incentives-calculation", - "gitCommitHash": "f52e4b5ec305ec0bc4f7652f406f081c07d6010c", - "deploymentBlock": 4815045, - "deploymentTimestamp": 1718280004064, + "evmAddress": "0x6d4A6735A2374060414FfcEc5831b36E1a8fA9F5", + "substrateAddress": "5EMjsczi5GNdXFJhu8U3D1Qr23LX3iqfPvPNEp2bDxS9DtXj", + "version": "2.1.3", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e", + "deploymentBlock": 4839391, + "deploymentTimestamp": 1718619698948, + "deployed": true + }, + "ParanetIncentivesPoolFactory": { + "evmAddress": "0xdE16b54Fa1B072CCc04b2cB3582C8442b65e17e9", + "substrateAddress": "5EMjsd16gATWP6KF8TUqLLTCBd1Fb7QxahGuTURpJ6eRu8gj", + "version": "2.0.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e", + "deploymentBlock": 4839392, + "deploymentTimestamp": 1718619716473, "deployed": true } }, diff --git a/deployments/otp_mainnet_contracts.json b/deployments/otp_mainnet_contracts.json index 918f82f2..f9f6b2be 100644 --- a/deployments/otp_mainnet_contracts.json +++ b/deployments/otp_mainnet_contracts.json @@ -297,13 +297,23 @@ "deployed": true }, "Paranet": { - "evmAddress": "0x436fec301f1A8a109EeB5491D75c5f8df09A4B10", - "substrateAddress": "5EMjsczZgrrpHpeCoNYtWLUqGHt3PXfJcehdQXGzH67C1kUk", - "version": "2.1.2", - "gitBranch": "deployment/4.3.0", - "gitCommitHash": "7bd7fcbc9d5e8bfa5eb47573d57b0958515aca00", - "deploymentBlock": 5134304, - "deploymentTimestamp": 1718285527615, + "evmAddress": "0xAC2504326F31429938A890FC7847968874faAf71", + "substrateAddress": "5EMjsczvfjPWsLX4vm26dLoNTyKvMa3M7zpg1arxLY6Syxm6", + "version": "2.1.3", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "4cef06a0b27b03e64d68215f5b3df091b73e31e2", + "deploymentBlock": 5162780, + "deploymentTimestamp": 1718631412679, + "deployed": true + }, + "ParanetIncentivesPoolFactory": { + "evmAddress": "0x7749834AB8152de91B9b3252Da7750247F52F495", + "substrateAddress": "5EMjsczk5SaUrPcwJmAgXPbxqdWmWduN6z3JV6tSJAReRtJx", + "version": "2.0.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "4cef06a0b27b03e64d68215f5b3df091b73e31e2", + "deploymentBlock": 5162782, + "deploymentTimestamp": 1718631441728, "deployed": true } }, diff --git a/deployments/otp_testnet_contracts.json b/deployments/otp_testnet_contracts.json index a5fbcf4b..70a72569 100644 --- a/deployments/otp_testnet_contracts.json +++ b/deployments/otp_testnet_contracts.json @@ -286,13 +286,23 @@ "deployed": true }, "Paranet": { - "evmAddress": "0x130B3191cA664619bC052aE9C93F04B335Cf7E65", - "substrateAddress": "5EMjsczPzT1EEVxyARHYG7xjBX8heREfjrqpBTDtsUUVQ7mp", - "version": "2.1.2", - "gitBranch": "improvement/paranet-incentives-calculation", - "gitCommitHash": "f52e4b5ec305ec0bc4f7652f406f081c07d6010c", - "deploymentBlock": 4095343, - "deploymentTimestamp": 1718280282828, + "evmAddress": "0x4751B9C2Beaea2555c7331F46c12D11E27Bfb1f2", + "substrateAddress": "5EMjsczaTyZzYUkgqsZn2CjR1XJQyNA1EZDFni7dZGQYrAfi", + "version": "2.1.3", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "bbf78d963b46a63c4c55fd6a82fc0bbdb59c40bc", + "deploymentBlock": 4108246, + "deploymentTimestamp": 1718630775260, + "deployed": true + }, + "ParanetIncentivesPoolFactory": { + "evmAddress": "0x043F6aBBfd8882acb4f71C49E7f4Bd71271d5FD0", + "substrateAddress": "5EMjsczM2VgpRxsY2B7g23uW33fR21633UMZZUxA6owKPXt6", + "version": "2.0.0", + "gitBranch": "improvement/paranet-incentives-additional-getters", + "gitCommitHash": "bbf78d963b46a63c4c55fd6a82fc0bbdb59c40bc", + "deploymentBlock": 4108247, + "deploymentTimestamp": 1718630808590, "deployed": true } }, diff --git a/deployments/parameters.json b/deployments/parameters.json index 5644a282..5a086b85 100644 --- a/deployments/parameters.json +++ b/deployments/parameters.json @@ -471,6 +471,9 @@ "setterArgs": [5, false] } ] + }, + "LinearSum": { + "w2": "50" } } }, diff --git a/index.ts b/index.ts index a132e96e..e4454a6f 100644 --- a/index.ts +++ b/index.ts @@ -31,6 +31,7 @@ import Named from './abi/Named.json'; import NodeOperatorFeesStorage from './abi/NodeOperatorFeesStorage.json'; import ParametersStorage from './abi/ParametersStorage.json'; import Paranet from './abi/Paranet.json'; +import ParanetIncentivesPoolFactory from './abi/ParanetIncentivesPoolFactory.json'; import ParanetKnowledgeAssetsRegistry from './abi/ParanetKnowledgeAssetsRegistry.json'; import ParanetKnowledgeMinersRegistry from './abi/ParanetKnowledgeMinersRegistry.json'; import ParanetNeuroIncentivesPool from './abi/ParanetNeuroIncentivesPool.json'; @@ -113,6 +114,7 @@ const ABIV2 = { LinearSum, NodeOperatorFeesStorage, Paranet, + ParanetIncentivesPoolFactory, ParanetKnowledgeAssetsRegistry, ParanetKnowledgeMinersRegistry, ParanetServicesRegistry, @@ -151,6 +153,7 @@ export { Log2PLDSF as Log2PLDSFABI, NodeOperatorFeesStorage as NodeOperatorFeesStorageABI, Paranet as ParanetABI, + ParanetIncentivesPoolFactory as ParanetIncentivesPoolFactoryABI, ParanetKnowledgeAssetsRegistry as ParanetKnowledgeAssetsRegistryABI, ParanetKnowledgeMinersRegistry as ParanetKnowledgeMinersRegistryABI, ParanetServicesRegistry as ParanetServicesRegistryABI, diff --git a/package-lock.json b/package-lock.json index 792017c5..a73cd185 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dkg-evm-module", - "version": "4.3.0", + "version": "4.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dkg-evm-module", - "version": "4.3.0", + "version": "4.3.1", "license": "Apache-2.0", "dependencies": { "@openzeppelin/contracts": "^4.9.3", @@ -1717,9 +1717,9 @@ } }, "node_modules/@openzeppelin/contracts": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", - "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.6.tgz", + "integrity": "sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==" }, "node_modules/@openzeppelin/test-helpers": { "version": "0.5.16", @@ -2852,17 +2852,18 @@ } }, "node_modules/@truffle/contract": { - "version": "4.6.29", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.6.29.tgz", - "integrity": "sha512-gbgmC2YdcSD4QGvx3GWGIVhyQxEPkChcC2a3D5d9aj2XfV3f6+FQw5PuL1wreA3I222ggZQqzbvMvhpp8gWs4Q==", + "version": "4.6.31", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.6.31.tgz", + "integrity": "sha512-s+oHDpXASnZosiCdzu+X1Tx5mUJUs1L1CYXIcgRmzMghzqJkaUFmR6NpNo7nJYliYbO+O9/aW8oCKqQ7rCHfmQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "dependencies": { "@ensdomains/ensjs": "^2.1.0", - "@truffle/blockchain-utils": "^0.1.8", - "@truffle/contract-schema": "^3.4.15", - "@truffle/debug-utils": "^6.0.56", - "@truffle/error": "^0.2.1", - "@truffle/interface-adapter": "^0.5.36", + "@truffle/blockchain-utils": "^0.1.9", + "@truffle/contract-schema": "^3.4.16", + "@truffle/debug-utils": "^6.0.57", + "@truffle/error": "^0.2.2", + "@truffle/interface-adapter": "^0.5.37", "bignumber.js": "^7.2.1", "debug": "^4.3.1", "ethers": "^4.0.32", @@ -2871,6 +2872,9 @@ "web3-core-promievent": "1.10.0", "web3-eth-abi": "1.10.0", "web3-utils": "1.10.0" + }, + "engines": { + "node": "^16.20 || ^18.16 || >=20" } }, "node_modules/@truffle/contract-schema": { @@ -4626,21 +4630,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -4678,11 +4667,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -5712,9 +5701,9 @@ } }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "dev": true, "engines": { "node": ">= 0.6" @@ -6582,14 +6571,15 @@ } }, "node_modules/es5-ext": { - "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "dev": true, "hasInstallScript": true, "dependencies": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", "next-tick": "^1.1.0" }, "engines": { @@ -7211,6 +7201,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "dev": true, + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esniff/node_modules/type": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", + "dev": true + }, "node_modules/espree": { "version": "9.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", @@ -7592,6 +7603,16 @@ "npm": ">=3" } }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "dev": true, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "node_modules/event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", @@ -7691,17 +7712,17 @@ } }, "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -7732,60 +7753,6 @@ "node": ">= 0.10.0" } }, - "node_modules/express/node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/express/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/express/node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/ext": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", @@ -7952,9 +7919,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -8043,9 +8010,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -8747,23 +8714,34 @@ } }, "node_modules/hardhat-deploy": { - "version": "0.11.25", - "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.25.tgz", - "integrity": "sha512-ppSgrVE9A13YgTmf2PQGoyIs9o/jgJOMORrUP/rblU5K8mQ2YHWlPvkzZmP4h+SBW+tNmlnvSrf5K5DmMmExhw==", + "version": "0.11.45", + "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.45.tgz", + "integrity": "sha512-aC8UNaq3JcORnEUIwV945iJuvBwi65tjHVDU3v6mOcqik7WAzHVCJ7cwmkkipsHrWysrB5YvGF1q9S1vIph83w==", "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/contracts": "^5.7.0", + "@ethersproject/providers": "^5.7.2", + "@ethersproject/solidity": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wallet": "^5.7.0", "@types/qs": "^6.9.7", "axios": "^0.21.1", "chalk": "^4.1.2", "chokidar": "^3.5.2", "debug": "^4.3.2", "enquirer": "^2.3.6", - "ethers": "^5.5.3", + "ethers": "^5.7.0", "form-data": "^4.0.0", "fs-extra": "^10.0.0", "match-all": "^1.2.6", "murmur-128": "^0.2.1", "qs": "^6.9.4", - "zksync-web3": "^0.8.1" + "zksync-web3": "^0.14.3" } }, "node_modules/hardhat-deploy-ethers": { @@ -12374,9 +12352,9 @@ ] }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dependencies": { "side-channel": "^1.0.4" }, @@ -15496,9 +15474,9 @@ } }, "node_modules/undici": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.0.tgz", - "integrity": "sha512-l3ydWhlhOJzMVOYkymLykcRRXqbUaQriERtR70B9LzNkZ4bX52Fc8wbTDneMiwo8T+AemZXvXaTx+9o5ROxrXg==", + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -16416,11 +16394,12 @@ } }, "node_modules/zksync-web3": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.8.1.tgz", - "integrity": "sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw==", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.4.tgz", + "integrity": "sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==", + "deprecated": "This package has been deprecated in favor of zksync-ethers@5.0.0", "peerDependencies": { - "ethers": "~5.7.0" + "ethers": "^5.7.0" } } }, @@ -17506,9 +17485,9 @@ } }, "@openzeppelin/contracts": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", - "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.6.tgz", + "integrity": "sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==" }, "@openzeppelin/test-helpers": { "version": "0.5.16", @@ -18427,17 +18406,17 @@ } }, "@truffle/contract": { - "version": "4.6.29", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.6.29.tgz", - "integrity": "sha512-gbgmC2YdcSD4QGvx3GWGIVhyQxEPkChcC2a3D5d9aj2XfV3f6+FQw5PuL1wreA3I222ggZQqzbvMvhpp8gWs4Q==", + "version": "4.6.31", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.6.31.tgz", + "integrity": "sha512-s+oHDpXASnZosiCdzu+X1Tx5mUJUs1L1CYXIcgRmzMghzqJkaUFmR6NpNo7nJYliYbO+O9/aW8oCKqQ7rCHfmQ==", "dev": true, "requires": { "@ensdomains/ensjs": "^2.1.0", - "@truffle/blockchain-utils": "^0.1.8", - "@truffle/contract-schema": "^3.4.15", - "@truffle/debug-utils": "^6.0.56", - "@truffle/error": "^0.2.1", - "@truffle/interface-adapter": "^0.5.36", + "@truffle/blockchain-utils": "^0.1.9", + "@truffle/contract-schema": "^3.4.16", + "@truffle/debug-utils": "^6.0.57", + "@truffle/error": "^0.2.2", + "@truffle/interface-adapter": "^0.5.37", "bignumber.js": "^7.2.1", "debug": "^4.3.1", "ethers": "^4.0.32", @@ -19760,17 +19739,6 @@ "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" - }, - "dependencies": { - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } - } } }, "boolbase": { @@ -19804,11 +19772,11 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "brorand": { @@ -20601,9 +20569,9 @@ "dev": true }, "cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "dev": true }, "cookie-signature": { @@ -21275,13 +21243,14 @@ } }, "es5-ext": { - "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "dev": true, "requires": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", "next-tick": "^1.1.0" } }, @@ -21738,6 +21707,26 @@ "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true }, + "esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "dev": true, + "requires": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "dependencies": { + "type": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", + "dev": true + } + } + }, "espree": { "version": "9.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", @@ -22071,6 +22060,16 @@ "strip-hex-prefix": "1.0.0" } }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", @@ -22142,17 +22141,17 @@ } }, "express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dev": true, "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -22178,49 +22177,6 @@ "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" - }, - "dependencies": { - "body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - } - }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } - }, - "raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - } } }, "ext": { @@ -22355,9 +22311,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "requires": { "to-regex-range": "^5.0.1" } @@ -22425,9 +22381,9 @@ } }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" }, "for-each": { "version": "0.3.3", @@ -23168,23 +23124,34 @@ } }, "hardhat-deploy": { - "version": "0.11.25", - "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.25.tgz", - "integrity": "sha512-ppSgrVE9A13YgTmf2PQGoyIs9o/jgJOMORrUP/rblU5K8mQ2YHWlPvkzZmP4h+SBW+tNmlnvSrf5K5DmMmExhw==", + "version": "0.11.45", + "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.45.tgz", + "integrity": "sha512-aC8UNaq3JcORnEUIwV945iJuvBwi65tjHVDU3v6mOcqik7WAzHVCJ7cwmkkipsHrWysrB5YvGF1q9S1vIph83w==", "requires": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/contracts": "^5.7.0", + "@ethersproject/providers": "^5.7.2", + "@ethersproject/solidity": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wallet": "^5.7.0", "@types/qs": "^6.9.7", "axios": "^0.21.1", "chalk": "^4.1.2", "chokidar": "^3.5.2", "debug": "^4.3.2", "enquirer": "^2.3.6", - "ethers": "^5.5.3", + "ethers": "^5.7.0", "form-data": "^4.0.0", "fs-extra": "^10.0.0", "match-all": "^1.2.6", "murmur-128": "^0.2.1", "qs": "^6.9.4", - "zksync-web3": "^0.8.1" + "zksync-web3": "^0.14.3" }, "dependencies": { "chalk": { @@ -25659,9 +25626,9 @@ "dev": true }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "^1.0.4" } @@ -28075,9 +28042,9 @@ } }, "undici": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.0.tgz", - "integrity": "sha512-l3ydWhlhOJzMVOYkymLykcRRXqbUaQriERtR70B9LzNkZ4bX52Fc8wbTDneMiwo8T+AemZXvXaTx+9o5ROxrXg==", + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", "requires": { "@fastify/busboy": "^2.0.0" } @@ -28826,9 +28793,9 @@ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" }, "zksync-web3": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.8.1.tgz", - "integrity": "sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw==", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.4.tgz", + "integrity": "sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==", "requires": {} } } diff --git a/package.json b/package.json index 00777daa..edc49a57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dkg-evm-module", - "version": "4.3.0", + "version": "4.3.1", "description": "Smart contracts for OriginTrail V6", "main": "index.ts", "files": [ diff --git a/test/v2/integration/Paranet.test.ts b/test/v2/integration/Paranet.test.ts index 9ddc0b6b..9ed9a413 100644 --- a/test/v2/integration/Paranet.test.ts +++ b/test/v2/integration/Paranet.test.ts @@ -16,6 +16,7 @@ import { ServiceAgreementV1, ContentAssetStorageV2, Token, + ParanetIncentivesPoolFactory, } from '../../../typechain'; import { ContentAssetStructs } from '../../../typechain/contracts/v2/assets/ContentAsset.sol/ContentAssetV2'; @@ -28,6 +29,7 @@ type ParanetNeuroIncentivesPoolFixture = { ParanetKnowledgeMinersRegistry: ParanetKnowledgeMinersRegistry; ParanetsRegistry: ParanetsRegistry; Paranet: Paranet; + ParanetIncentivesPoolFactory: ParanetIncentivesPoolFactory; }; describe('@v2 @integration Paranet', function () { @@ -42,6 +44,7 @@ describe('@v2 @integration Paranet', function () { let ParanetKnowledgeMinersRegistry: ParanetKnowledgeMinersRegistry; let ParanetsRegistry: ParanetsRegistry; let Paranet: Paranet; + let ParanetIncentivesPoolFactory: ParanetIncentivesPoolFactory; async function deployParanetNeuroIncentivesPoolFixture(): Promise { await hre.deployments.fixture([ @@ -50,6 +53,7 @@ describe('@v2 @integration Paranet', function () { 'ContentAssetStorageV2', 'ContentAssetV2', 'Paranet', + 'ParanetIncentivesPoolFactory', ]); ContentAssetStorage = await hre.ethers.getContract('ContentAssetStorage'); @@ -62,6 +66,9 @@ describe('@v2 @integration Paranet', function () { ); ParanetsRegistry = await hre.ethers.getContract('ParanetsRegistry'); Paranet = await hre.ethers.getContract('Paranet'); + ParanetIncentivesPoolFactory = await hre.ethers.getContract( + 'ParanetIncentivesPoolFactory', + ); accounts = await hre.ethers.getSigners(); @@ -77,6 +84,7 @@ describe('@v2 @integration Paranet', function () { ParanetKnowledgeMinersRegistry, ParanetsRegistry, Paranet, + ParanetIncentivesPoolFactory, }; } @@ -114,7 +122,7 @@ describe('@v2 @integration Paranet', function () { ); await tx1.wait(); - const tx2 = await Paranet.connect(operator).deployNeuroIncentivesPool( + const tx2 = await ParanetIncentivesPoolFactory.connect(operator).deployNeuroIncentivesPool( ContentAssetStorage.address, paranetKATokenId, tracToNeuroEmissionMultiplier, @@ -145,6 +153,7 @@ describe('@v2 @integration Paranet', function () { ParanetKnowledgeMinersRegistry, ParanetsRegistry, Paranet, + ParanetIncentivesPoolFactory, } = await loadFixture(deployParanetNeuroIncentivesPoolFixture)); operator = accounts[1]; diff --git a/test/v2/unit/Paranet.test.ts b/test/v2/unit/Paranet.test.ts index d71f4776..9a2b8b4d 100644 --- a/test/v2/unit/Paranet.test.ts +++ b/test/v2/unit/Paranet.test.ts @@ -17,6 +17,7 @@ import { ParanetNeuroIncentivesPool, Token, ServiceAgreementV1, + ParanetIncentivesPoolFactory, } from '../../../typechain'; import { ParanetStructs } from '../../../typechain/contracts/v2/paranets/Paranet'; @@ -30,6 +31,7 @@ type deployParanetFixture = { ParanetServicesRegistry: ParanetServicesRegistry; ParanetKnowledgeMinersRegistry: ParanetKnowledgeMinersRegistry; ParanetKnowledgeAssetsRegistry: ParanetKnowledgeAssetsRegistry; + ParanetIncentivesPoolFactory: ParanetIncentivesPoolFactory; HashingProxy: HashingProxy; ServiceAgreementStorageProxy: ServiceAgreementStorageProxy; Token: Token; @@ -46,6 +48,7 @@ describe('@v2 @unit ParanetKnowledgeMinersRegistry contract', function () { let ParanetServicesRegistry: ParanetServicesRegistry; let ParanetKnowledgeMinersRegistry: ParanetKnowledgeMinersRegistry; let ParanetKnowledgeAssetsRegistry: ParanetKnowledgeAssetsRegistry; + let ParanetIncentivesPoolFactory: ParanetIncentivesPoolFactory; let HashingProxy: HashingProxy; let ServiceAgreementStorageProxy: ServiceAgreementStorageProxy; let Token: Token; @@ -63,6 +66,7 @@ describe('@v2 @unit ParanetKnowledgeMinersRegistry contract', function () { 'ParanetServicesRegistry', 'ParanetKnowledgeMinersRegistry', 'ParanetKnowledgeAssetsRegistry', + 'ParanetIncentivesPoolFactory', 'HashingProxy', 'ServiceAgreementStorageProxy', 'Token', @@ -83,6 +87,9 @@ describe('@v2 @unit ParanetKnowledgeMinersRegistry contract', function () { ParanetKnowledgeAssetsRegistry = await hre.ethers.getContract( 'ParanetKnowledgeAssetsRegistry', ); + ParanetIncentivesPoolFactory = await hre.ethers.getContract( + 'ParanetIncentivesPoolFactory', + ); ServiceAgreementStorageProxy = await hre.ethers.getContract( 'ServiceAgreementStorageProxy', ); @@ -103,6 +110,7 @@ describe('@v2 @unit ParanetKnowledgeMinersRegistry contract', function () { ParanetServicesRegistry, ParanetKnowledgeMinersRegistry, ParanetKnowledgeAssetsRegistry, + ParanetIncentivesPoolFactory, HashingProxy, ServiceAgreementStorageProxy, Token, @@ -112,15 +120,15 @@ describe('@v2 @unit ParanetKnowledgeMinersRegistry contract', function () { beforeEach(async () => { hre.helpers.resetDeploymentsJson(); - ({ accounts, Paranet } = await loadFixture(deployParanetFixture)); + ({ accounts, Paranet, ParanetIncentivesPoolFactory } = await loadFixture(deployParanetFixture)); }); it('The contract is named "Paranet"', async () => { expect(await Paranet.name()).to.equal('Paranet'); }); - it('The contract is version "2.1.2"', async () => { - expect(await Paranet.version()).to.equal('2.1.2'); + it('The contract is version "2.1.3"', async () => { + expect(await Paranet.version()).to.equal('2.1.3'); }); it('should register paranet', async () => { @@ -951,7 +959,7 @@ describe('@v2 @unit ParanetKnowledgeMinersRegistry contract', function () { paranetName, paranetDescription, ); - await Paranet.connect(accounts[100 + number]).deployNeuroIncentivesPool( + await ParanetIncentivesPoolFactory.connect(accounts[100 + number]).deployNeuroIncentivesPool( paranetKAStorageContract, paranetKATokenId, tracToNeuroEmissionMultiplier, diff --git a/utils/helpers.ts b/utils/helpers.ts index 437d9f77..09d25909 100644 --- a/utils/helpers.ts +++ b/utils/helpers.ts @@ -366,14 +366,12 @@ export class Helpers { } public saveDeploymentsJson(folder: string) { - if (this.hre.network.config.environment !== 'development') { - console.log(`New or redeployed contracts: ${JSON.stringify(this.newContracts)}`); - console.log(`New or redeployed Asset Storage contracts: ${JSON.stringify(this.newAssetStorageContracts)}`); - console.log(`New or redeployed hash functions set in the proxy: ${JSON.stringify(this.newHashFunctions)}`); - console.log(`New or redeployed score functions set in the proxy: ${JSON.stringify(this.newScoreFunctions)}`); - console.log(`Initialized contracts: ${JSON.stringify(this.contractsForReinitialization)}`); - console.log(`Encoded data for parameters settings: ${JSON.stringify(this.setParametersEncodedData)}`); - } + console.log(`New or redeployed contracts: ${JSON.stringify(this.newContracts)}`); + console.log(`New or redeployed Asset Storage contracts: ${JSON.stringify(this.newAssetStorageContracts)}`); + console.log(`New or redeployed hash functions set in the proxy: ${JSON.stringify(this.newHashFunctions)}`); + console.log(`New or redeployed score functions set in the proxy: ${JSON.stringify(this.newScoreFunctions)}`); + console.log(`Initialized contracts: ${JSON.stringify(this.contractsForReinitialization)}`); + console.log(`Encoded data for parameters settings: ${JSON.stringify(this.setParametersEncodedData)}`); fs.writeFileSync( `${folder}/${this.hre.network.name}_contracts.json`,