Skip to content

Update joined crowdsales

Victor Baranov edited this page Feb 2, 2018 · 12 revisions

What are we doing:

Fills array of all tiers addresses for any tier of the crowdsale. For 1-tier contract with address x it will be [x].

When should we do it:

You need to do this, if joinedCrowdsales array property of the tier contract is empty. If you have n tiers, you should check this property at any tier.

Update joined crowdsales 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 crowdsale/tier contract. The crowdsale/tier contract address and its ABI are taken from the file downloaded at Step 4 of Token Wizard:

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

    Then click Access button.

  1. In Select a function combo choose updateJoinedCrowdsalesMultiple 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. Fill addrs input with the array of tiers addresses, that can be found in the file downloaded at step 4 of Token Wizard.

  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.

Update joined crowdsales 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 crowdsale contract with the data = 0x04fc7c6d + hex(number_of_tiers*32) + number_of_tiers + address_of_a_tier.

    where

    • 0x04fc7c6d - the method's signature
    • hex(number_of_tiers*32) - hexed number_of_tiers*32, normalized to 32 bytes (required number of zeros before address). For example, if you have 1 tier, number_of_tiers*32 = 1*32 = 32. Then hex(32) = 20 and normalized to 32 bytes will be 0000000000000000000000000000000000000000000000000000000000000020
    • number_of_tiers - number of tiers, normalized to 32 bytes (required number of zeros before address). For example, if you have 1-tier contract it should be 0000000000000000000000000000000000000000000000000000000000000001;
    • address_of_a_tier - address of a tier, normalized to 32 bytes (required number of zeros before address).

    For example, if you have only 1-tier crowdsale contract with address 0x1c6d46dedd61ef982f0938e73975404b8de6d739, the data should be: 0x04fc7c6d000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000001c6d46dedd61ef982f0938e73975404b8de6d739. Amount to send should be 0.

Clone this wiki locally