Skip to main content

BondManager

Git Source

Inherits: Policy, [RolesConsumer](/main/contracts/docs/src/modules/ROLES/Tech Holding JSCRoles.sol/abstract.RolesConsumer)

Title: Tech Holding JSC Bond Manager

Tech Holding JSC Bond Manager (Policy) Contract

State Variables

MINTR

MINTRv1 public MINTR

TRSRY

TRSRYv1 public TRSRY

bondCallback

IBondCallback public bondCallback

fixedExpiryAuctioneer

IBondAuctioneer public fixedExpiryAuctioneer

fixedExpiryTeller

IBondFixedExpiryTeller public fixedExpiryTeller

gnosisEasyAuction

IEasyAuction public gnosisEasyAuction

gvi

Tech Holding JSCERC20Token public gvi

fixedExpiryParameters

FixedExpiryParameters public fixedExpiryParameters

batchAuctionParameters

BatchAuctionParameters public batchAuctionParameters

Functions

constructor

constructor(
Kernel kernel_,
address fixedExpiryAuctioneer_,
address fixedExpiryTeller_,
address gnosisEasyAuction_,
address gvi_
) Policy(kernel_);

configureDependencies

Define module dependencies for this policy.

function configureDependencies() external override returns (Keycode[] memory dependencies);

Returns

NameTypeDescription
dependenciesKeycode[]- Keycode array of module dependencies.

requestPermissions

Function called by kernel to set module function permissions.

function requestPermissions() external view override returns (Permissions[] memory requests);

Returns

NameTypeDescription
requestsPermissions[]- Array of keycodes and function selectors for requested permissions.

createFixedExpiryBondMarket

Creates a market on the Bond Protocol contracts to auction off GVI bonds

function createFixedExpiryBondMarket(uint256 capacity_, uint48 bondTerm_)
external
onlyRole("bondmanager_admin")
returns (uint256 marketId);

Parameters

NameTypeDescription
capacity_uint256The budget of GVI to payout through GVI bonds
bondTerm_uint48How long should the GVI be locked in the bond

createBatchAuction

Creates a bond token using Bond Protocol and creates a Gnosis Auction to sell it

function createBatchAuction(uint96 capacity_, uint48 bondTerm_)
external
onlyRole("bondmanager_admin")
returns (uint256 auctionId);

Parameters

NameTypeDescription
capacity_uint96The amount of GVI to use in the GVI bonds
bondTerm_uint48How long should the GVI be locked in the bond

closeFixedExpiryBondMarket

Closes the specified bond protocol market to prevent future purchases

function closeFixedExpiryBondMarket(uint256 marketId_) external onlyRole("bondmanager_admin");

Parameters

NameTypeDescription
marketId_uint256The ID of the Bond Protocol auction

settleBatchAuction

Settles the Gnosis Auction to find the clearing order and allow users to claim their bond tokens

function settleBatchAuction(uint256 auctionId_) external onlyRole("bondmanager_admin");

Parameters

NameTypeDescription
auctionId_uint256The ID of the Gnosis auction

setFixedExpiryParameters

Sets the parameters that will likely be consistent across Bond Protocol market launches

function setFixedExpiryParameters(
uint256 initialPrice_,
uint256 minPrice_,
uint48 auctionTime_,
uint32 debtBuffer_,
uint32 depositInterval_,
bool capacityInQuote_
) external onlyRole("bondmanager_admin");

Parameters

NameTypeDescription
initialPrice_uint256The initial ratio of GVI to GVI bonds that the bonds will sell for
minPrice_uint256The minim ratio of GVI to GVI bonds that the bonds will sell for
auctionTime_uint48How long should the auctioning of the bond tokens last (should be less than planned bond terms)
debtBuffer_uint32Variable used to calculate maximum capacity (should generally be set to 100_000)
depositInterval_uint32Desired frequency of purchases
capacityInQuote_bool

setBatchAuctionParameters

Sets the parameters that will likely be consistent across Gnosis Auction launches

function setBatchAuctionParameters(
uint48 auctionCancelTime_,
uint48 auctionTime_,
uint96 minPctSold_,
uint256 minBuyAmount_,
uint256 minFundingThreshold_
) external onlyRole("bondmanager_admin");

Parameters

NameTypeDescription
auctionCancelTime_uint48How long should users have to cancel their bids (should be less than auctionTime_)
auctionTime_uint48How long should the auctioning of the bond tokens last (should be less than planned bond terms)
minPctSold_uint96What percent of capacity is the minimum acceptable level to sell (2 decimals, i.e. 50 = 50%)
minBuyAmount_uint256Minimum purchase size (in GVI) from a user
minFundingThreshold_uint256Minimum funding threshold

setCallback

Sets the bond callback policy for use in minting upon Bond Protocol market purchases

function setCallback(IBondCallback newCallback_) external onlyRole("bondmanager_admin");

Parameters

NameTypeDescription
newCallback_IBondCallbackThe bond callback address to set

emergencyShutdownFixedExpiryMarket

Blacklists the specified market to prevent the bond callback from minting more GVI on purchases

function emergencyShutdownFixedExpiryMarket(uint256 marketId_) external onlyRole("bondmanager_admin");

Parameters

NameTypeDescription
marketId_uint256The ID of the Bond Protocol auction to shutdown

emergencySetApproval

Increases a contract's allowance to spend the Bond Manager's GVI

This shouldn't be needed but is a safegaurd in the event of accounting errors in the market creation functions

function emergencySetApproval(address contract_, uint256 amount_) external onlyRole("bondmanager_admin");

Parameters

NameTypeDescription
contract_addressThe contract to give spending permission to
amount_uint256The amount to increase the GVI spending permission by

emergencyWithdraw

Sends GVI from the Bond Manager back to the treasury

function emergencyWithdraw(uint256 amount_) external onlyRole("bondmanager_admin");

Parameters

NameTypeDescription
amount_uint256The amount of GVI to send to the treasury

Events

BondProtocolMarketLaunched

event BondProtocolMarketLaunched(uint256 marketId, address bondToken, uint256 capacity, uint48 bondTerm);

GnosisAuctionLaunched

event GnosisAuctionLaunched(uint256 marketId, address bondToken, uint96 capacity, uint48 bondTerm);

Errors

BondManager_TermTooShort

error BondManager_TermTooShort();

BondManager_InitialPriceTooLow

error BondManager_InitialPriceTooLow();

BondManager_DebtBufferTooLow

error BondManager_DebtBufferTooLow();

BondManager_AuctionTimeTooShort

error BondManager_AuctionTimeTooShort();

BondManager_DepositIntervalTooShort

error BondManager_DepositIntervalTooShort();

BondManager_DepositIntervalTooLong

error BondManager_DepositIntervalTooLong();

BondManager_CancelTimeTooLong

error BondManager_CancelTimeTooLong();

BondManager_MinPctSoldTooLow

error BondManager_MinPctSoldTooLow();

Structs

FixedExpiryParameters

struct FixedExpiryParameters {
uint256 initialPrice;
uint256 minPrice;
uint48 auctionTime;
uint32 debtBuffer;
uint32 depositInterval;
bool capacityInQuote;
}

BatchAuctionParameters

struct BatchAuctionParameters {
uint48 auctionCancelTime;
uint48 auctionTime;
uint96 minPctSold;
uint256 minBuyAmount;
uint256 minFundingThreshold;
}