Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ImmutablePoolCreator contract #225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mikechaban
Copy link

Created the ImmutablePoolCreator contract in the terminus directory. It creates a staking pool on the Staker contract and transfers the administrator to the 0 address

Copy link

Summary by Octane

New Contracts

  • ImmutablePoolCreator.sol: The smart contract creates immutable staking pools on a specified staker address by making the pool administration unchangeable.

Updated Contracts

No contracts were updated in this PR.


🔗 Commit Hash: 98cafec

@zomglings
Copy link
Contributor

Thanks @mikechaban ! This is great. But it is lacking tests - could you please add tests, as well?

Copy link
Contributor

@mrk-hub mrk-hub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of nesting security/terminus. Create a folder in staker as auxiliary. Nesting should be ../contracts/staker/auxiliary

@@ -0,0 +1,45 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import IStaker.sol from the interface folder.

StakerInterface staker = StakerInterface(stakerAddress);

// sender as the administrator
staker.createPool(tokenType, tokenAddress, tokenID, transferable, lockupSeconds, cooldownSeconds, msg.sender);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can set msg.sender as null address in pool creation to reduce gas useage

// sender as the administrator
staker.createPool(tokenType, tokenAddress, tokenID, transferable, lockupSeconds, cooldownSeconds, msg.sender);

// 0 address as the administrator to make the pool immutable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unknown poolID Call will fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants