vegaprotocol / Vega_Token_V2

The Vega Protocol ERC20 token, with vesting tranches

Home Page:https://vega.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proxy contract: Balance of vested and unvested tokens

edd opened this issue · comments

commented

Note: This is an acknowledged 'bit of a hack' and is not essential or blocking anything. But if it's a success, it'll slightly improve the the lives of people wondering how many VEGA tokens they have in V2 across all tranches

Goal

A user of Metamask / other wallet should be able to add this token address and see their balance as the sum of their token balance in all tranches

Example 1: tokens in tranches

  • 0xedd has 10 tokens in tranche 0
  • 0xedd has 10 tokens in tranche 1
  • 0xedd on the new proxy contract has a balance of 20 tokens

Example 2: Edd has redeemed tokens in tranches

  • 0xedd has redeemed all 10 tokens in tranche 0
  • 0xedd has 10 tokens in tranche 1
  • 0xedd on the new proxy contract has a balance of 10 tokens

Tasks

  • Add a new ERC20 token on Ropsten that represents the total balance an address has across all tranches of the vesting contract

Notes

  • For testing purposes, tranche 0 should already exist and can have tokens allocated to it
  • function create_tranche(uint256 cliff_start, uint256 duration) public only_controller {
    can be used to create new tranches
  • This is expected to be quick, and imperfect. If it takes more than a few days, it's not worth the hassle. If it works but isn't nice, we'll never tell anyone about it
  • Users will not be able to transfer balances. This contract only represents balances

Slack ref: https://vegaprotocol.slack.com/archives/CMVDT0ZU6/p1626095691384100?thread_ts=1626091258.380400&cid=CMVDT0ZU6

cc @C0deMunk33 / @MM0819 / @barnabee

Code for this now lives here until we decide whether it is worth deploying on mainnet: https://github.com/vegaprotocol/vega-erc20-proxy