Skip to content

Instantly share code, notes, and snippets.

@sagarjethi
Created February 28, 2018 20:49
Show Gist options
  • Save sagarjethi/f304b833df14e565b25c1ae219c9e787 to your computer and use it in GitHub Desktop.
Save sagarjethi/f304b833df14e565b25c1ae219c9e787 to your computer and use it in GitHub Desktop.
Public reserved account = 900M tokens
We have created ICO contract and sent 10M token to ICO contract.
ICO contract = 10M
From ICO contract 2M token are sold till now.
So now assume that a board of director wants to use their tokens, they want to transfer to some, then we can cross check to assure it is as per allowed limit.
Public reserved balance = 890 M
uint256 publicReservedRemaining = balances[publicReservedAddress];
ICO contract= 10 M
uint256 icoToken = saleToken.getTotalTokenCount();
ICO sale token =2M
uint256 publicSoldToken = saleToken.getSoldTokenCount();
898=890+10-2
publicReservedRemaining = publicReservedRemaining.add(icoToken).sub(publicSoldToken);
now we calculate % total contract in use. A number of percentages which allow for board director can use.
900 - 898
100 -?
uint256 publicReservedSoldPersentage = publicReservedRemaining.mul(10000).div(publicReservedToken);
2% of the token can use the total balance can be use admin
For ex, a board member have 2M tokens. but they can use only 2% of 2M.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment