Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #54 from bugout-dev/add-transferability-burnabilit…
Browse files Browse the repository at this point in the history
…y-methods

Added methods to view and change pool transferability/burnability
  • Loading branch information
zomglings authored Jul 5, 2022
2 parents 242bbd1 + fc02a5b commit c2f6779
Show file tree
Hide file tree
Showing 4 changed files with 375 additions and 46 deletions.
20 changes: 20 additions & 0 deletions contracts/terminus/TerminusFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,26 @@ contract TerminusFacet is ERC1155WithTerminusStorage {
return LibTerminus.terminusStorage().poolSupply[poolID];
}

function poolIsTransferable(uint256 poolID) external view returns (bool) {
return !LibTerminus.terminusStorage().poolNotTransferable[poolID];
}

function poolIsBurnable(uint256 poolID) external view returns (bool) {
return LibTerminus.terminusStorage().poolBurnable[poolID];
}

function setPoolTransferable(uint256 poolID, bool transferable) external {
LibTerminus.enforcePoolIsController(poolID, msg.sender);
LibTerminus.TerminusStorage storage ts = LibTerminus.terminusStorage();
ts.poolNotTransferable[poolID] = !transferable;
}

function setPoolBurnable(uint256 poolID, bool burnable) external {
LibTerminus.enforcePoolIsController(poolID, msg.sender);
LibTerminus.TerminusStorage storage ts = LibTerminus.terminusStorage();
ts.poolBurnable[poolID] = burnable;
}

function createSimplePool(uint256 _capacity) external returns (uint256) {
LibTerminus.enforceIsController();
LibTerminus.TerminusStorage storage ts = LibTerminus.terminusStorage();
Expand Down
Loading

0 comments on commit c2f6779

Please sign in to comment.