Skip to content

Commit

Permalink
Deploy updated TACoApplication contract that has updates for automate…
Browse files Browse the repository at this point in the history
…d 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 <[email protected]>
  • Loading branch information
derekpierre and manumonti committed May 16, 2024
1 parent 449ec47 commit 6c06bfd
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 3 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"
}
}
}
}
11 changes: 9 additions & 2 deletions deployment/constructor_params/lynx/upgrades-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:
- TACoApplication:
Expand All @@ -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

0 comments on commit 6c06bfd

Please sign in to comment.