Developers
FAQRoadmapEcosystemDevelopers
1.0.0
1.0.0
  • Introduction
  • Definitions
  • Getting Started
    • Using docker
      • Install Docker
      • Build using Docker
    • Install without Docker
      • Prerequisites
      • Setting Up The Node
      • Interact With The Node
      • Building Smart Contracts
    • Deploying Our PoC
      • Asset Manager
    • Interest Calculation
    • Audit Report
  • API References
    • NFT Lend
    • NFT Rent
    • NFT Exchange
  • Community Links
    • Github
    • Twitter
    • Discord Community
    • Telegram Community
    • Telegram Channel
    • LinkedIn
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started

Deploying Our PoC

PreviousBuilding Smart ContractsNextAsset Manager

Last updated 4 years ago

Was this helpful?

Follow the steps below to test our proof of concept that's deployed

  1. Upload contract metadata and wasm (.contract files) for erc20, erc721 and AssetManager

  2. Instantiate erc20 and erc721 contracts first using Alice as owner. erc20 initial supply is set to 1 billion units and both contracts get 10 units endowment.

  3. Instantiate assetmanager contract using Alice as owner. Erc20 and Erc721 addresses will be set to the above deployed contracts; interest rate is set to 10 (% per year); transfer rate is set to 1 million (erc20 per erc721 token) and enabled is set to true.

  4. Alice, being owner of erc20 and erc721, grants approval to assetmanager calling approve and setApprovalForAll of erc20 and er721 respectively.

  5. Now Bob (or any else with balance) can mint an erc721 token, grant approval to assetmanager contract to spend this token, and deposit it in the assetmanager contract in exchange for 1 million erc20 tokens. These tokens are deducted from erc20 owner account (in this case Alice).

  6. There are some utility methods that can be called by anyone to check Bob's outstanding balance and interest payable etc.

  7. To repay, Bob needs to grant approval to assetmanager to spend his erc20 tokens. After that, he can call withdraw method providing the token_id he is withdrawing. The assetmanager contract will deduct principal balance (1 million)+ interest from Bob's erc20 balance, deposit it in erc20 owner (Alice) and transfer erc721 token from Alice to Bob.

here