Giter Club home page Giter Club logo

dot-contract's Introduction

dot-contract

Description

Nsure is an open insurance platform for Open Finance. The project borrows the idea of Lloyd’s London, a market place to trade insurance risks, where premiums are determined by a Dynamic Pricing Model. Capital mining will be implemented to secure capital required to back the risks at any point of time. A 3-phase crowd voting mechanism is used to ensure every claim is handled professionally. You can get all the information here: https://nsure.network/Nsure_WP_0.7.pdf

Contract Functions

Support capital mining and underwriter deposit/withdraw. This is the mvp for nsure.

capital_converter converts the dot token to ndot which is the token used to stake in Nsure's capital pool. Ndot reperesents your share when deposited into the capital pool. Rewards in Nsure will be distributed based on time weighted manner.

erc20 is a smart contract similiar with erc20 token contract.

capital_stake is the staking mining contract. Stake nDot to get reward in Nsure token.

underwrite is the contract for Nsure token staking. Rewards can be adjusted.

Test

Run cargo +nightly test to do testing.

Smart Contract Deployment

Compile

Go to root directory, run cargo +nightly contract build to compile

Deploy

Deploy file in corresponding directory target/ink/*.contract

  1. Go to https://patrastore.io/#/jupiter-a1/system/network to get test tokens to deploy smart contract

  2. Open https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fws.jupiter-poa.patract.cn#/explorer

  3. Select testnet Jupiter -> via Patract

Deploy 3 contracts step by step

  1. Deploy erc20 nsure contract
  • Initiate contrct name as 'nsure'
  • Initiate parameter initialSupply = 1000000000000000000,name=nsure,symbol=nsure,decimals=10
  • add minter,mint token,transfer nsure
  1. Deploy capital_convert contract
  • Set contract name as 'capitalConvert'
  • Initiate parameter name=nDot,symbol=nDot,decimals=10,token=3gV4DFkJKtEPs3Y4fhqSQssx6duhcFvBfjkXbZgMe7BAh4py
  • Execute setMaxConvert to set maximum amount
  • convert dot to nDot
  1. Deploy capital_stake contract
  • Initiate contrct name as 'capitalStake'
  • Initiate parameter signer = Your address,nsure= deployed nsure contract address,startBlock=current block number
  • add by execute 'add(100,nDot 'contract address',true,100000000000000000)', to add stakable nDot token
  • stake nDot

License

Nsure dot contracts and all other utilities are licensed under Apache 2.0.

Contact

If you want any further information, feel free to contact us at [email protected] :) ...

dot-contract's People

Contributors

recoba8814 avatar trybye avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.