From beded5ced79ec8e593ab73660b3668f72096eb3c Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 28 Jul 2022 12:43:38 +0200 Subject: [PATCH 1/6] Fine-tuned unstake period Reduce the unstake period to 120s(2min) instead of 24h. Thanks to this we can test the unstake flow w/o waiting 24h. --- contracts/staking/TokenStaking.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/staking/TokenStaking.sol b/contracts/staking/TokenStaking.sol index b6ac3cb9..e292fa78 100644 --- a/contracts/staking/TokenStaking.sol +++ b/contracts/staking/TokenStaking.sol @@ -80,7 +80,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints { } uint256 internal constant SLASHING_REWARD_PERCENT = 5; - uint256 internal constant MIN_STAKE_TIME = 24 hours; + uint256 internal constant MIN_STAKE_TIME = 120; uint256 internal constant GAS_LIMIT_AUTHORIZATION_DECREASE = 250000; uint256 internal constant CONVERSION_DIVISOR = 10**(18 - 3); From a9a29a09abcf46c0a3bac1d50fb1cb16e0c92234 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 28 Jul 2022 13:26:38 +0200 Subject: [PATCH 2/6] Add script that sets the min stake amount Run this script only for the goerli test network. --- deploy/09_set_minimum_stake.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 deploy/09_set_minimum_stake.ts diff --git a/deploy/09_set_minimum_stake.ts b/deploy/09_set_minimum_stake.ts new file mode 100644 index 00000000..7f406c7b --- /dev/null +++ b/deploy/09_set_minimum_stake.ts @@ -0,0 +1,23 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, deployments } = hre + const { execute } = deployments + const { log } = deployments + + const { deployer } = await getNamedAccounts() + + const minStakeAmount = "39999999999999999999999" + await execute("TokenStaking", { from: deployer }, "setMinimumStakeAmount") + + log(`Set minimum stake amount to ${minStakeAmount}`) +} + +export default func + +func.tags = ["setMinStakeAmount"] +func.dependencies = ["TokenStaking"] +func.skip = async function (hre: HardhatRuntimeEnvironment): Promise { + return hre.network.name !== "goerli" +} From f9411c0263a69b3f83876aa03d8dafb197b070a4 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 28 Jul 2022 13:36:20 +0200 Subject: [PATCH 3/6] Add `CODEOWNERS` file To protect the `*.sol` files. This is a protection to enforce the never-merge rule for dApp development fine-tuned parameters. --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..7dbd9c22 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +*.sol @pdyraga @nkuba @lukasz-zimnoch From c5bdf3d039d3e397fd25672ae08555de2ed91cbe Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 11 Aug 2022 16:36:44 +0200 Subject: [PATCH 4/6] Fix script Fix scritp that sets the min stake amount in the T token staking contract. I've missed passing the `amount` argument to the `setMinimumStakeAmount` function. --- deploy/09_set_minimum_stake.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy/09_set_minimum_stake.ts b/deploy/09_set_minimum_stake.ts index 7f406c7b..98d3394c 100644 --- a/deploy/09_set_minimum_stake.ts +++ b/deploy/09_set_minimum_stake.ts @@ -9,7 +9,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployer } = await getNamedAccounts() const minStakeAmount = "39999999999999999999999" - await execute("TokenStaking", { from: deployer }, "setMinimumStakeAmount") + await execute( + "TokenStaking", + { from: deployer }, + "setMinimumStakeAmount", + minStakeAmount + ) log(`Set minimum stake amount to ${minStakeAmount}`) } From 18c679ddb9400e71c8e02729cb71b2f19ecc6a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Thu, 1 Sep 2022 17:02:14 +0200 Subject: [PATCH 5/6] Change version's suffix to `-dapp-dev-goerli` We are publishing packages with code from `dapp-development` branch under versions that use `-dapp-dev-goerli.X` suffix. Our `package.json` on this branch should reflect that. If we do not set it up, the CI job used to pubblish the package will not be able to correctly bump up the version of the package. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e1be1414..eef642b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@threshold-network/solidity-contracts", - "version": "1.2.0-dev", + "version": "1.2.0-dapp-dev-goerli", "license": "GPL-3.0-or-later", "files": [ "artifacts/", From 646a5c61a84ccfb618e3cc0e0fee9a2fb05f5ea8 Mon Sep 17 00:00:00 2001 From: Michalina Date: Tue, 7 Nov 2023 12:06:21 +0100 Subject: [PATCH 6/6] Switch to `dapp-dev-sepolia` We're switching deployment to the Sepolia testnet due to planned deprecation of the Goerli testnet. In a previous commit we've updated the `dapp-development` branch with the recent changes from `main` (among them were the changes adding Sepolia to the list of supported networks). Now we're updating the `dapp-development` branch to create `dapp-dev-sepolia` packages. --- deploy/09_set_minimum_stake.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/09_set_minimum_stake.ts b/deploy/09_set_minimum_stake.ts index 98d3394c..a5fa89dd 100644 --- a/deploy/09_set_minimum_stake.ts +++ b/deploy/09_set_minimum_stake.ts @@ -24,5 +24,5 @@ export default func func.tags = ["setMinStakeAmount"] func.dependencies = ["TokenStaking"] func.skip = async function (hre: HardhatRuntimeEnvironment): Promise { - return hre.network.name !== "goerli" + return hre.network.name !== "sepolia" } diff --git a/package.json b/package.json index de6eeaa3..f1908cd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@threshold-network/solidity-contracts", - "version": "1.2.0-dapp-dev-goerli", + "version": "1.2.0-dapp-dev-sepolia", "license": "GPL-3.0-or-later", "files": [ "artifacts/",