Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do not merge] dApp-friendly contract deployment #118

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
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
28 changes: 28 additions & 0 deletions deploy/09_set_minimum_stake.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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",
minStakeAmount
)

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 !== "sepolia"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@threshold-network/solidity-contracts",
"version": "1.3.0-dev",
"version": "1.2.0-dapp-dev-sepolia",
"license": "GPL-3.0-or-later",
"files": [
"artifacts/",
Expand Down
Loading