From 6c06bfd8e3abda7f2733245ba893ed54ec6da0ce Mon Sep 17 00:00:00 2001 From: derekpierre Date: Thu, 16 May 2024 10:30:30 -0400 Subject: [PATCH] Deploy updated TACoApplication contract that has updates for automated rewards (also had some initial penalty updates that we don't need to use just yet, but needed for deployment). Co-authored-by: Manuel Montenegro --- deployment/artifacts/lynx.json | 258 +++++++++++++++++- .../constructor_params/lynx/upgrades-root.yml | 11 +- 2 files changed, 266 insertions(+), 3 deletions(-) diff --git a/deployment/artifacts/lynx.json b/deployment/artifacts/lynx.json index f7ac2f77..2950f536 100644 --- a/deployment/artifacts/lynx.json +++ b/deployment/artifacts/lynx.json @@ -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" } ] }, @@ -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", @@ -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", @@ -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", @@ -968,6 +1033,12 @@ "type": "event", "name": "RewardPaid", "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address", + "indexed": true + }, { "name": "stakingProvider", "type": "address", @@ -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", @@ -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", @@ -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", @@ -1334,6 +1455,11 @@ "name": "_maxStakingProviders", "type": "uint256", "internalType": "uint256" + }, + { + "name": "_cohortDuration", + "type": "uint32", + "internalType": "uint32" } ], "outputs": [ @@ -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", @@ -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", @@ -1648,6 +1850,19 @@ "inputs": [], "outputs": [] }, + { + "type": "function", + "name": "resetReward", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "_stakingProvider", + "type": "address", + "internalType": "address" + } + ], + "outputs": [] + }, { "type": "function", "name": "resynchronizeAuthorization", @@ -1661,6 +1876,19 @@ ], "outputs": [] }, + { + "type": "function", + "name": "rewardContract", + "stateMutability": "view", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ] + }, { "type": "function", "name": "rewardDistributor", @@ -1752,6 +1980,19 @@ ], "outputs": [] }, + { + "type": "function", + "name": "setRewardContract", + "stateMutability": "nonpayable", + "inputs": [ + { + "name": "_rewardContract", + "type": "address", + "internalType": "address" + } + ], + "outputs": [] + }, { "type": "function", "name": "setRewardDistributor", @@ -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" } ] }, @@ -6194,4 +6450,4 @@ "deployer": "0x3B42d26E19FF860bC4dEbB920DD8caA53F93c600" } } -} +} \ No newline at end of file diff --git a/deployment/constructor_params/lynx/upgrades-root.yml b/deployment/constructor_params/lynx/upgrades-root.yml index 32517941..39d3716b 100644 --- a/deployment/constructor_params/lynx/upgrades-root.yml +++ b/deployment/constructor_params/lynx/upgrades-root.yml @@ -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 @@ -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: - TACoApplication: @@ -25,7 +28,11 @@ contracts: _tStaking: "0x18006f9A84C0bAD4CD96Aa69C7cE17aD760cDaD2" _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] + _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