Skip to content

Shared-Trove on Liquity. This is a smart contract that is able to create a shared-trove.

Notifications You must be signed in to change notification settings

masaun/shared-trove-on-liquity

Repository files navigation

Shared-Trove on Liquity


【Introduction of the Shared-Trove on Liquity】

  • This is a smart contract that is able to create a shared-trove:
    • multiple users per single Trove, with the aim of a reduced minimum net debt per user,
    • and batched top-ups / adjustments / withdrawals to save on gas costs (※ Note: Implementation of withdrawals above is still in progress)

 


【Workflow】

  • Diagram of workflow 【Diagram】Shared-Trove on Liquity

 


【Remarks】

  • Version for following the Liquity smart contract
    • Solidity (Solc): v0.6.11
    • Truffle: v5.1.60
    • web3.js: v1.2.9
    • openzeppelin-solidity: v3.2.0
    • ganache-cli: v6.9.1 (ganache-core: 2.10.2)

 


【Setup】

① Install modules

  • Install npm modules in the root directory
$ npm install

② Compile & migrate contracts (on local)

$ npm run migrate:local

③ Test (Kovan testnet-fork approach)


  • 2: Start ganache-cli with kovan testnet-fork (using Infura Key of Kovan tesntnet)
$ ganache-cli -d --fork https://kovan.infura.io/v3/{YOUR INFURA KEY OF KOVAN}

(※ -d option is the option in order to be able to use same address on Ganache-CLI every time)
(※ Please stop and re-start if an error of "Returned error: project ID does not have access to archive state" is displayed)


  • 2: Execute test of the smart-contracts (on the local)
    • [Main test]: Test for the SharedTrove contract
      $ npm run test:SharedTrove
      ($ truffle test ./test/test-local/SharedTrove.test.js)

    • [Sub test]: Test for the SharedTroveFactory contract
      $ npm run test:SharedTroveFactory
      ($ truffle test ./test/test-local/SharedTroveFactory.test.js)

    • [Sub test]: Test for the BorrowerOperations contract
      $ npm run test:BorrowerOperations
      ($ truffle test ./test/test-local/BorrowerOperations.test.js)



【References】

About

Shared-Trove on Liquity. This is a smart contract that is able to create a shared-trove.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published