Skip to main content

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

ContractDescription
Energy FactoryManages XKFI tokens and the energy accumulation system
RouterHandles token swaps and liquidity operations
Fees CollectorCollects and distributes protocol fees
PairManages liquidity pools for token pairs
Auto Position CreatorAutomates position creation in pools
Position CreatorManual position creation for liquidity providers
Simple LockBasic token locking mechanism
Token UnstakeHandles token unstaking and unbonding
Token ManagerToken creation and management

Network Endpoints

All smart contract interactions are performed via the Klever blockchain nodes:

NetworkEndpoint
Testnethttps://node.testnet.klever.org
Mainnethttps://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:

EndpointUse Case
/vm/queryComplex structures (structs, arrays)
/vm/intInteger values (BigUint, u64)
/vm/hexHexadecimal data (addresses, token IDs)

Go Ahead

Select a contract from the sidebar to explore its documentation.