Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vesting Native Scripts generation (supertask) #60

Open
2 tasks
samuelWilliams99 opened this issue May 23, 2022 · 2 comments
Open
2 tasks

Vesting Native Scripts generation (supertask) #60

samuelWilliams99 opened this issue May 23, 2022 · 2 comments

Comments

@samuelWilliams99
Copy link
Contributor

samuelWilliams99 commented May 23, 2022

This task is to write an additional CLI command for vesting recipient verification and airdrop input file generation.

This command will take as input:
A filepath pointing to a json file containing the following format:
For now, we will only parse Private Sales, we will likely implement tokenomics as a separate command, reusing some code.

data PrivateSale
  = PrivateSale
    { address :: Address -- Treasury address
    , start :: POSIXTime
    , tranches :: [Tranche]
    , assetClass :: AssetClass -- Vesting token
    , investors :: [PrivateInvestor]
    }

data PrivateInvestor
  = PrivateInvestor
    { address :: Address
    , allocation :: Integer -- Amount of vesting tokens to lock (note, this is likely NOT equal to the total amounts of investments, as different tokens)
    , investments :: [Investment]
    }

data Investment
  = Investment
    { tx :: TxId -- Tx that sends below asset class to payment address
    , assetClass :: AssetClass
    , amount :: Integer -- Amount of above asset class expected to be sent to payment address
    }

data Tranche
  = Tranche
    { percentage :: Integer -- out of 1000
    , duration :: Integer -- number of slots, we may change this to a POSIXTime in future, but conversions between these are currently not correct in plutus
    }

Tasks:

  • Write the CLI interface and flag parsing into some kind of VestConfig data type.
  • Using the same tool other tokenomia commands use to query the chain, pull down all the given transactions. Verify each pays the expected amount to the treasury address of the payment token for each Investment. If a transaction does not do this, or does not exist, fail out gracefully.
  • Further tasks defined later.
@samuelWilliams99
Copy link
Contributor Author

TODO:
Update inputs to match (but in JSON):

type Schema =  Endpoint "Vest Private Sale Funds" PrivateSale

data PrivateSale
  = PrivateSale
    { address :: Address
    , start :: DateTime
    , tranches :: Tranches
    , assetClass :: AssetClass
    , investors :: [PrivateInvestor]
    }

data PrivateInvestor
  = PrivateInvestor
    { address :: Address
    , allocation :: Amount
    , investments :: [Investment]
    }

data Investment
  = Investment
    { tx :: TxHash
    , assetClass :: AssetClass
    , amount :: Amount
    }

So you will to check that :

  • funds have been sent to the Private Sale Address
  • the amount sent is correct
  • the assetClass is correct
    You can trust us for the amount of tokens to vest as we will probably accept multiple tokens for investing (at least ADA and CLAP), the ratio will be different.

@samuelWilliams99
Copy link
Contributor Author

Note that slot conversions are current incorrect in plutustx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant