Skip to content

Commit

Permalink
deploy delegator pool for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
BkChoy committed Apr 26, 2024
1 parent 0c1e42f commit cc7b599
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/core/sdlPool/SDLPoolPrimary.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions scripts/test/deploy/modules/deploy-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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' }
)
Expand Down

0 comments on commit cc7b599

Please sign in to comment.