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
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:56transferIns[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