8000 GitHub - issuance/contracts-1: Smart contracts comprising the business logic of the Dharma Protocol
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

issuance/contracts-1

 
 

Repository files navigation


Dharma is a protocol for generic tokenized debt issuance and fundraising on blockchains supporting requisite smart contract functionality (i.e. EVM blockchains). For a full description of the protocol's mechanics, a thorough overview can be found in the Dharma Protocol Whitepaper. This repository contains the core contracts that compromise the business logic for issuing and administering debt crypto-assets on-chain.

We use truffle for deployment, testing, and development.

Join us on our chat for any technical or general questions.

Setup


Dependencies

Install dependencies:

npm install
Testing

Start testrpc:

npm run testrpc

Run truffle tests:

npm test

Contract Architecture


  1. LoanLib.sol

A wrapper library for all business logic associated with crowdfunding, administering, and pricing-via-auction any loans issued under the Dharma Protocol. Loans inherit logic from RedeemableTokenLib, and, as such, expose standardized logic for redeeming value from loan repayments on a pro-rata basis for debt token holders. Note that this generic logic is exposed in the form of a library, and that no state is stored in the LoanLib.sol. 2. LoanRegistry.sol

This contract functions as a factory for creating debt assets in Dharma Protocol, and, in turn, as a registry and store for state and metadata associated with said assets. The business logic exposed by these assets is inherited from LoanLib.sol.

  1. RedeemableTokenLib.sol

Implements a superset of the ERC20 token standard's functionality that allows for what we call "redeemable tokens". Redeemable tokens are assets where ownership of a token represents a right to pro rata cash flows that are generated by the asset. As an illustrative example, consider a loan as a redeemable token: if an individual holds X% of the token supply, and a repayment is made to the loan (i.e. the totalValueAccrued is increased by Y), that individual will be able to redeem X% of the totalValueAccrued. This functionality is inherited by LoanLib.sol.

  1. VersionRegister.sol

A centrally managed on-chain registry of the above contracts' deployed addresses as corresponding to the protocol's release version. For the time being, this is a (centralized) mechanism for upgrading the protocol contracts.

  1. SafeMath.sol

All of the above contracts use SafeMath.sol as a generic library for safe mathematical operations. The file is part of OpenZeppelin's fantastic libraries.

  1. Migrations.sol

Boilerplate migration code used by the truffle framework.

About

Smart contracts comprising the business logic of the Dharma Protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%
0