Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/chaincode/launchpad/finaliseSale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ export async function finalizeSale(ctx: GalaChainContext, sale: LaunchpadSale):
throw new PreConditionFailedError("Platform fee configuration is yet to be defined.");
}

const platformFeePercentage = feeAllocation ? feeAllocation.platformFeePercentage : 0.01;
const ownerAllocationPercentage = feeAllocation ? feeAllocation.ownerAllocationPercentage : 0.05;
const liquidityAllocationPercentage = feeAllocation ? feeAllocation.liquidityAllocationPercentage : 0.94;
const platformFeePercentage = feeAllocation?.platformFeePercentage;
const ownerAllocationPercentage = feeAllocation?.ownerAllocationPercentage;
const liquidityAllocationPercentage = feeAllocation?.liquidityAllocationPercentage;

if (!platformFeePercentage || !ownerAllocationPercentage || !liquidityAllocationPercentage) {
throw new PreConditionFailedError("Fee allocation percentages are not properly configured.");
}

const nativeToken = sale.fetchNativeTokenInstanceKey();
const memeToken = sale.fetchSellingTokenInstanceKey();
Expand Down