Important
This documentation is focused on development and contributions for the DeFindex protocol. If you're looking for information about the integration process, please visit the API Integration Guide.
Check the documentation in https://docs.defindex.io/ and find the Audit Report by OtterSec in ./audits/2025
First a commit, for example for mainnet deployment https://github.com/paltalabs/defindex/releases/tag/1.0.0
git checkout f2d2785a805f40f5cb05921648ceec345168b7ed
docker compose up -d
cd contracts
make build
sha256sum ./target/wasm32-unknown-unknown/release/blend_strategy.optimized.wasm | cut -d ' ' -f 1
sha256sum ./target/wasm32-unknown-unknown/release/defindex_vault.optimized.wasm | cut -d ' ' -f 1
These values should be compared with the wasm hashes that you see at Stellar.Expert in the Hash field```
This repo includes the following packages/apps:
Contracts: Soroban smart contracts for the app.Dapp: a Next.js & Soroban React app to manage the indexes.Docs: a Gitbook app to autogenerate the docs of the apps.Landing: : a Next.js app thats shows relevant info about the project.@repo/ui: a stub React component library shared by bothwebanddocsapplications@repo/eslint-config:eslintconfigurations (includeseslint-config-nextandeslint-config-prettier)@repo/typescript-config:tsconfig.jsons used throughout the monorepo
Each package/app is crafted with 100% love by the paltalabs teamπ₯.
First run the following code in a new terminal located in the repo folder to initalize the container:
docker compose up -dthen, once the container is up, run:
bash run.sh
# or
docker exec --tty --interactive defindex-soroban bashto explore and use the container.
Once inside the container, install the project dependencies by running:
yarnTo run the development instances of the apps simply run yarn dev. Turbo repo will automatically run all the apps together.
If you need to run just one app add the flag --filter appname. The code should look like:
yarn dev --filter dappFor more information about dapp, for example how to run it with your own deployment of the smart contracts, please refer to the dapp README.
while inside the docker container you can deploy build and test the smart contracts.
to make this happen, please move into the contracts app folder cd apps/contracts and
run make build.
To build the smart contracts simply run:
bash run
cd apps/contracts
make buildfrom the repo root folder.
Before deploying any contract, you need to setup your secrets:
So, create a .env file in the apps/contracts folder with the following content:
cp apps/contracts/.env.example apps/contracts/.envand fill in the values for the ADMIN_SECRET_KEY, DEFINDEX_RECEIVER_SECRET_KEY and MAINNET_RPC_URL variables.
To deploy the factory contract run:
bash run.sh
cd apps/contracts
yarn deploy-factory <network>Once you have deployed an instance of the factory contract. You can publish the addresses to be used by anyone on the network. To do this run:
bash run.sh
cd apps/contracts
yarn publish-addresses <network>where <network> is the network you are deploying to. The options are testnet or mainnet.
This Turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
To build all apps and packages, run the following command:
cd my-turborepo
yarn build
First, get the specific dart container up by running:
docker compose up -d dartThe genereal docker compose won't launch the dart service.
then, once the container is up, run:
docker exec -it dart-defindex bashThen you can launch the example app by running:
cd example
flutter pub get
flutter run -d web-server --web-port 8080 --web-hostname 0.0.0.0This will launch the example app on the port 8080 of your localhost. so you can go to
http://localhost:8080 to see the app.
If you are getting the folowing error:
[+] Running 0/0
β Container dart-defindex Starting 0.0s
Error response from daemon: network 9b51654ecff85fb4a6176438b85fc52f19e12f994427193e5c35bad48c9c7917 not found
You need to do
docker rm dart-defindex
This is published on https://pub.dev/packages/defindex_sdk
Once everything is ok, you can run the following command to check the package:
dart pub publish --dry-runonce, there is no issues you can run the following command to publish the package:
dart pub publishIt will prompt a link to login:
Please login with your Google account: http://localhost:<port>/?code...Then, you will need to open a terminal connected to the container and run the following command:
curl http://localhost:33791/?code...This will log you in and you can publish the package.
See the TypeScript SDK README for more information.
You can use the defindex-soroban container to develop the SDK.
bash run.sh --nbThen, move to the folder packages/defindex-sdk.
Inside the container, on the defindex-sdk folder, run:
# Login to npm
npm login
# Install dependencies
yarn install
# Build the package
yarn build
# Publish to npm
npm publish --access publicFirst, get the specific dotnet container up by running:
docker compose up -d dotnetThe genereal docker compose won't launch the dotnet service.
then, once the container is up, run:
docker exec -it dotnet-defindex bashIf you are getting a similar error to this one:
Error response from daemon: network 9b51654ecff85fb4a6176438b85fc52f19e12f994427193e5c35bad48c9c7917 not found
You need to do
docker rm dotnet-defindex
To run an example of how this package works,
You need first to set the environment variables in the packages/dotnet-sdk/.env file.
cp .env.example .envThen, you can run the following command:
dotnet run testnet # or mainnetYou may check the specific README for the dotnet package here.
To generate a pdf version of the whitepaper, you need to install mdbook:
cargo install mdbook
# Install mdbook-pdf
cargo install mdbook-pdf
# Install mdbook-katex
cargo install mdbook-katexThen, run the following command:
cd apps/docs/10-whitepaper
mdbook build