Skip to content

Commit

Permalink
Merge pull request #269 from derekpierre/rewards
Browse files Browse the repository at this point in the history
Deploy updated TACoApplication contract that has updates for automated rewards
  • Loading branch information
cygnusv authored May 24, 2024
2 parents 449ec47 + ae5a2d3 commit 07ce241
Show file tree
Hide file tree
Showing 3 changed files with 273 additions and 4 deletions.
258 changes: 257 additions & 1 deletion deployment/artifacts/lynx.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,21 @@
"name": "_commitmentDeadline",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "_penaltyDefault",
"type": "uint192",
"internalType": "uint192"
},
{
"name": "_penaltyDuration",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "_penaltyIncrement",
"type": "uint192",
"internalType": "uint192"
}
]
},
Expand Down Expand Up @@ -860,6 +875,18 @@
"internalType": "uint96",
"indexed": false
},
{
"name": "deauthorizing",
"type": "uint96",
"internalType": "uint96",
"indexed": false
},
{
"name": "endDeauthorization",
"type": "uint64",
"internalType": "uint64",
"indexed": false
},
{
"name": "operator",
"type": "address",
Expand Down Expand Up @@ -938,6 +965,31 @@
],
"anonymous": false
},
{
"type": "event",
"name": "Penalized",
"inputs": [
{
"name": "stakingProvider",
"type": "address",
"internalType": "address",
"indexed": true
},
{
"name": "penaltyPercent",
"type": "uint256",
"internalType": "uint256",
"indexed": false
},
{
"name": "endPenalty",
"type": "uint64",
"internalType": "uint64",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "RewardAdded",
Expand All @@ -951,6 +1003,19 @@
],
"anonymous": false
},
{
"type": "event",
"name": "RewardContractSet",
"inputs": [
{
"name": "rewardContract",
"type": "address",
"internalType": "address",
"indexed": true
}
],
"anonymous": false
},
{
"type": "event",
"name": "RewardDistributorSet",
Expand All @@ -968,6 +1033,12 @@
"type": "event",
"name": "RewardPaid",
"inputs": [
{
"name": "sender",
"type": "address",
"internalType": "address",
"indexed": true
},
{
"name": "stakingProvider",
"type": "address",
Expand All @@ -989,6 +1060,19 @@
],
"anonymous": false
},
{
"type": "event",
"name": "RewardReset",
"inputs": [
{
"name": "stakingProvider",
"type": "address",
"internalType": "address",
"indexed": true
}
],
"anonymous": false
},
{
"type": "event",
"name": "RewardsWithdrawn",
Expand Down Expand Up @@ -1039,6 +1123,19 @@
],
"anonymous": false
},
{
"type": "function",
"name": "PENALTY_BASE",
"stateMutability": "view",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint192",
"internalType": "uint192"
}
]
},
{
"type": "function",
"name": "REWARD_PER_TOKEN_MULTIPLIER",
Expand Down Expand Up @@ -1320,6 +1417,30 @@
}
]
},
{
"type": "function",
"name": "eligibleStake",
"stateMutability": "view",
"inputs": [
{
"name": "_stakingProvider",
"type": "address",
"internalType": "address"
},
{
"name": "_endDate",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "uint96",
"internalType": "uint96"
}
]
},
{
"type": "function",
"name": "getActiveStakingProviders",
Expand All @@ -1334,6 +1455,11 @@
"name": "_maxStakingProviders",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "_cohortDuration",
"type": "uint32",
"internalType": "uint32"
}
],
"outputs": [
Expand Down Expand Up @@ -1368,6 +1494,30 @@
}
]
},
{
"type": "function",
"name": "getPenalty",
"stateMutability": "view",
"inputs": [
{
"name": "_stakingProvider",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "penalty",
"type": "uint192",
"internalType": "uint192"
},
{
"name": "endPenalty",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "function",
"name": "getStakingProvidersLength",
Expand Down Expand Up @@ -1564,6 +1714,58 @@
}
]
},
{
"type": "function",
"name": "penalize",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "_stakingProvider",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "function",
"name": "penaltyDefault",
"stateMutability": "view",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint192",
"internalType": "uint192"
}
]
},
{
"type": "function",
"name": "penaltyDuration",
"stateMutability": "view",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "function",
"name": "penaltyIncrement",
"stateMutability": "view",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint192",
"internalType": "uint192"
}
]
},
{
"type": "function",
"name": "pendingAuthorizationDecrease",
Expand Down Expand Up @@ -1648,6 +1850,19 @@
"inputs": [],
"outputs": []
},
{
"type": "function",
"name": "resetReward",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "_stakingProvider",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "function",
"name": "resynchronizeAuthorization",
Expand All @@ -1661,6 +1876,19 @@
],
"outputs": []
},
{
"type": "function",
"name": "rewardContract",
"stateMutability": "view",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "function",
"name": "rewardDistributor",
Expand Down Expand Up @@ -1752,6 +1980,19 @@
],
"outputs": []
},
{
"type": "function",
"name": "setRewardContract",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "_rewardContract",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "function",
"name": "setRewardDistributor",
Expand Down Expand Up @@ -1844,6 +2085,21 @@
"name": "endCommitment",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "stub",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "penaltyPercent",
"type": "uint192",
"internalType": "uint192"
},
{
"name": "endPenalty",
"type": "uint64",
"internalType": "uint64"
}
]
},
Expand Down Expand Up @@ -6194,4 +6450,4 @@
"deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600"
}
}
}
}
8 changes: 7 additions & 1 deletion deployment/constructor_params/lynx/root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ artifacts:

constants:
IN_SECONDS_1_HOUR: 3600
IN_SECONDS_1_DAY: 86400
IN_SECONDS_7_DAYS: 604800
IN_SECONDS_60_DAYS: 5184000
IN_SECONDS_91_DAYS: 7862400
Expand All @@ -17,6 +18,8 @@ constants:
FORTY_THOUSAND_TOKENS_IN_WEI_UNITS: 40000000000000000000000
TEN_MILLION_TOKENS_IN_WEI_UNITS: 10000000000000000000000000
YEAR_2025: 1735689600
PENALTY_DEFAULT: 1000 # 10%
PENALTY_INCREMENT: 500 # 5% increment

contracts:
- LynxStakingToken:
Expand All @@ -32,10 +35,13 @@ contracts:
_tStaking: $TestnetThresholdStaking
_minimumAuthorization: $FORTY_THOUSAND_TOKENS_IN_WEI_UNITS
_minOperatorSeconds: $IN_SECONDS_1_HOUR
_rewardDuration: $IN_SECONDS_7_DAYS
_rewardDuration: $IN_SECONDS_1_DAY
_deauthorizationDuration: $IN_SECONDS_60_DAYS
_commitmentDurationOptions: [$IN_SECONDS_91_DAYS, $IN_SECONDS_182_DAYS, $IN_SECONDS_364_DAYS, $IN_SECONDS_546_DAYS]
_commitmentDeadline: $YEAR_2025
_penaltyDefault: $PENALTY_DEFAULT
_penaltyDuration: $IN_SECONDS_1_DAY # <= _rewardDuration
_penaltyIncrement: $PENALTY_INCREMENT
- MockPolygonRoot:
constructor:
_rootApplication: $TACoApplication
Loading

0 comments on commit 07ce241

Please sign in to comment.