0

My ICO crowdsale contract had

Contract Warning! Error encountered during contract execution [Reverted]

https://etherscan.io/tx/0xfe4349d2e054fb7d48a7383d7145afe8852974f702f8a99c08daadc4d706c3ba

https://etherscan.io/address/0x1b2f1ddb9696bb6869999636121277c271f6f23c#code

Does anyone know what issue and help ?

3
  • Can you share the Solidity code and the code that calls the smart contract? Commented Jan 11, 2019 at 11:27
  • Most likely, the require condition in contract function failed. If you put custom error message in require condition, you will see that in remix that which condition failed. Commented Jan 11, 2019 at 12:04
  • Here is the Solidity code etherscan.io/address/…
    – Kevin Ng
    Commented Jan 11, 2019 at 13:01

1 Answer 1

0

From the parity's transaction trace

Action [6]  
    CallType:   call
    From:    0x1b2f1ddb9696bb6869999636121277c271f6f23c
    Gas:    3849695 Gwei
    To:  0xfc72bf8cba2a82fd887f35ce36fbec5d8ed97465
    Value:  0 Ether
    BlockHash:  0xbf2163124c4db9200787f305e03025ad4bf174d3107b7f116c43c28f7fc4e6b9
    BlockNumber:    7047218
    Error:  Reverted
    Subtraces:  0
    TraceAddress:   [ 4 ]
    TransactionHash:    0xfe4349d2e054fb7d48a7383d7145afe8852974f702f8a99c08daadc4d706c3ba
    TransactionPosition:    167
    Type:   call

It reverts when calling the BtcexToken

Checking the balance of BtcexCrowdsale the problems is obvious, it has zero tokens.

The failure is caused in _deliverTokens function

  function _deliverTokens(
    address _beneficiary,
    uint256 _tokenAmount
  )
    internal
  {
    token.safeTransfer(_beneficiary, _tokenAmount);
  }

The crowdsale tries to transfer tokens to the beneficiary but it doesn't have enough tokens.

Perhaps the tokens wasn't correctly initialized it seemd transferOwnershipAndTotalBalance() should be called and it wasn't (also that function is missing a Transfer() event so I can't be sure).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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