Coinvest Audit Bounty

Coinvest recently launched version 2.0 of their token, which is based on the ERC 865 standard.

865 allows an external third party to execute transactions on your behalf using digital signatures. You digitally sign a message such as please transfer 10 ABC to 0x... and submit it to an executor who then spends wei to execute the delegated transfer. In return for their efforts you pay a certain percentage of tokens, which is what makes this approach very interesting - you can have wallets that don't hold any ethereum.

How it works is pretty straightforward:

     * @dev Called by delegate with a signed hash of the transaction data to allow a user
     * @dev to transfer tokens without paying gas in Ether (they pay in COIN instead).
     * @param _signature Signed hash of data for this transfer.
     * @param _to The address to transfer COIN to.
     * @param _value The amount of COIN to transfer.
     * @param _gasPrice Price (IN COIN) that will be paid per unit of gas by user to "delegate".
     * @param _nonce Nonce of the user's new transaction.
    **/
    function transferPreSigned(
        bytes _signature,
        address _to, 
        uint256 _value, 
        uint256 _gasPrice, 
        uint256 _nonce) 
      public
      validPayload(292)
    returns (bool) 
    {
        // Log starting gas left of transaction for later gas price calculations.
        uint256 gas = gasleft();
        
        // Recover signer address from signature; ensure address is valid.
        address from = recoverPreSigned(_signature, transferSig, _to, _value, "", _gasPrice, _nonce);
        require(from != address(0));
        
        // Require the hash has not been used, declare it used, increment nonce.
        require(!invalidSignatures[from][_signature]);
        invalidSignatures[from][_signature] = true;
        nonces[from]++;
        
        // Internal transfer.
        require(_transfer(from, _to, _value));

        // If the delegate is charging, pay them for gas in COIN.
        if (_gasPrice > 0) {
            
            // 35000 because of base fee of 21000 and ~14000 for the fee transfer.
            gas = 35000 + gas.sub(gasleft());
            require(_transfer(from, msg.sender, _gasPrice.mul(gas)));
        }
        
        emit SignatureRedeemed(_signature, from);
        return true;
    }

Check out their bounty here:

https://medium.com/@CoinvestHQ/coinvest-coin-v2-token-audit-and-bug-bounty-b4626df60c4d

@admin

Here are the "bug bounty" rewards:

0_1525750777409_e75a57c3-2890-4727-90b3-dd8457c9af18-image.png

Pretty worthy payouts for anyone who can find an issue with the code. I imagine the code can't take too long to gloss over. Do any of you devs have experience in similar bounties?

Log in to reply

Enjoyed this post? Consider registering for more interesting content!