Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V6] Add ERC20 incentive type, improve multiplier #42

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 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,5 @@

PRIVATE_HISTORICAL_REPOSITORY = "privateHistory"
PRIVATE_CURRENT_REPOSITORY = "privateCurrent"

NEUROWEB_BLOCKCHAIN_PREFIX = "otp"
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"
ERC20 = "NeurowebERC20"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call it NEUROWEB_ERC20? There is no support for any custom ERC20 atm, so perhaps it would be more clear



@dataclass
Expand Down
Loading