I'm trying to deposit my ERC-20 Token to DexDelta (EtherDelta fork) but it fails and I don't understand why, could someone help please? I first call approve with DexDelta contract address and the amount, then call Deposit from the exchange site and this transaction fails These are my approve and transferfrom functions

    function transferFrom(address _from, address _to, uint256 _value) returns (bool success){
    require(allowed[_from][msg.sender] >= _value && balances[msg.sender] >= _value  && _value > 0);
    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    Transfer(_from, _to, _value);
    return true;

function approve(address _spender, uint256 _value) returns (bool success){
    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
    return true;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.