Skip to content

Commit

Permalink
Merge pull request #349 from OriginTrail/feature/add-token-origin
Browse files Browse the repository at this point in the history
Add token origin
  • Loading branch information
Mihajlo-Pavlovic authored Feb 26, 2025
2 parents 1044949 + a627be9 commit ab554b3
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 129 deletions.
45 changes: 45 additions & 0 deletions abi/ParanetIncentivesPoolStorage.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,25 @@
"name": "RewardTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "oldOrigin",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOrigin",
"type": "address"
}
],
"name": "TokenOriginSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -1299,6 +1318,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOrigin",
"type": "address"
}
],
"name": "setTokenOrigin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -1351,6 +1383,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "tokenOrigin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalMinersclaimedToken",
Expand Down
11 changes: 10 additions & 1 deletion contracts/paranets/ParanetIncentivesPoolStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ contract ParanetIncentivesPoolStorage is INamed, IVersioned, HubDependent, IInit
event VoterRewardClaimed(address indexed voter, uint256 amount);
event IncentivesPoolAddressSet(address indexed oldAddress, address indexed newAddress);
event RewardTransferred(address indexed recipient, uint256 amount);
event TokenOriginSet(address indexed oldOrigin, address indexed newOrigin);

string private constant _NAME = "ParanetIncentivesPoolStorage";
string private constant _VERSION = "1.0.0";
Expand Down Expand Up @@ -61,11 +62,12 @@ contract ParanetIncentivesPoolStorage is INamed, IVersioned, HubDependent, IInit
ParanetLib.ParanetIncentivesPoolClaimedRewardsProfile[] public claimedOperatorRewards;
mapping(address => uint256) public claimedOperatorRewardsIndexes;

// Is this good type ?
uint96 public cumulativeVotersWeight;
ParanetLib.ParanetIncentivizationProposalVoter[] public voters;
mapping(address => uint256) public votersIndexes;

address public tokenOrigin;

constructor(
address hubAddress,
address rewardTokenAddress,
Expand Down Expand Up @@ -464,6 +466,13 @@ contract ParanetIncentivesPoolStorage is INamed, IVersioned, HubDependent, IInit
emit VoterWeightUpdated(voter, oldWeight, newWeight);
}

function setTokenOrigin(address newOrigin) external onlyContracts {
require(newOrigin != address(0), "Token origin cannot be zero address");
address oldOrigin = tokenOrigin;
tokenOrigin = newOrigin;
emit TokenOriginSet(oldOrigin, newOrigin);
}

modifier onlyVotersRegistrar() {
require(msg.sender == votersRegistrar, "Fn can only be used by registrar");
_;
Expand Down
80 changes: 40 additions & 40 deletions deployments/base_sepolia_test_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,75 +191,75 @@
"deployed": true
},
"ParanetsRegistry": {
"evmAddress": "0x9206357dE0470578577Da64824948F5C0c75062e",
"evmAddress": "0xB9668A4321b8a6900289E6aE98D4388570C5935C",
"version": "1.0.1",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 21888878,
"deploymentTimestamp": 1739546047603,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 22191895,
"deploymentTimestamp": 1740152083167,
"deployed": true
},
"ParanetServicesRegistry": {
"evmAddress": "0xD3825ba7f62C64841670e474d5F80DB440761090",
"evmAddress": "0x9aE0D8929546931913e591a8Df44F9E99b38B5c9",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 21888881,
"deploymentTimestamp": 1739546053932,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 22191899,
"deploymentTimestamp": 1740152090458,
"deployed": true
},
"ParanetKnowledgeCollectionsRegistry": {
"evmAddress": "0xEfE1da366bD33D1aa8463E9B426ec9732Cc08d0f",
"evmAddress": "0x558c8C7998fFF417485DD9105834569d3FC84c02",
"version": "1.0.1",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 21888884,
"deploymentTimestamp": 1739546060173,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 22191902,
"deploymentTimestamp": 1740152097326,
"deployed": true
},
"ParanetKnowledgeMinersRegistry": {
"evmAddress": "0x69742927D6C05696e8B9FC44dce8482fE1EAC1a7",
"evmAddress": "0x8E806Cc918438B8eF1fFC02FACCa8B0Da1D9D23A",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 21888887,
"deploymentTimestamp": 1739546066413,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 22191906,
"deploymentTimestamp": 1740152103788,
"deployed": true
},
"ParanetStagingRegistry": {
"evmAddress": "0x68a499Aa96e3Ab9198E3AFd9878a9A1986ce6FD4",
"evmAddress": "0xc7A45b5DA7CdC36462Fe6E86A73e741C2fd56FDE",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 21888890,
"deploymentTimestamp": 1739546072785,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 22191909,
"deploymentTimestamp": 1740152110301,
"deployed": true
},
"Paranet": {
"evmAddress": "0x081Bebed0c8b36031B32a78B115528BD84f11Cb5",
"evmAddress": "0x6C9146151ffe049c3AC93A06382495Ef6DDA8833",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "3b84160f991b8d70ecb453779e76582e1897068a",
"deploymentBlock": 21890338,
"deploymentTimestamp": 1739548969315,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 22191912,
"deploymentTimestamp": 1740152117023,
"deployed": true
},
"ParanetIncentivesPoolFactoryHelper": {
"evmAddress": "0x1Ab3D684d68aeFd45D93AD21D38cec8A021dF92c",
"evmAddress": "0x707d6853BdCA6278592F52314a47E62376B5973B",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 21888897,
"deploymentTimestamp": 1739546085830,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 22191916,
"deploymentTimestamp": 1740152123528,
"deployed": true
},
"ParanetIncentivesPoolFactory": {
"evmAddress": "0xB6C80577a633d33f4f5B1eaC400f8003c10d8eeA",
"evmAddress": "0x6C62F6DFE2Fe65009527956d24E25dDC0ea1F32b",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 21888900,
"deploymentTimestamp": 1739546092097,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 22191919,
"deploymentTimestamp": 1740152129897,
"deployed": true
}
}
Expand Down
80 changes: 40 additions & 40 deletions deployments/gnosis_chiado_test_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,75 +191,75 @@
"deployed": true
},
"ParanetsRegistry": {
"evmAddress": "0xE5d5E772A3c244dB74460Fa4aB8164abc3488b77",
"evmAddress": "0x086830B0b77e7da1CB203cDd53211eDE4f63cbB7",
"version": "1.0.1",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 14320926,
"deploymentTimestamp": 1739545228318,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 14435277,
"deploymentTimestamp": 1740152326034,
"deployed": true
},
"ParanetServicesRegistry": {
"evmAddress": "0xA5dDA9D3E11Cd893c68C6bD18F106F4dA657b217",
"evmAddress": "0xA9786795A83ca13341418F200A63A55c6a8f869A",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 14320928,
"deploymentTimestamp": 1739545237257,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 14435278,
"deploymentTimestamp": 1740152330970,
"deployed": true
},
"ParanetKnowledgeCollectionsRegistry": {
"evmAddress": "0x6e6B1DF2e3C7fA05bFe7B857EC290E09Bb2253E2",
"evmAddress": "0x3dE88f6fBe7C6A393d2341f4a668D2d67d9b8a82",
"version": "1.0.1",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 14320930,
"deploymentTimestamp": 1739545246575,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 14435279,
"deploymentTimestamp": 1740152336117,
"deployed": true
},
"ParanetKnowledgeMinersRegistry": {
"evmAddress": "0x9b9fE20D5C0340D211E5A1773b2d0579b76355Ce",
"evmAddress": "0x094cE4666839224Af7caFb4Ec1F313b8cb3E0caB",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 14320931,
"deploymentTimestamp": 1739545252290,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 14435280,
"deploymentTimestamp": 1740152341495,
"deployed": true
},
"ParanetStagingRegistry": {
"evmAddress": "0x7E13De6397Dc696f5f787CD1b37b7C7Fa9f7C9F9",
"evmAddress": "0x429b460986aFeCB70c5c3a7148ae4df66064F842",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 14320932,
"deploymentTimestamp": 1739545257350,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 14435282,
"deploymentTimestamp": 1740152350739,
"deployed": true
},
"Paranet": {
"evmAddress": "0x1b57cfdcA17834e9236B745c7d2Fe051216C19ea",
"evmAddress": "0xe63903D1263e41F44754a0d006bC11997F9C0086",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "3b84160f991b8d70ecb453779e76582e1897068a",
"deploymentBlock": 14321650,
"deploymentTimestamp": 1739549006694,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 14435283,
"deploymentTimestamp": 1740152355817,
"deployed": true
},
"ParanetIncentivesPoolFactoryHelper": {
"evmAddress": "0x66c1D07945878A5A0D4051a31bC05EDB787f75b0",
"evmAddress": "0x4e51168Fc4132Dda57A5cA274ce6D56027aF7Cc3",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 14320935,
"deploymentTimestamp": 1739545272239,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 14435284,
"deploymentTimestamp": 1740152361177,
"deployed": true
},
"ParanetIncentivesPoolFactory": {
"evmAddress": "0x159bBE54A8F3C8c7f78A1dECA0B8B3e203aa0DE5",
"evmAddress": "0x438ff472D5D8332386640E0a5B172219ffE0159f",
"version": "1.0.0",
"gitBranch": "v8-paranet-update",
"gitCommitHash": "5115bc4b4c82fa3fe42df976f37fc6372056230c",
"deploymentBlock": 14320937,
"deploymentTimestamp": 1739545281595,
"gitBranch": "v8/unit-tests",
"gitCommitHash": "8d80da87bb433669bc4a03aacb0bb5054b3b375c",
"deploymentBlock": 14435285,
"deploymentTimestamp": 1740152366258,
"deployed": true
}
}
Expand Down
Loading

0 comments on commit ab554b3

Please sign in to comment.