contract TokenRecipient {
    event ReceivedEther(address indexed sender, uint amount);
    event ReceivedTokens(address indexed from, uint256 value, address indexed token, bytes extraData);

    /**
     * @dev Receive tokens and generate a log event
     * @param from Address from which to transfer tokens
     * @param value Amount of tokens to transfer
     * @param token Address of token
     * @param extraData Additional data to log
     */
    function receiveApproval(address from, uint256 value, address token, bytes memory extraData) public {
        ERC20 t = ERC20(token);
        require(t.transferFrom(from, address(this), value),"4");
        emit ReceivedTokens(from, value, token, extraData);
    }

    /**
     * @dev Receive Ether and generate a log event
     */
    receive() payable external {
        emit ReceivedEther(msg.sender, msg.value);
    }
}
/**
 * @title TokenRecipient
 * @author Project Erax Developers
 */
function receiveApproval(address from, uint256 value, address token, bytes memory extraData) public {
    ERC20 t = ERC20(token);
    require(t.transferFrom(from, address(this), value),"4");
    emit ReceivedTokens(from, value, token, extraData);
}

/**
 * @dev Receive tokens and generate a log event
 * @param from Address from which to transfer tokens
 * @param value Amount of tokens to transfer
 * @param token Address of token
 * @param extraData Additional data to log
 */