Skip to content

Commit

Permalink
fixed test env setup pp deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
BkChoy committed Apr 29, 2024
1 parent 3aa69e1 commit b9cda4a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion contracts/linkStaking/base/VaultControllerStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ abstract contract VaultControllerStrategy is Strategy {
totalDeposits += deposited;
totalPrincipalDeposits += deposited;

if (deposited != _amount) {
if (deposited < _amount) {
token.safeTransfer(address(stakingPool), _amount - deposited);
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/deploy/modules/deploy-link-staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const WrappedSDTokenArgs = {
const StakingPoolArgs = {
derivativeTokenName: 'Staked LINK', // LINK staking derivative token name
derivativeTokenSymbol: 'stLINK', // LINK staking derivative token symbol
fees: [['0x6879826450e576B401c4dDeff2B7755B1e85d97c', 300]], // fee receivers & percentage amounts in basis points
fees: [], // fee receivers & percentage amounts in basis points
}
// LINK Priority Pool
const PriorityPoolArgs = {
Expand Down
38 changes: 17 additions & 21 deletions scripts/test/setup-test-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ async function main() {

// LINK Staking

tx = await LINK_StakingPool.updateFee(0, ethers.constants.AddressZero, 0)
await tx.wait()
await (await LINK_StakingPool.removeStrategy(0, '0x')).wait()
await (await LINK_StakingPool.removeStrategy(0, '0x')).wait()

const strategyMockLINK = (await deployUpgradeable('StrategyMock', [
linkToken.address,
Expand Down Expand Up @@ -275,20 +275,18 @@ async function main() {
tx = await strategyMockLINK.setMaxDeposits(toEther(2200))
await tx.wait()

// CHECK why depositQueuedTokens does not work

// tx = await LINK_PriorityPool.depositQueuedTokens(toEther(0), toEther(100))
// await tx.wait()
tx = await LINK_PriorityPool.depositQueuedTokens(toEther(0), toEther(10000))
await tx.wait()

// tx = await LINK_PriorityPool.pauseForUpdate()
// await tx.wait()
// tx = await LINK_PriorityPool.updateDistribution(
// '0x52171b32a0a6c33f6756c5c33673790b66945c4f1c4ec4a81932e60b06b5a321',
// '0x6310F1189600F807FAC771D10706B6665628B99797054447F58F4C8A05971B83',
// toEther(200),
// toEther(100)
// )
// await tx.wait()
tx = await LINK_PriorityPool.pauseForUpdate()
await tx.wait()
tx = await LINK_PriorityPool.updateDistribution(
'0x52171b32a0a6c33f6756c5c33673790b66945c4f1c4ec4a81932e60b06b5a321',
'0x6310F1189600F807FAC771D10706B6665628B99797054447F58F4C8A05971B83',
toEther(200),
toEther(100)
)
await tx.wait()

// Account 7

Expand All @@ -314,12 +312,10 @@ async function main() {
)
await tx.wait()

// CHECK why depositQueuedTokens does not work

// tx = await strategyMockLINK.setMaxDeposits(toEther(6200))
// await tx.wait()
// tx = await LINK_PriorityPool.depositQueuedTokens(toEther(0), toEther(100000))
// await tx.wait()
tx = await strategyMockLINK.setMaxDeposits(toEther(6200))
await tx.wait()
tx = await LINK_PriorityPool.depositQueuedTokens(toEther(0), toEther(100000))
await tx.wait()

const vestingStart = 1695312000 // Sep 21 2023 12pm EDT
const vestingDuration = 4 * 365 * 86400 // 4 years
Expand Down

0 comments on commit b9cda4a

Please sign in to comment.