I work on solidity airdrop contract. I tested the contract in ropsten testnet https://ropsten.etherscan.io/address/0xc91cc586a0f4b08df677b0b0ef3e1e96cea9a1b2#tokentxns Our goal is working multisend function. As you can see on the ropsten network, everything works fine (https://ropsten.etherscan.io/tx/0xe8c998d5ac6a1ded0fc695f641a1e0b7afc0c861197b37219f8326fae4210e1f multisend function works fine). I have problems with this feature in the public network even though the smart contract is identical (https://etherscan.io/address/0xf76672b64f62f72ef9ac64df24fde45366b09770#code). The multisend function call fails (https://etherscan.io/tx/0x90d6ce9bbf42b1118bdd58cf96b9a923f94aa16617ce5823976fd7d01be10454)

In the ropsten network web3 successfully estimate gas price but in public network i get an error: "gas required exceeds allowance or always failing transaction". I have to put the price manually

  • What is the code for the LBA token? Jul 27 '18 at 23:56
  • @RaghavSood I requested the contract code and found in it the following function transfer declaration: function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); }
    – akhoroshev
    Jul 28 '18 at 13:48
  • @RaghavSood my airdrop contract does not work because I used a function declaration of transfer that returns a boolean value, am I right? function transfer(address to, uint256 value) public returns (bool);
    – akhoroshev
    Jul 28 '18 at 13:53

Your airdropper's transfer function is defined as:

function transfer(address to, uint256 value) public returns (bool);

However, as mentioned in your comments, the LBA token is using:

function transfer(address to, uint256 value);

The missing return type causes the issue. Although both functions have the same signature (since return type is not included in the signature calculations), they will not function if your code is compiled with solidity 0.4.22 or higher.

The byzantium hardfork introduces a new opcode, RETURNDATASIZE, which (as the name implies) stores the return data size for a call. It's mostly targetted towards variable array size returns. However, in your case, it expects a return of a bool, but gets nothing, which then leads to a revert.

Solidity 0.4.22+ default to byzantium compatible code, and thus causes this error.

You should change your token interface signature to fix this.

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.