Skip to content

Commit 0de3da5

Browse files
authored
Merge pull request #122 from threshold-network/minstake
Allow to stake an amount equal to the minimum stake Change the staking pre-requisite from amount > minStake to amount >= minStake
2 parents 051a72b + 48acf5b commit 0de3da5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

contracts/staking/TokenStaking.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,10 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
283283
createdAt == 0 && stakingProviderStruct.owner == address(0),
284284
"Provider is already in use"
285285
);
286-
require(amount > minTStakeAmount, "Amount is less than minimum");
286+
require(
287+
amount > 0 && amount >= minTStakeAmount,
288+
"Amount is less than minimum"
289+
);
287290
stakingProviderStruct.owner = msg.sender;
288291
stakingProviderStruct.authorizer = authorizer;
289292
stakingProviderStruct.beneficiary = beneficiary;

test/staking/TokenStaking.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ describe("TokenStaking", () => {
335335
let blockTimestamp
336336

337337
beforeEach(async () => {
338+
await tokenStaking
339+
.connect(deployer)
340+
.setMinimumStakeAmount(initialStakerBalance)
338341
await tToken.connect(staker).approve(tokenStaking.address, amount)
339342
tx = await tokenStaking
340343
.connect(staker)

0 commit comments

Comments
 (0)