1

Normal transfer works normally with this erc20 token: https://etherscan.io/address/0xe9e74bae31892b6b1c000e009c93438dbd14d723#code When withdrawing from the Etherdelta contract: https://etherscan.io/address/0x8d12a197cb00d4747a1fe03395095ce2a5cc6819, it uses too much gas and the transaction fails. Looking at the geth trace it does this when it gets to SSTORE. Example transaction where this happens: https://etherscan.io/tx/0x86f1bb1cdd200723662026b59db4dbd91cf24a5a7a785574d3ae4188baeb14ae This contract has a mint function and it seems before that was used withdrawing from Etherdelta worked normally: https://etherscan.io/tx/0x0e2705298acf45f36cc74a56f881280d49c40e0917fd2c5872f52998985cb446

Can anyone explain what is happening?

There is a similar contract that does not have this problem: https://etherscan.io/address/0xee609fe292128cad03b786dbb9bc2634ccdbe7fc#code

  • What parameters did you use when you called withdrawToken? – K. Fichter Nov 05 '17 at 03:15
  • Those are determined by the Etherdelta smart contract. Max gas limit is set to 250000, but with a normal transfer that would be more than enough. What is strange is there is an almost identical contract that is able to withdraw from Etherdelta, and withdrawToken worked fine before. – Curious2424 Nov 05 '17 at 05:12
  • My guess is the line if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender]; is clearing the storage and it is causing the call to use too much gas. You have to contact the contract authors to advice on what you can do. – Ismael Nov 05 '17 at 15:56
  • And yet this contract: https://etherscan.io/address/0xee609fe292128cad03b786dbb9bc2634ccdbe7fc#code is exactly the same if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender]; and doesn't have the same withdraw problem. – Curious2424 Nov 06 '17 at 07:48
  • @Curious2424 transferIns[msg.sender] is an array, and delete is trying to release the storage, if the array is large it will spend a large amount of gas because it has to set all elements to zero. Different contracts can have different storages and will have different expenditures. – Ismael Nov 06 '17 at 17:00

0 Answers0