/collateral

Substrate runtime implementation: collaterize non-fungible assets for cash

Primary LanguageRustThe UnlicenseUnlicense

Simple Collateral

A simple implementation of tokenized debt, with simple-interest. A token owner can collateralize a non-fungible token for a loan, and pay it back with interest. Creditors can seize the collateral upon loan default.

Note:

  • This is a WiP. Be warned.
  • Major refactoring needed: looking for Substrate specific pointers & Rust syntax pointers

Modules:

  • Debt: handles creation of loan requests, paybacks, seizing of collateral.
  • ERC721: adapted from this sample to also be able to collateralize and uncollateralize tokens for a reason.

Run Tests

cargo test -p node-template-runtime -- --nocapture

Run

./build.sh
cargo build --release
./target/release/collateral --dev

UI

https://substrate-ui.parity.io/ Local Node (127.0.0.1:9944)