Smart Contracts Overview
Bitcoin.me DeFi is powered by a suite of interconnected smart contracts that handle various aspects of decentralized finance operations. This documentation provides technical details for developers integrating with these contracts.
Core Contracts
| Contract | Description |
|---|---|
| Energy Factory | Manages XKFI tokens and the energy accumulation system |
| Router | Handles token swaps and liquidity operations |
| Fees Collector | Collects and distributes protocol fees |
| Pair | Manages liquidity pools for token pairs |
| Auto Position Creator | Automates position creation in pools |
| Position Creator | Manual position creation for liquidity providers |
| Simple Lock | Basic token locking mechanism |
| Token Unstake | Handles token unstaking and unbonding |
| Token Manager | Token creation and management |
Network Endpoints
All smart contract interactions are performed via the Klever blockchain nodes:
| Network | Endpoint |
|---|---|
| Testnet | https://node.testnet.klever.org |
| Mainnet | https://node.mainnet.klever.org |
API Request Format
Smart contract calls use a standardized format via the /vm/query endpoint:
curl --request POST \
--url https://node.testnet.klever.org/vm/query \
--header 'Content-Type: application/json' \
--data '{
"scAddress": "<contract_address>",
"funcName": "<function_name>",
"args": ["<arg1_in_hex>", "<arg2_in_hex>"]
}'
Response Types
Different response formats are available depending on the data type:
| Endpoint | Use Case |
|---|---|
/vm/query | Complex structures (structs, arrays) |
/vm/int | Integer values (BigUint, u64) |
/vm/hex | Hexadecimal data (addresses, token IDs) |
Go Ahead
Select a contract from the sidebar to explore its documentation.