Start with a copy of the Compound Finance (COMP) token ERC-20 contract (since we want to use the Compound governance model for SPS) and make the following changes:
- Add admin to COMP token (address that is stored in storage, should be included in constructor at deploy time, has special privs aka
onlyAdmin
or something). Should be able to:- update the admin ✔️
- update minter ✔️
- update stake modifier ✔️
- Add minter (privileged address, include in constructor). Should be able to:
- call mint function ✔️
- Mint function should be added. Takes address and amount, and adds amount to address's balance, updating total supply. Only able to be called by the address specified as the "minter". ✔️
- Add "stake modifier" - define an interface with a function call that takes address of token holder, amount held, and number of votes, and returns voting power amount. On BEP-20 contract, define address that conforms to stake modifier interface. Find part of code where voting power is determined, and instead of just returning token balance, call out to stake modifier and return that value. Initially could call dummy contract, or could conditionally return fake value if stake modifier address is 0x0.✔️
- Add "bridgeTransfer" method (basically the same as "transfer" but includes a parameter for "externalAddress" which could be the Hive username). This is similar to the "convertTokenWithTransfer" method on the DEC contract. ✔️
- Emit a custom event that can be checked by bridges ✔️