2

I had a question re sending transactions. In ICOs now you have to be really quick off the mark sending your contribution and they can be rejected if you send before they start.

If we take for example one that starts at 1300. If I hit generate transaction at 1259 and then send transaction at 1301 will that be accepted or rejected? ie will they take 1259 as my time and thus reject it or will it be considered as 1301.

I'm just asking so I can get my payment organised asap and ready to send,

Thanks,

Chris

  • Check the ICO contract you are going to participate. What it is going to use to check time? blocknumber or timestamp? – Luiz Soares Jan 17 '18 at 13:23
0

Solidity doesn't have access to a transaction timestamp, so the timestamp used is usually the timestamp of the block in which it was mined.

This means a transaction send earlier that is mined at the opening time will be valid. However, if it gets mined too soon it will fail and you'll end up wasting the money you spent on gas.

0

You should almost always be able to prepare a transaction before a crowdsale starts and submit it as soon as the crowdsale has begun.

Crowdsale contracts will check either the current block number or the current time when the transaction is submitted (not generated) to determine if the transaction can be accepted or not. The block number or time checked is always taken from the blockchain, not the transaction you've created.

If the crowdsale contract used a time referenced in the transaction you generated someone could easily create a transaction that pretends the time is in the future and purchase tokens earlier than the start of the crowdsale.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.