Consensys / UniversalToken

Implementation of Universal Token for Assets and Payments
Apache License 2.0
347 stars 189 forks source link

Question regarding usage of ERC1400HoldableToken, DVP, DVPHoldableLockable #121

Closed aridder closed 2 years ago

aridder commented 3 years ago

Hi,

Great work with UniversalToken. I need some guidance.

Im working with a project which build a captable for norwegian business registry. Board directors will be able to migrate their business to this captable. Other official public service providers in norway are also looking into something similiar.

We are currently trying to minimize logic from the code running on servers into smart contracts.

Many of these things are new to me and would be very grateful to be pointed in a direction regarding my question:

With the usage of ERC1400, how can I create something this flow:

  1. tokenOwner call transferByPartition to transfer token of some partition to a recipient
  2. funds are held because recipient is not approved by boardDirector (controller or operator)
  3. boardDirector approves and tokens are unheld and transferred to recipient

I tried to use DVP.sol, but then I was only able to escrow the tokens. But I need to know who is the owner of the tokens while they are escrowed because of legal question. Therefor I tried to use ERC1400HoldableToken.sol. This is done here in this repo. Look there for test cases and implementation.

The issue there is that I want to enforce that ONLY boardDirector can be the rotary, but ERC1400TokensValidator.sol let the caller to holdFrom set whoever they want as a notary.

Any idea of how I could solve this?

Asbjørn

aridder commented 2 years ago

@gauthierpetetin and @ecp4224 helped me and my team in a conference call. Thank you.

Will try using certificates which restricts transferByPartition() issueByPartition() and operatorTransferByPartition() to only work with certificates. Will use hold() and holdFrom() to be able to make holds which supports reliability of registry