Activation - GenusDev/genie-portal GitHub Wiki

Goes through Stages

    1. A project is activated
    1. A number of inactive tokens are converted into a pending status, based on the valuation of the project that was activated.

To activate pending tokens, you have to pass in an address for each investor into a function that activates pending tokens they own. In order to find the number of pending tokens they have, the contract takes difference of how many inactive tokens they have relative to the total inactive tokens in circulation. The contract essentially takes a percentage or ratio, and applies to the total pending tokens.

Contract structure

Methods: Try activate project, which anyone can call. What it does: it checks the project leader tracker to see if a project can be activated. If the current leader can be activated, then it activates the project using a separate function. If project deploys the contract notifies the project instance, and the project leader tracker and it increases the pending activation in inactive token. It then tells the crowdsale to transfer capital to the developer. And finally it emits an event to with the project that was activated's address, capital required and the time it was deployed.

(bug) (fixed)

If you increase the number of inactive tokens before you activate their pending tokens, it will find the wrong ratio, because the ratio we want has to be the ratio at the time that those tokens became pending. What was happening was that we were pitching more projects, which was giving more inactive tokens to the developer without first activating their pending tokens. It was trying to subtract away too many tokens from the pending activations, (going under zero) and thus reverting.

Fix: By keeping track of the ratio of each account's token holdings at different points in time, we ensure that the ratio that we are applying is the the same as when the project activated.