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
ReferralOn-chain referral fees for integrator dApps

Contract Addresses

Below are the deployed contract addresses for both Testnet and Mainnet:

Testnet

ContractAddress
Energy Factoryklv1qqqqqqqqqqqqqpgqx6zjvgtdcgsy5drxj6rd74fqhrwchnc4kfkq5kp4zd
Routerklv1qqqqqqqqqqqqqpgqxqyew7yfcj0chsp6zu7eflqpaz5g4vsukfkqutm3vd
Fees Collectorklv1qqqqqqqqqqqqqpgquytdkfvn3ntymsv4xvlw7xurv6hst5alkfkqt06wpl
Pairklv1qqqqqqqqqqqqqpgqgeryalz37lxcf9mu6advdeq75s6tz0adkfkqp3h0uh
Auto Position Creatorklv1qqqqqqqqqqqqqpgq996la7ekpsfhlygvaeakwjqsyacahvs8kfkqxeyxr0
Position Creatorklv1qqqqqqqqqqqqqpgqu5mla6djwfgpe3dcaxmm06qu4yn8ncnpkfkqzdlpjw
Simple Lockklv1qqqqqqqqqqqqqpgqqd2y62c48glvzrg06rl3nk0qlnga5n7pkfkqy5jwpw
Token Unstakeklv1qqqqqqqqqqqqqpgqh2l3lngsskart7d9t2tdw4ksr4fjfk2kkfkqt7vw6f
Token Managerklv1qqqqqqqqqqqqqpgqprdx0cs4yfpcn0u87hsf89y9f0890f2hkfkq90l8jg
Referralklv1qqqqqqqqqqqqqpgqxtaytlh6qda2ejga0rfh7jlyqzzzv44rkfkqms9xvs

Mainnet

ContractAddress
Energy Factoryklv1qqqqqqqqqqqqqpgqxs9ps7dv7dw3fta05unryxhu5vt9lacnx04sw904q3
Routerklv1qqqqqqqqqqqqqpgqu34l5t0w5qjajuk5w7j9jy4rxxhj974rx04sdw565h
Fees Collectorklv1qqqqqqqqqqqqqpgqxd9d56dm92epqa3f8f35kelap2rd9meax04s4upz5p
Pairklv1qqqqqqqqqqqqqpgq040chxpqvwv3cn0lt6lteujg8289vm02x04sa4qgvs
Auto Position Creatorklv1qqqqqqqqqqqqqpgqclmtdx5krekwat5u5f9fx63chcej6hcvx04ska52xg
Position Creatorklv1qqqqqqqqqqqqqpgq0r0xktu8c2n97erzmxnqzkss4xztafp6x04s970pyf
Simple Lockklv1qqqqqqqqqqqqqpgqx4txntde4lcgtcp29y59fn7cjcv5j3vlx04sd9v58u
Token Unstakeklv1qqqqqqqqqqqqqpgqk3zk5vnmm9xlz0da3ue6c4ghwjml7v3mx04s80t06t
Token Managerklv1qqqqqqqqqqqqqpgqevlxyl2fxxrnnkvhnj7ed3qt0uq8au3sx04suwmqvp
Referralklv1qqqqqqqqqqqqqpgqjd9k34hzy53lsreq4drqkwfedqvtqen3x04sevtrjj

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.mainnet.klever.org/vm/query \
--header 'Content-Type: application/json' \
--data '{
"scAddress": "klv1qqqqqqqqqqqqqpgqu34l5t0w5qjajuk5w7j9jy4rxxhj974rx04sdw565h",
"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.