Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
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
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol @pdyraga @nkuba @lukasz-zimnoch
Copy link
Member

Choose a reason for hiding this comment

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

Let's extract CODEOWNERS change to a separate PR and merge it to main.

The CODEOWNERS should cover all existing contracts from contracts/ directory

Let's add there all developers who worked on the Solidity code of the Threshold smart contracts: @vzotova @cygnusv @pdyraga

This will not only protect dApp-dev-only changes from being merged but will also protect from any accidental changes to an already audited code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2 changes: 1 addition & 1 deletion contracts/staking/TokenStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
23 changes: 23 additions & 0 deletions deploy/09_set_minimum_stake.ts
Original file line number Diff line number Diff line change
@@ -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"
Copy link
Member

Choose a reason for hiding this comment

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

Why do we want to set the minimum stake to 39999999999999999999999? With dApp team owning T token contract from dapp-development-goerli deployment, all devs should be able to mint any amount of T they want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

39999999999999999999999 is the current min stake on mainnet that's why I picked this number but we could change to any number. We want to set the min stake to test the min stake validation in T dapp.

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<boolean> {
return hre.network.name !== "goerli"
}