How to handle an ERC20 token which does not return true/false at the end of transfer/transferFrom

The ERC20 Token Standard dictates that functions transfer and transferFrom should return true for success and false for failure. However, various ERC20 tokens deployed on the network have not implemented this requirement. Subsequently, how would you go about asserting success or failure? The only way that comes to mind is this: uint256 prevSourceBalance = token.balanceOf(address(this));…

Is transfer() still safe after the Istanbul update (2300 gas limitation)?

In other words, in contract A: function transfer() public payable { contractB.transfer(1000); balances[msg.sender] -= 1000; } // Before Istanbul this sends 1000 wei with 2300 gas, calling back will result in “out of gas”, correct? What about ,also is this remotely possible: //receiver, contractB: function () public payable { _data = 0; //instead of “0”…

Lightning – why are commitment transactions supposed to use different keys

In the paper BIP32 and deterministic key derivation is mentioned. But why given that two peers directly exchange messages (i.e., there is no need to obscure anything)? Alice always exchanges state with Bob and that commitment transactions usually don’t land on the blockchain. Punishments for transmitting an old state can be done by attaching to…