Skip to content

Set Crowdsale Start and End Time

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

What are we doing:

The setStartsAt & setEndsAt functions allow you to change the exact Date and Time for each Tier using unix timestamp if the tier is updatable.

When should we do it:

You need to do this if you would like to change the Start & End times for each tier. Each tier will have its own contract and address.

While changing the times of Crowdsale tiers

  1. If Crowdsale tier has already begun, you cannot change the start time

  2. If Crowdsale tier has already ended, you cannot change the end time

  3. If Crowdsale has multiple tiers and you want to change EndsAt time for a tier that is not last, make sure you change the next tier's StartsAt time so you won't get an error for overlapping times.

Set StartsAt & EndsAt from the Manage crowdsale page

  1. Go to the manage crowdsale page for your crowdsales (see instructions here)

  2. If the tier you want to modify is updatable, you'll be able to modify the inputs with the start and end dates.

  3. After changing the dates, click the Save button and confirm the transactions.

Set StartsAt & EndsAt 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 CrowdsaleContract: crowdsale contract address and ABI are taken from the file downloaded at step 4 of Token Wizard.

    • ABI of the contract is under the line ****Crowdsale contract ABI:****

    Then click Access button.

  1. In Select a function combo choose either setStartsAt or setEndsAt 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 the data:

    • Fill Time input with the unix time of your choice for either Start or End time. You can find unix time for any date at https://www.unixtimestamp.com/.
  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 setStartsAt 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 have sufficient balance in this network too.

  4. Send transaction to the address of the tier crowdsale contract with the data = 0xbf5fc2ee + unix_timestamp, where

    • 0xbf5fc2ee - the method's signature
    • unix_timestamp - hex encoded unix timestamp of desired time & date, normalized to 32 bytes (required number of zeros before address).

    For example, if you need to setStartsAt for a tier to end on December 25, 2017 at 12:00am, the unix timestamp would be 1514160000 and the hex encoded value is 5a403f80. Take the method's signature 0xbf5fc2ee + 000000000000000000000000000000000000000000000000000000005a403f80. 0xbf5fc2ee000000000000000000000000000000000000000000000000000000005a403f80

Amount to send should be 0.

Set setEndsAt 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 have sufficient balance in this network too.

  4. Send transaction to the address of the tier crowdsale contract with the data = 0x6e50eb3f + unix_timestamp, where

    • 0x6e50eb3f - the method's signature
    • unix_timestamp - hex encoded unix timestamp of desired time & date, normalized to 32 bytes (required number of zeros before address).

    For example, if you need to setEndsAt for a tier to end on December 25, 2017 at 12:00am, the unix timestamp would be 1514160000 and the hex encoded value is 5a403f80. Take the method's signature 0x6e50eb3f + 000000000000000000000000000000000000000000000000000000005a403f80. 0x6e50eb3f000000000000000000000000000000000000000000000000000000005a403f80

Amount to send should be 0.

Clone this wiki locally