Skip to content

Set reserved tokens in percents and in tokens

Victor Baranov edited this page Feb 1, 2018 · 7 revisions

Set reserved tokens in percents and in tokens from MyEtherWallet

  1. Go to https://www.myetherwallet.com/#contracts

  2. Choose the network. For example, (ETH) Etherscan.io, if your contract is in mainnet.

  1. Attach to your token contract. The token contract address and its ABI are taken from the file downloaded at Step 4 of Token Wizard:

    • ABI of the token contract is under this line: Token contract ABI: in the file.

    Then click Access button.

  1. In Select a function combo choose setReservedTokensList method

  1. In How would you like to access your wallet? choose any preferable option. If you chose MetaMask/Mist, click "Connect to Metamask".

  1. Enter method data:

    • Fill addr input with the address, for which tokens are reserved.
    • Fill inTokens input with tokens amount multiplied to 10 to n power, where n is the number of the token decimals (For example, we want to set 255 tokens, which decimals number is 18. Then we should fill input with 255000000000000000000).
    • Fill inPercentage input with the amount of percents.
  2. Click Write.

  3. Choose 0 in Amount to Send. The Gas Limit will be calculated automatically. Click "Generate transaction".

  1. You'll see the transaction data. Click Yes, I am sure. Make transaction..

  1. Confirm transaction in MetaMask popup.

Set reserved tokens in percents and in tokens by method signature

  1. Open MetaMask Chrome plugin

  2. Connect to the network, where the crowdsale contract is deployed. For example, mainnet.

  3. Choose an account, which is the owner of crowdsale. This account should has sufficient balance in this network too.

  4. Send transaction to the address of the token contract with the data = 0xf30f8508 + address_for_tokens_reservation + hex(number_of_tokens*10^decimals) + hex(number_of_percents), where

    • 0xf30f8508 - signature of the method;
    • address_for_tokens_reservation - address, for which tokens are reserved, normalized to 32 bytes (required number of zeros before address);
    • hex(number_of_tokens*10^decimals) - number of tokens multiplied to 10^(decimals), hexed, normalized to 32 bytes (required number of zeros before address).

    For example, we want to set 10 tokens, which decimals are 18. number_of_tokens*10^decimals = 10*10^18 = 10000000000000000000. Hex from it will be 8ac7230489e80000 and normalized to 32 bytes will be: 0000000000000000000000000000000000000000000000008ac7230489e80000.

    • hex(number_of_percents) - hex from number of percents, normalized to 32 bytes (required number of zeros before address). For example, we want to set 10%. Hex from 10 will be a and normalized to 32 bytes will be: 000000000000000000000000000000000000000000000000000000000000000a.

For example, if you need to reserve 10% of total number of issued tokens and 10 tokens for wallet address 0x6e524b4aa2174f32eba4ddfcfa5fb168f1d753, the data should be: 0xf30f8508000000000000000000000000006e524b4aa2174f32eba4ddfcfa5fb168f1d7530000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000000a. Amount to send should be 0.

Clone this wiki locally