-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73c85e8
commit 98cafec
Showing
1 changed file
with
45 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
interface StakerInterface { | ||
function createPool( | ||
uint256 tokenType, | ||
address tokenAddress, | ||
uint256 tokenID, | ||
bool transferable, | ||
uint256 lockupSeconds, | ||
uint256 cooldownSeconds, | ||
address administrator | ||
) external; | ||
|
||
function transferPoolAdministration(uint256 poolID, address newAdministrator) external; | ||
} | ||
|
||
contract ImmutablePoolCreator { | ||
address public immutable stakerAddress; | ||
|
||
event ImmutablePoolCreated(uint256 poolID); | ||
|
||
constructor(address _stakerAddress) { | ||
stakerAddress = _stakerAddress; | ||
} | ||
|
||
function createImmutablePool( | ||
uint256 tokenType, | ||
address tokenAddress, | ||
uint256 tokenID, | ||
bool transferable, | ||
uint256 lockupSeconds, | ||
uint256 cooldownSeconds | ||
) external { | ||
StakerInterface staker = StakerInterface(stakerAddress); | ||
|
||
// sender as the administrator | ||
staker.createPool(tokenType, tokenAddress, tokenID, transferable, lockupSeconds, cooldownSeconds, msg.sender); | ||
|
||
// 0 address as the administrator to make the pool immutable | ||
staker.transferPoolAdministration(poolID, address(0)); | ||
|
||
emit ImmutablePoolCreated(poolID); | ||
} | ||
} |