---
# System prepended metadata

title: Private Placement Smart Contract Document

---

# Private Placement Smart Contract Document


### 1. Trade BUSD for KALA

>#### Description

> User trade BUSD for KALA. 20% of the traded KALAs will be released to user immediately. User can claim the left 80% pending KALAs in the following 12 months, 1/12 per month.

> ```javascript
> //Execute IBEP20.approve(usdAmount) before invoke this method
> function tradeBusd(uint busdAmount) external
> //Execute IBEP20.approve(0) if some error occurs
> ```

>#### Request Parameters

>|Parameter|Type|Description|
>|:----- |:-------|:-----|
>|busdAmount |uint ||

>#### Event

> ```javascript
> event TradeBusd(uint busdAmount);
> ```

### 2. Trade BNB for KALA

>#### Description

> User trade BNB for KALA. 20% of the traded KALAs will be released to user immediately. User can claim the left 80% pending KALAs in the following 12 months, 1/12 per month. 
>
> Due the the price change of BNB, Same amount of BNB may trade different amount of KALA

> ```javascript
> // contract.tradeKalaByBnb({value: bnbAmount})
> function tradeBnb() payable external
> ```

>#### Request Parameters

>| parameter | type |Description|
>| :-------- | :--- | :------- |
>| bnbAmount | uint ||

>#### Event

> ```javascript
> event TradeBnb(uint bnbAmount);
> ```



### 3. Claim KALA

>#### Description

> User claim the pending KALA traded with BNB or BUSD

> ```javascript
> function claim() external;
> ```

>#### Event

> ```javascript
> event Claim();
> ```



### 4. Query BNB price

> ```javascript
> function queryBnbPrice() external view returns (uint);
> ```



### 5. Query BNB Amount

>#### Description

> Query how much BNB is traded for KALA.

> ```javascript
> //user scope
> function queryBusdAmount() external view returns (uint);
> ```



### 6. Query BUSD Amount

>#### Description

> Query how much BUSD is traded for KALA 

> ```javascript
> //user scope
> function queryBnbAmount() external view returns (uint);
> ```



### 7. Query KALA Amount

>#### Description

> Query KALA amount a user has gotten. Include the released KALAs and the pending KALAs.

> ```javascript
> //user scope
> function queryKalaAmount() external view returns (uint);
> ```



### 8. Query Total USD Amount

>#### Description

> Query the USD amount all the users has traded,  include BUSD and BNB. BNB amount is converted to USD

> ```javascript
> function queryTotalUsdAmount() external view returns (uint);
> ```



### 9. Query KALA Release Logs

>#### Description

> 20% KALAs will be released in the phase of trading. The other 80% pending KALAs will be released(user need to claim manually) in the following 12 months. 
>
> Release log include both.

> ```javascript
> function queryReleaseLog() external view returns (uint[] memory releaseTimes, uint[] memory releaseAmounts);
> ```



### 10. Query Trade Configuration

>#### Description

> The Mainnet trade configuration will be different from testnet one, since there is no enough BUSD/BNB in testnet for testing.

> ```javascript
> function queryTradeConfig() external view returns (
>     uint startTime,  // trade start time(seconds)
>     uint duration,	 // trade duration(seconds) 
>     uint minUsdAmount, //User's minimum usd amount for each trade
>     uint maxUsdAmount, //User's maximum usd amount for all the trades
>     uint totalUsdLimit, //The total usd amount limit for this prirvate placement activity.
>     uint kalaPrice // Kala price.
> );
> ```

>#### 

>


### 11. 获取用户数据
```javascript
 function queryUserTraderInfo(address trader) external      returns (
        uint kalaAmount, 
        uint claimAmount, 
        uint busdAmount, 
        uint usdAmount, 
        uint bnbAmount
        )
```

>#### 

### 12. 获取用户数据
```javascript
function queryUserReleaseLog(address trader)  returns     (
        uint[] memory timeArray,
        uint[] memory amountArray,
        uint8[] memory releaseTypeArray,
        uint[] memory blockNumberArray);
```

>#### 

 
