A CosmWasm smart contract (with Provenance extensions) that manages loan dicer token (LDT) contributions and redemptions. The contract keeps track of pending contributions/redemptions, validates scope ownership, and mints/burns tokens via Provenance markers.
- Contributions: OTC initiates and finalizes contributions to mint LDT.
- Redemptions: Token holders initiate redemptions to receive underlying scopes, with pooling support.
- Marker integration: Uses Provenance markers for LDT and redemption pooling.
- Reference lookup: Optional human-friendly references for contributions and redemptions.
CONFIGURATION: OTC, trust address, LDT denom, redemption marker adminPENDING_CONTRIBUTIONS: pending contributions by IDPENDING_REDEMPTIONS: pending redemptions by IDCONTRIBUTION_REFERENCES: optional reference → contribution IDREDEMPTION_REFERENCES: optional reference → redemption ID
Message: InstantiateContractMsg
{
"otc_address": "...",
"trust_address": "...",
"ldt_denom": "...",
"redemption_marker_admin": "..."
}On instantiation, the contract stores configuration and creates the LDT marker with the contract as admin.
InitiateContribution { scope_uuids, mint_ldt_amount, contribution_ref }FinalizeContribution { contribution_id, marker_denom }CancelContribution { contribution_id }InitiateRedemption { burn_ldt_amount, scope_uuids, pool_denom, num_coins, redeemer_address, redemption_ref }PoolRedemption { redemption_id, num_scopes_to_pool }FinalizeRedemption { redemption_id }CancelRedemption { redemption_id }
See src/msg.rs for full schema and docs.
GetPendingContribution { contribution_id }GetPendingContributionByReference { contribution_ref }GetPendingRedemption { redemption_id }GetPendingRedemptionByReference { redemption_ref }GetConfiguration {}
cargo buildcargo build --release --target wasm32-unknown-unknowndocker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/optimizer:0.17.0This command matches the optimizer script defined in
Cargo.tomlunder[package.metadata.scripts].
cargo testSee LICENSE.