From cc7b599fc2b2aaafe10fd1d8d70cb697360e6f3c Mon Sep 17 00:00:00 2001 From: BkChoy Date: Fri, 26 Apr 2024 14:55:43 -0400 Subject: [PATCH] deploy delegator pool for testing --- contracts/core/sdlPool/SDLPoolPrimary.sol | 8 ++++++++ scripts/test/deploy/modules/deploy-core.ts | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/contracts/core/sdlPool/SDLPoolPrimary.sol b/contracts/core/sdlPool/SDLPoolPrimary.sol index 3f6caccd..60b7cbe1 100644 --- a/contracts/core/sdlPool/SDLPoolPrimary.sol +++ b/contracts/core/sdlPool/SDLPoolPrimary.sol @@ -274,6 +274,14 @@ contract SDLPoolPrimary is SDLPool { _storeNewLock(_sender, _amount, _lockingDuration); } + /** + * @notice sets the delegator pool addres + * @param _delegatorPool address of delegator pool + */ + function setDelegatorPool(address _delegatorPool) external onlyOwner { + delegatorPool = _delegatorPool; + } + /** * @notice stores a new lock * @param _owner owner of lock diff --git a/scripts/test/deploy/modules/deploy-core.ts b/scripts/test/deploy/modules/deploy-core.ts index 884d5550..9b604450 100644 --- a/scripts/test/deploy/modules/deploy-core.ts +++ b/scripts/test/deploy/modules/deploy-core.ts @@ -22,6 +22,11 @@ const SDLPoolPrimaryArgs = { derivativeTokenName: 'Reward Escrowed SDL', // SDL staking derivative token name derivativeTokenSymbol: 'reSDL', // SDL staking derivative token symbol } +// Delegator Pool (deprecated) +const DelegatorPool = { + derivativeTokenName: 'Staked SDL', // SDL staking derivative token name + derivativeTokenSymbol: 'stSDL', // SDL staking derivative token symbol +} export async function deployCore() { const lplToken = (await getContract('LPLToken')) as ERC677 @@ -32,6 +37,14 @@ export async function deployCore() { const lplMigration = await deploy('LPLMigration', [lplToken.address, sdlToken.address]) console.log('LPLMigration deployed: ', lplMigration.address) + const delegatorPool = await deployUpgradeable('DelegatorPool', [ + sdlToken.address, + DelegatorPool.derivativeTokenName, + DelegatorPool.derivativeTokenSymbol, + [], + ]) + console.log('DelegatorPool deployed: ', delegatorPool.address) + const lbc = await deploy('LinearBoostController', [ LinearBoostControllerArgs.minLockingDuration, LinearBoostControllerArgs.maxLockingDuration, @@ -47,12 +60,15 @@ export async function deployCore() { ]) console.log('SDLPoolPrimary deployed: ', sdlPoolPrimary.address) + await (await sdlPoolPrimary.setDelegatorPool(delegatorPool.address)).wait() + updateDeployments( { SDLToken: sdlToken.address, LPLMigration: lplMigration.address, LinearBoostController: lbc.address, SDLPoolPrimary: sdlPoolPrimary.address, + DelegatorPool: delegatorPool.address, }, { SDLToken: 'StakingAllowance' } )