corpus-io / tokenize.it-smart-contracts

These are the smart contracts used in tokenize.it, along with documentation.
GNU Affero General Public License v3.0
24 stars 4 forks source link

move vesting lockup creation to VestingCloneFactory #319

Closed malteish closed 10 months ago

malteish commented 10 months ago

Creating a vesting contract clone and a vesting plan in that clone in one transaction was possible only through the private offer factory. As PrivateOffers with off-chain payment are not executed through this factory, but through a simple mint instead, they didn't benefit from this feature.

A lock-up of minted tokens could be achieved through these workarounds instead:

  1. Using the companies normal vesting contract. This is not great, because the tokens of several investors would be mixed in the contract, an admin could stop vesting plans or create other vesting plans to steal the tokens.
  2. Deploy a dedicated vesting contract through the normal factory. This isn't much better, and requires the company admin to sign multiple transactions (at least 2: the mint and the vesting plan creation. Plus the renounceOwnership if that is wanted).

I decided to move the already existing function from PrivateOfferFactory to VestingCloneFactory and call it createVestingCloneWithLockupPlan. This is clearer, and allows us to use it for minted tokens, too.

This PR will receive some more love in the form of documentation and additional tests. The tech itself should be ready though.

openzeppelin-code[bot] commented 10 months ago

move vesting lockup creation to VestingCloneFactory

Generated at commit: 95f349a1a99741b1c47ab92263a8510a77bf0be7

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
0
0
0
8
35
43
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
2
44
46

For more details view the full report in OpenZeppelin Code Inspector