Kleros
Published in

Kleros

Creating the Smart Contract for the World’s First Interactive Coin Offering

By Enrique Piqueras and Clément Lesaege

The Challenge

The Solution

Initialization

Displaying Data

Submitting Bids

Withdrawing

Finalization

Redeeming

Extensions

Audits

VeriChains

Incorrect ordering of bids for the same personal cap.

require(_maxValuation >= prevBid.maxValuation && _maxValuation < nextBid.maxValuation); // The new bid maxValuation is higher than the previous one and strictly lower than the next one.

Possible integer overflow in bonus method

/** @dev Return the current bonus. The bonus only changes in 1/BONUS_DIVISOR increments.
* @return b The bonus expressed in 1/BONUS_DIVISOR. Will be normalized by BONUS_DIVISOR. For example for a 20% bonus, _maxBonus must be 0.2 * BONUS_DIVISOR.
*/
function bonus() public view returns(uint b) {
if (now < endFullBonusTime) // Full bonus.
return maxBonus;
else if (now > endTime) // Assume no bonus after end.
return 0;
else // Compute the bonus decreasing linearly from endFullBonusTime to endTime.
return (maxBonus * (endTime — now)) / (endTime — endFullBonusTime);
}

CoinMercenary

Bug Bounties

Learn More

--

--

The Justice Protocol. A Dispute Resolution Layer for the decentralized age

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store