Skip to content

Commit

Permalink
[V6] Add ERC20 incentive type, improve multiplier (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
brkagithub authored Dec 5, 2024
2 parents 1b622ce + 5cbb2e9 commit a4b775f
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 57 deletions.
17 changes: 8 additions & 9 deletions dkg/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

BLOCKCHAINS = {
"development": {
"hardhat1:31337": {
"hardhat1:31337": {
"hub": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"rpc": "http://localhost:8545",
},
"hardhat2:31337": {
"hardhat2:31337": {
"hub": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"rpc": "http://localhost:9545",
},
Expand All @@ -43,7 +43,7 @@
"base:84532": {
"hub": "0x6C861Cb69300C34DfeF674F7C00E734e840C29C0",
"rpc": "https://sepolia.base.org",
}
},
},
"testnet": {
"otp:20430": {
Expand All @@ -58,7 +58,7 @@
"base:84532": {
"hub": "0x144eDa5cbf8926327cb2cceef168A121F0E4A299",
"rpc": "https://sepolia.base.org",
}
},
},
"mainnet": {
"otp:2043": {
Expand Down Expand Up @@ -88,11 +88,7 @@

DEFAULT_HASH_FUNCTION_ID = 1
DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS = {
"development": {
"hardhat1:31337": 2,
"hardhat2:31337": 2,
"otp:2043": 2
},
"development": {"hardhat1:31337": 2, "hardhat2:31337": 2, "otp:2043": 2},
"devnet": {
"otp:2160": 2,
"gnosis:10200": 2,
Expand All @@ -112,3 +108,6 @@

PRIVATE_HISTORICAL_REPOSITORY = "privateHistory"
PRIVATE_CURRENT_REPOSITORY = "privateCurrent"

NEUROWEB_BLOCKCHAIN_PREFIX = "otp"
INCENTIVE_POOL_NAME = "ParanetNeurowebIncentivesPool"
5 changes: 5 additions & 0 deletions dkg/data/interfaces/ParanetIncentivesPoolFactory.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
},
{
"inputs": [
{
"internalType": "bool",
"name": "isNativeReward",
"type": "bool"
},
{
"internalType": "address",
"name": "paranetKAStorageContract",
Expand Down
71 changes: 51 additions & 20 deletions dkg/data/interfaces/ParanetNeurowebIncentivesPool.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"name": "hubAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "paranetsRegistryAddress",
Expand Down Expand Up @@ -81,19 +86,19 @@
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "oldMultiplier",
"type": "uint256"
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newMultiplier",
"name": "amount",
"type": "uint256"
}
],
"name": "NeuroEmissionMultiplierUpdateFinalized",
"name": "NativeNeuroRewardDeposit",
"type": "event"
},
{
Expand All @@ -110,34 +115,34 @@
"internalType": "uint256",
"name": "newMultiplier",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "NeuroEmissionMultiplierUpdateInitiated",
"name": "NeuroEmissionMultiplierUpdateFinalized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
"indexed": false,
"internalType": "uint256",
"name": "oldMultiplier",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"name": "newMultiplier",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "NeuroRewardDeposit",
"name": "NeuroEmissionMultiplierUpdateInitiated",
"type": "event"
},
{
Expand Down Expand Up @@ -213,7 +218,7 @@
}
],
"internalType": "struct ParanetStructs.ParanetIncentivizationProposalVoterInput[]",
"name": "voters_",
"name": "newVoters",
"type": "tuple[]"
}
],
Expand Down Expand Up @@ -715,6 +720,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isNativeNeuro",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -924,6 +942,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "token",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalMinersClaimedNeuro",
Expand Down
5 changes: 3 additions & 2 deletions dkg/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ class KnowledgeAssetContentVisibility(AutoStrEnumUpperCase):
PRIVATE = auto()


class ParanetIncentivizationType(AutoStrEnumCapitalize):
NEUROWEB = auto()
class ParanetIncentivizationType(Enum):
NEUROWEB = "Neuroweb"
NEUROWEB_ERC20 = "NeurowebERC20"


@dataclass
Expand Down
Loading

0 comments on commit a4b775f

Please sign in to comment.