-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reSDL and priority pool deployment/upgrade scripts
- Loading branch information
Showing
9 changed files
with
957 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
14.17.4 | ||
16.20.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { ERC677, PriorityPool, SDLPool, StakingPool } from '../../typechain-types' | ||
import { updateDeployments, getContract, deployUpgradeable } from '../utils/deployment' | ||
import { toEther } from '../utils/helpers' | ||
|
||
const multisigAddress = '0xB351EC0FEaF4B99FdFD36b484d9EC90D0422493D' | ||
|
||
// LINK Priority Pool | ||
const LINK_PriorityPool = { | ||
queueDepositMin: toEther(5000), // min amount of tokens needed to execute deposit | ||
queueDepositMax: toEther(200000), // max amount of tokens in a single deposit tx | ||
} | ||
|
||
async function main() { | ||
const linkToken = (await getContract('LINKToken')) as ERC677 | ||
const sdlPool = (await getContract('SDLPool')) as SDLPool | ||
const stakingPool = (await getContract('LINK_StakingPool')) as StakingPool | ||
|
||
const priorityPool = (await deployUpgradeable('PriorityPool', [ | ||
linkToken.address, | ||
stakingPool.address, | ||
sdlPool.address, | ||
LINK_PriorityPool.queueDepositMin, | ||
LINK_PriorityPool.queueDepositMax, | ||
])) as PriorityPool | ||
console.log('LINK_PriorityPool deployed: ', priorityPool.address) | ||
|
||
let tx = await priorityPool.transferOwnership(multisigAddress) | ||
await tx.wait() | ||
|
||
updateDeployments( | ||
{ | ||
LINK_PriorityPool: priorityPool.address, | ||
}, | ||
{ | ||
LINK_PriorityPool: 'PriorityPool', | ||
} | ||
) | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { | ||
DelegatorPool, | ||
ERC677, | ||
LinearBoostController, | ||
SDLPool, | ||
StakingPool, | ||
WrappedSDToken, | ||
} from '../../typechain-types' | ||
import { updateDeployments, deploy, getContract, deployUpgradeable } from '../utils/deployment' | ||
|
||
const multisigAddress = '0xB351EC0FEaF4B99FdFD36b484d9EC90D0422493D' | ||
|
||
// Linear Boost Controller | ||
const LinearBoostControllerParams = { | ||
maxLockingDuration: 4 * 365 * 86400, // maximum locking duration | ||
maxBoost: 8, // maximum boost amount | ||
} | ||
// SDL Pool | ||
const SDLPoolParams = { | ||
derivativeTokenName: 'Reward Escrowed SDL', // SDL staking derivative token name | ||
derivativeTokenSymbol: 'reSDL', // SDL staking derivative token symbol | ||
} | ||
|
||
async function main() { | ||
const sdlToken = (await getContract('SDLToken')) as ERC677 | ||
const delegatorPool = (await getContract('DelegatorPool')) as DelegatorPool | ||
const stakingPool = (await getContract('LINK_StakingPool')) as StakingPool | ||
const wsdToken = (await getContract('LINK_WrappedSDToken')) as WrappedSDToken | ||
|
||
const lbc = (await deploy('LinearBoostController', [ | ||
LinearBoostControllerParams.maxLockingDuration, | ||
LinearBoostControllerParams.maxBoost, | ||
])) as LinearBoostController | ||
console.log('LinearBoostController deployed: ', lbc.address) | ||
|
||
const sdlPool = (await deployUpgradeable('SDLPool', [ | ||
SDLPoolParams.derivativeTokenName, | ||
SDLPoolParams.derivativeTokenSymbol, | ||
sdlToken.address, | ||
lbc.address, | ||
delegatorPool.address, | ||
])) as SDLPool | ||
console.log('SDLPool deployed: ', sdlPool.address) | ||
|
||
const stLinkSDLRewardsPool = await deploy('RewardsPoolWSD', [ | ||
sdlPool.address, | ||
stakingPool.address, | ||
wsdToken.address, | ||
]) | ||
console.log('stLINK_SDLRewardsPool deployed: ', stLinkSDLRewardsPool.address) | ||
|
||
let tx = await sdlPool.addToken(stakingPool.address, stLinkSDLRewardsPool.address) | ||
await tx.wait() | ||
|
||
tx = await lbc.transferOwnership(multisigAddress) | ||
await tx.wait() | ||
|
||
tx = await sdlPool.transferOwnership(multisigAddress) | ||
await tx.wait() | ||
|
||
updateDeployments( | ||
{ | ||
LinearBoostController: lbc.address, | ||
SDLPool: sdlPool.address, | ||
stLINK_SDLRewardsPool: stLinkSDLRewardsPool.address, | ||
}, | ||
{ stLINK_SDLRewardsPool: 'RewardsPoolWSD' } | ||
) | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error) | ||
process.exit(1) | ||
}) |
Oops, something went wrong.