Explicitly implement getter from interface

pragma solidity ^0.4.8;

import "./IFaucet.sol";
import "../lib/Owned.sol";
import "../lib/SafeMath.sol";

// Smart contract to keep accounts funded
// with enough eth to pay for transactions
contract Faucet is IFaucet, Owned, SafeMath {

  // TODO: Enforce daily limits

  uint256 pool_minimum = 10 ether;
  uint256 public minimum_balance = 10 finney;
  uint256 public target_balance = 100 finney;
  address manager;
  mapping (address => bool) accounts;
  mapping (address => uint) daily_usage;

  modifier accounts_only() {
    if(accounts[msg.sender]) {
      _;
    }
  }

  modifier manager_only() {
    if(msg.sender == manager) {
      _;
    }
  }

  function Faucet(
    address manager_
  ) payable {
    manager = manager_;
    assert(minimum_balance < target_balance);
    Pool_funded(this.balance, msg.value);
  }

  function minimum_balance() constant public returns (uint256) {
    return minimum_balance;
  }

  function set_manager(address new_manager) external owner_only {
    manager = new_manager;
  }

  function set_parameters(
    uint256 pool_minimum_,
    uint256 minimum_balance_,
    uint256 target_balance_
  ) external owner_only {
    pool_minimum = pool_minimum_;
    minimum_balance = minimum_balance_;
    target_balance = target_balance_;
  }

  function register(address account) external manager_only {
    accounts[account] = true;
    withdraw_for(account);
  }

  function unregister(address account) external manager_only {
    delete accounts[account];
  }

  function () external payable {
    Pool_funded(this.balance, msg.value);
  }

  // If account balance at address is below min_balance,
  // fill it up to target balance,
  // not exceeding the daily limit.
  function withdraw_for(address account) internal {
    assert(accounts[account]);
    if(account.balance < minimum_balance) {
      uint256 transfer = safeSub(target_balance, account.balance);
      uint256 new_balance = safeSub(this.balance, transfer);
      Withdrawal(account, transfer);
      if(new_balance < pool_minimum) {
        Pool_low(this.balance, pool_minimum);
      }

      // This call is safe because of 2300 send gas limit
      // Additionally, it is a tail call
      // TODO Solidity 0.4.10: account.transfer(transfer);
      if(!account.send(transfer)) {
        throw;
      }
    }
  }

  // Allow accounts to top themselves up
  function withdraw() accounts_only external {
    withdraw_for(msg.sender);
  }

  event Pool_funded(uint256 balance, uint256 amount);  // The pool is running low and needs to be refunded
  event Pool_low(uint256 balance, uint256 minimum);  // The pool is running low and needs to be refunded
}

pragma solidity ^0.4.8;

import "./IFaucet.sol";
import "../lib/Owned.sol";
import "../lib/SafeMath.sol";

// Smart contract to keep accounts funded
// with enough eth to pay for transactions
contract Faucet is IFaucet, Owned, SafeMath {

  // TODO: Enforce daily limits

  uint256 pool_minimum = 10 ether;
  uint256 public minimum_balance = 10 finney;
  uint256 public target_balance = 100 finney;
  address manager;
  mapping (address => bool) accounts;
  mapping (address => uint) daily_usage;

  modifier accounts_only() {
    if(accounts[msg.sender]) {
      _;
    }
  }

  modifier manager_only() {
    if(msg.sender == manager) {
      _;
    }
  }

  function Faucet(
    address manager_
  ) payable {
    manager = manager_;
    assert(minimum_balance < target_balance);
    Pool_funded(this.balance, msg.value);
  }

  function set_manager(address new_manager) external owner_only {
    manager = new_manager;
  }

  function set_parameters(
    uint256 pool_minimum_,
    uint256 minimum_balance_,
    uint256 target_balance_
  ) external owner_only {
    pool_minimum = pool_minimum_;
    minimum_balance = minimum_balance_;
    target_balance = target_balance_;
  }

  function register(address account) external manager_only {
    accounts[account] = true;
    withdraw_for(account);
  }

  function unregister(address account) external manager_only {
    delete accounts[account];
  }

  function () external payable {
    Pool_funded(this.balance, msg.value);
  }

  // If account balance at address is below min_balance,
  // fill it up to target balance,
  // not exceeding the daily limit.
  function withdraw_for(address account) internal {
    assert(accounts[account]);
    if(account.balance < minimum_balance) {
      uint256 transfer = safeSub(target_balance, account.balance);
      uint256 new_balance = safeSub(this.balance, transfer);
      Withdrawal(account, transfer);
      if(new_balance < pool_minimum) {
        Pool_low(this.balance, pool_minimum);
      }

      // This call is safe because of 2300 send gas limit
      // Additionally, it is a tail call
      // TODO Solidity 0.4.10: account.transfer(transfer);
      if(!account.send(transfer)) {
        throw;
      }
    }
  }

  // Allow accounts to top themselves up
  function withdraw() accounts_only external {
    withdraw_for(msg.sender);
  }

  event Pool_funded(uint256 balance, uint256 amount);  // The pool is running low and needs to be refunded
  event Pool_low(uint256 balance, uint256 minimum);  // The pool is running low and needs to be refunded
}


replace var by uint256 in StandardToken. Fix #432

pragma solidity ^0.4.11;

import './BasicToken.sol';
import './ERC20.sol';

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is ERC20, BasicToken {

  mapping (address => mapping (address => uint256)) allowed;

  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));

    uint256 _allowance = allowed[_from][msg.sender];

    // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
    // require (_value <= _allowance);

    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = _allowance.sub(_value);
    Transfer(_from, _to, _value);
    return true;
  }

  /**
   * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
  function approve(address _spender, uint256 _value) public returns (bool) {

    // To change the approve amount you first have to reduce the addresses`
    //  allowance to zero by calling `approve(_spender, 0)` if it is not
    //  already 0 to mitigate the race condition described here:
    //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
    // require((_value == 0) || (allowed[msg.sender][_spender] == 0));

    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
    return true;
  }

  /**
   * @dev Function to check the amount of tokens that an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint256 specifying the amount of tokens still available for the spender.
   */
  function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
    return allowed[_owner][_spender];
  }

  /**
   * approve should be called when allowed[_spender] == 0. To increment
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   */
  function increaseApproval (address _spender, uint _addedValue)
    returns (bool success) {
    allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

  function decreaseApproval (address _spender, uint _subtractedValue)
    returns (bool success) {
    uint oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue > oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

}

pragma solidity ^0.4.11;

import './BasicToken.sol';
import './ERC20.sol';

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is ERC20, BasicToken {

  mapping (address => mapping (address => uint256)) allowed;

  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));

    var _allowance = allowed[_from][msg.sender];

    // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
    // require (_value <= _allowance);

    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = _allowance.sub(_value);
    Transfer(_from, _to, _value);
    return true;
  }

  /**
   * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
  function approve(address _spender, uint256 _value) public returns (bool) {

    // To change the approve amount you first have to reduce the addresses`
    //  allowance to zero by calling `approve(_spender, 0)` if it is not
    //  already 0 to mitigate the race condition described here:
    //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
    // require((_value == 0) || (allowed[msg.sender][_spender] == 0));

    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
    return true;
  }

  /**
   * @dev Function to check the amount of tokens that an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint256 specifying the amount of tokens still available for the spender.
   */
  function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
    return allowed[_owner][_spender];
  }

  /**
   * approve should be called when allowed[_spender] == 0. To increment
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   */
  function increaseApproval (address _spender, uint _addedValue)
    returns (bool success) {
    allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

  function decreaseApproval (address _spender, uint _subtractedValue)
    returns (bool success) {
    uint oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue > oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

}


Added Contract for Capazitiy Utilization Token (ERC20 - https://github.com/ethereum/eips/issues/20 )

pragma solidity ^0.4.2;
contract owned {
    address public owner;

    function owned() {
        owner = msg.sender;
    }

    modifier onlyOwner {
        if (msg.sender != owner) throw;
        _;
    }

    function transferOwnership(address newOwner) onlyOwner {
        owner = newOwner;
    }
}

contract MPReading is owned {

	mapping(address=>reading) public readings;
	event Reading(address _meter_point,uint256 _power);

	struct reading {
		uint256 time;
		uint256 power;

	}

	function storeReading(uint256 _reading) {
			readings[tx.origin]=reading(now,_reading);
			Reading(tx.origin,_reading);
	}

}

contract MPTokenFactory {
	event Built(address _mpt,address _account);

	function build(MPReading _reading,address _meterpoint) returns(MPToken) {
		MPToken mptoken = new MPToken(_reading,_meterpoint);
		Built(address(mptoken),msg.sender);
		mptoken.transferOwnership(msg.sender);
		return mptoken;
	}

}
contract MPToken is owned {
	MPReading public  reading;
	address public meterpoint;
	uint256 public start_time;
	uint256 public start_power;
	token public power_token;
	token public time_token;
	event Issued(uint256 _time,uint256 _power);

	function MPToken(MPReading _reading,address _meterpoint) {
		meterpoint=_meterpoint;
		reading=_reading;
		(start_time,start_power)=reading.readings(meterpoint);
		power_token=new token(0,'Power',0,'Wh');
		time_token=new token(0,'Time',0,'s');
	}

	function issue() {
		uint256 time;
		uint256 power;
		(time,power)=reading.readings(meterpoint);

		if(time<start_time) throw;
		if(power<start_power) throw;

		power_token.issue(power-(power_token.totalSupply()+start_power));
		time_token.issue(time-(time_token.totalSupply()+start_time));

		Issued(time_token.balanceOf(this),power_token.balanceOf(this));
		power_token.transfer(msg.sender,power_token.balanceOf(this));
		time_token.transfer(msg.sender,time_token.balanceOf(this));
	}
}

contract MPDeltaFactory {
	event Built(address _mpd,address _account);

	function build(MPReading _reading,address _meterpoint) returns(MPDelta) {
		MPDelta mpdelta = new MPDelta(_reading,_meterpoint);
		Built(address(mpdelta),msg.sender);
		mpdelta.transferOwnership(msg.sender);
		return mpdelta;
	}

}

contract MPDelta is owned {
	uint256 public lastReadingTime;
	uint256 public lastReadingPower;

	address public meterpoint;
	MPReading public reading;
	uint256 public lastDeltaTime;
	uint256 public lastDeltaPower;

	function MPDelta(MPReading _reading,address _meterpoint) {
		meterpoint=_meterpoint;
		reading=_reading;
		(lastReadingTime,lastReadingPower)=reading.readings(meterpoint);
	}

	function delta() onlyOwner returns(uint256) {
		uint256 time;
		uint256 power;
		(time,power)=reading.readings(meterpoint);
		lastDeltaTime=time-lastReadingTime;
		lastDeltaPower=power-lastReadingPower;
		lastReadingTime=time;
		lastReadingPower=power;
		return lastDeltaPower;
	}
}

contract CUToken is owned {
    string public standard = 'Token 0.1';
    string public name='CapacityUtilization';
    string public symbol='*';
    uint8 public decimals=0;
    uint256 public totalSupply;
    MPReading public reading;
	MPDelta public source;
	MPDelta[] targets;
	uint256 cnt_targets=0;

    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    event Transfer(address indexed from, address indexed to, uint256 value);

    function CUToken(MPReading _reading,address _meterpoint) {
        balanceOf[msg.sender] = 0;              // Give the creator all initial tokens
        totalSupply = 0;                        // Update total supply
        reading=_reading;
		source=new MPDelta(reading,_meterpoint);
    }

	function addMeterpoint(address _meterpoint) onlyOwner {
		MPDelta target = new MPDelta(reading,_meterpoint);
		targets.push(target);
		cnt_targets++;
	}

	function issue() onlyOwner {
		uint256 sum_source=source.delta();
		for(uint256 i=0;i<cnt_targets;i++) {
				uint256 delta = targets[i].delta();
				totalSupply+=delta*sum_source;
				balanceOf[targets[i].meterpoint()]+=delta*sum_source;
				Transfer(msg.sender,targets[i],delta*sum_source);
		}
	}

    function transfer(address _to, uint256 _value) {
			// NOP ... we are a capacity utilization ... you can not transfer!
    }

    /* This unnamed function is called whenever someone tries to send ether to it */
    function () {
        throw;     // Prevents accidental sending of ether
    }
}

contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }

contract token is owned {
    /* Public variables of the token */
    string public standard = 'Token 0.1';
    string public name;
    string public symbol;
    uint8 public decimals;
    uint256 public totalSupply;

    /* This creates an array with all balances */
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    /* This generates a public event on the blockchain that will notify clients */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function token(
        uint256 initialSupply,
        string tokenName,
        uint8 decimalUnits,
        string tokenSymbol
        ) {
        balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens
        totalSupply = initialSupply;                        // Update total supply
        name = tokenName;                                   // Set the name for display purposes
        symbol = tokenSymbol;                               // Set the symbol for display purposes
        decimals = decimalUnits;                            // Amount of decimals for display purposes
    }

	function issue(uint256 _value) onlyOwner {
			totalSupply+=_value;
			balanceOf[msg.sender]+=_value;
	}
    /* Send coins */
    function transfer(address _to, uint256 _value) {
        if (balanceOf[msg.sender] < _value) throw;           // Check if the sender has enough
        if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
        balanceOf[msg.sender] -= _value;                     // Subtract from the sender
        balanceOf[_to] += _value;                            // Add the same to the recipient
        Transfer(msg.sender, _to, _value);                   // Notify anyone listening that this transfer took place
    }

    function () {
        throw;     // Prevents accidental sending of ether
    }
}

pragma solidity ^0.4.2;
contract owned {
    address public owner;

    function owned() {
        owner = msg.sender;
    }

    modifier onlyOwner {
        if (msg.sender != owner) throw;
        _;
    }

    function transferOwnership(address newOwner) onlyOwner {
        owner = newOwner;
    }
}

contract MPReading is owned {

	mapping(address=>reading) public readings;
	event Reading(address _meter_point,uint256 _power);

	struct reading {
		uint256 time;
		uint256 power;

	}

	function storeReading(uint256 _reading) {
			readings[tx.origin]=reading(now,_reading);
			Reading(tx.origin,_reading);
	}

}

contract MPTokenFactory {
	event Built(address _mpt,address _account);

	function build(MPReading _reading,address _meterpoint) returns(MPToken) {
		MPToken mptoken = new MPToken(_reading,_meterpoint);
		Built(address(mptoken),msg.sender);
		mptoken.transferOwnership(msg.sender);
		return mptoken;
	}

}
contract MPToken is owned {
	MPReading public  reading;
	address public meterpoint;
	uint256 public start_time;
	uint256 public start_power;
	token public power_token;
	token public time_token;
	event Issued(uint256 _time,uint256 _power);

	function MPToken(MPReading _reading,address _meterpoint) {
		meterpoint=_meterpoint;
		reading=_reading;
		(start_time,start_power)=reading.readings(meterpoint);
		power_token=new token(0,'Power',0,'Wh');
		time_token=new token(0,'Time',0,'s');
	}

	function issue() {
		uint256 time;
		uint256 power;
		(time,power)=reading.readings(meterpoint);

		if(time<start_time) throw;
		if(power<start_power) throw;

		power_token.issue(power-(power_token.totalSupply()+start_power));
		time_token.issue(time-(time_token.totalSupply()+start_time));

		Issued(time_token.balanceOf(this),power_token.balanceOf(this));
		power_token.transfer(msg.sender,power_token.balanceOf(this));
		time_token.transfer(msg.sender,time_token.balanceOf(this));
	}
}

contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }

contract token is owned {
    /* Public variables of the token */
    string public standard = 'Token 0.1';
    string public name;
    string public symbol;
    uint8 public decimals;
    uint256 public totalSupply;

    /* This creates an array with all balances */
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    /* This generates a public event on the blockchain that will notify clients */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function token(
        uint256 initialSupply,
        string tokenName,
        uint8 decimalUnits,
        string tokenSymbol
        ) {
        balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens
        totalSupply = initialSupply;                        // Update total supply
        name = tokenName;                                   // Set the name for display purposes
        symbol = tokenSymbol;                               // Set the symbol for display purposes
        decimals = decimalUnits;                            // Amount of decimals for display purposes
    }

	function issue(uint256 _value) onlyOwner {
			totalSupply+=_value;
			balanceOf[msg.sender]+=_value;
	}
    /* Send coins */
    function transfer(address _to, uint256 _value) {
        if (balanceOf[msg.sender] < _value) throw;           // Check if the sender has enough
        if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
        balanceOf[msg.sender] -= _value;                     // Subtract from the sender
        balanceOf[_to] += _value;                            // Add the same to the recipient
        Transfer(msg.sender, _to, _value);                   // Notify anyone listening that this transfer took place
    }

    /* Allow another contract to spend some tokens in your behalf */
    function approve(address _spender, uint256 _value)
        returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        return true;
    }

    /* Approve and then communicate the approved contract in a single tx */
    function approveAndCall(address _spender, uint256 _value, bytes _extraData)
        returns (bool success) {
        tokenRecipient spender = tokenRecipient(_spender);
        if (approve(_spender, _value)) {
            spender.receiveApproval(msg.sender, _value, this, _extraData);
            return true;
        }
    }

    /* A contract attempts to get the coins */
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        if (balanceOf[_from] < _value) throw;                 // Check if the sender has enough
        if (balanceOf[_to] + _value < balanceOf[_to]) throw;  // Check for overflows
        if (_value > allowance[_from][msg.sender]) throw;   // Check allowance
        balanceOf[_from] -= _value;                          // Subtract from the sender
        balanceOf[_to] += _value;                            // Add the same to the recipient
        allowance[_from][msg.sender] -= _value;
        Transfer(_from, _to, _value);
        return true;
    }

    /* This unnamed function is called whenever someone tries to send ether to it */
    function () {
        throw;     // Prevents accidental sending of ether
    }
}


Implemented new payout algorithm

Implemented new payout algorithm

pragma solidity ^0.4.0;

import "math.sol";
import "userRegistry.sol";
import "concept.sol";
import "user.sol";
import "conceptRegistry.sol";

contract Assessment
{
  address assessee; //The address of the user being assessed
  address[] assessors;
  address[] finalAssessors; //The assessors who actually give an assessment
  mapping (address => uint) assessorState;
  address[] assessorPool; //The addresses of the user's that the assessors are randomly selected from
  address concept;
  address userRegistry;
  address conceptRegistry;
  address math = 0x90B66E80448eb60938FAed4A738dE0D5b630B2Fd;
  uint public startTime;
  uint public size;
  uint cost;
  mapping(address => string[]) public data; //IFFS hashes of data that can be passed between the assessors and the assessee for the assessment to occur
  mapping(address => bytes32) commits;
  mapping(address => uint) stake;
  uint done = 0;
  mapping(address => int8) scores; //could save gas by making this an int8
  mapping(int => bool) inRewardCluster;
  int finalScore;
  event DataSet(address _dataSetter, uint _index);

  /*
  @type: modifier
  @name: onlyThis
  @purpose: to only allow the this contract to call a function to which this modifier is applied
  */
  modifier onlyThis()
  {
    if(msg.sender != address(this)) //Checks if msg.sender is this contract
    {
      throw; //Throws out the function call if it isn't
    }
    _;
  }

  /*
  @type: modifier
  @name: onlyAssessorAssessee
  @purpose: to only allow the assessors and assessee to call a function to which this modifier is applied
  */
  modifier onlyAssessorAssessee()
  {
    if(msg.sender != assessee && assessorState[msg.sender] == 0) //Checks if msg.sender has the same address as either the assessee or an assessor
    {
      throw; //Throws the function call if not
    }
    _;
  }

  /*
  @type: modifier
  @name: onlyConceptAssessment
  @purpose: to only allow the this contract or the Concept contract that spawned it to call a function to which this modifier is applied
  */
  modifier onlyConceptAssessment()
  {
    if(msg.sender != address(this) && msg.sender != concept) //Checks if msg.sender has the same address as this contract or the Concept that spawned it
    {
      throw; //Throws the function call if not
    }
    _;
  }

  modifier onlyConcept()
  {
    if(msg.sender != concept)
    {
      throw;
    }
    _;
  }

  function Assessment(address _assessee, address _userRegistry, address _conceptRegistry, uint _size, uint _cost)
  {
    assessee = _assessee;
    concept = msg.sender;
    userRegistry = _userRegistry;
    conceptRegistry = _conceptRegistry;
    startTime = block.timestamp;
    size = _size;
    cost = _cost;
    User(assessee).notification(concept, 0); //Assessment made
  }

  function cancelAssessment() onlyConceptAssessment()
  {
    Concept(concept).setBalance(assessee, UserRegistry(userRegistry).getBalance(assessee) + cost*size);
    User(assessee).notification(concept, 3); //Assessment Cancled and you have been refunded
    for(uint i = 0; i < assessors.length; i++)
    {
      Concept(concept).setBalance(assessors[i], UserRegistry(userRegistry).getBalance(assessors[i]) + cost);
      User(assessors[i]).notification(concept, 3); //Assessment Cancled and you have been refunded
    }
    suicide(conceptRegistry);
  }

  function addAssessorToPool(address assessor) onlyConcept()
  {
    if(assessorState[assessor] == 0)
    {
      User(assessor).notification(concept, 1); //Called As A Potential Assessor
      assessorState[assessor] = 1;
    }
  }

  /*
  @type: function
  @purpose: To recursively set the pool to draw assessors from in the assessment
  @param: uint seed = the seed number for random number generation
  @returns: nothing
  */
  function setAssessorPool(uint seed) onlyConceptAssessment()
  {
    if(Concept(ConceptRegistry(conceptRegistry).mewAddress()).getOwnerLength() < size*20) //Checks if the requested pool size is greater than the number of users in the system
    {
      for(uint i = 0; i < Concept(ConceptRegistry(conceptRegistry).mewAddress()).getOwnerLength(); i++) //If so, all users in the system are added to the pool
      {
        assessorPool.push(Concept(ConceptRegistry(conceptRegistry).mewAddress()).owners(i));
        User(Concept(ConceptRegistry(conceptRegistry).mewAddress()).owners(i)).notification(concept, 1); //Called As A Potential Assessor
        assessorState[Concept(ConceptRegistry(conceptRegistry).mewAddress()).owners(i)] = 1;
      }
    }
    else
    {
    Concept(concept).getAssessors(size*20, seed, address(this));
  }
  }

  function confirmAssessor()
  {
    if(block.number - startTime <= 15 && assessorState[msg.sender] == 1 && assessors.length < size && UserRegistry(userRegistry).getBalance(msg.sender) >= cost)
    {
      assessors.push(msg.sender);
      assessorState[msg.sender] = 2;
      stake[msg.sender] = cost;
      Concept(concept).setBalance(msg.sender,UserRegistry(userRegistry).getBalance(msg.sender) - cost);
      User(msg.sender).notification(concept, 2); //Confirmed for assessing, stake has been taken
    }
    if(assessors.length == size)
    {
      notifyStart();
    }
    else if(block.number - startTime > 15 && assessors.length < size)
    {
      cancelAssessment();
    }
  }

  function notifyStart() onlyThis()
  {
    for(uint i = 0; i < assessors.length; i++)
    {
      User(assessors[i]).notification(concept, 4); //Assessment Has Started
    }
    User(assessee).notification(concept, 4); //Assessment Has Started
  }

  function setData(string _data) onlyAssessorAssessee()
  {
    data[msg.sender].push(_data);
    DataSet(msg.sender, data[msg.sender].length - 1);
  }

  function commit(bytes32 hash)
  {
    if(done > size/2)
    {
      for(uint i = 0; i < assessors.length; i++)
      {
        if(assessorState[assessors[i]] == 2)
        {
          uint r = 38; //Inverse burn rate
          stake[assessors[i]] = cost*2**(-(now-startTime)/r) - 1;
        }
        if(stake[assessors[i]] == 0)
        {
          assessorState[assessors[i]] = 4;
          done++;
        }
      }
    }
    if(done == size)
    {
      for(uint j = 0; j < assessors.length; j++)
      {
        if(assessorState[assessors[j]] == 3)
        {
          User(assessors[j]).notification(concept, 5); //Send in Score
        }
      }
      startTime = block.number;
      done = 0;
    }
    if(assessorState[msg.sender] == 2)
    {
      commits[msg.sender] = hash;
      assessorState[msg.sender] == 3;
      done++;
      if(done <= size/2)
      {
        startTime = block.number;
      }
    }
  }

  function reveal(int8 score, bytes16 salt, address assessor)
  {
    if(block.number - startTime <= 10)
    {
      bytes32 hash = sha3(score,salt);
      if(commits[assessor] == hash)
      {
        if(msg.sender == assessor)
        {
          scores[msg.sender] = score;
          assessorState[assessor] = 5;
          done++;
        }
        else
        {
          Concept(concept).setBalance(msg.sender,UserRegistry(userRegistry).getBalance(msg.sender) + stake[assessor]);
          stake[assessor] = 0;
          assessorState[assessor] = 4;
        }
      }
      else if(msg.sender == assessor)
      {
        stake[assessor] = 0;
        assessorState[assessor] = 4;
        done++;
      }
    }
    else
    {
      for(uint i = 0; i < assessors.length; i++)
      {
        if(assessorState[assessors[i]] == 3)
        {
          stake[assessors[i]] = 0;
          assessorState[assessors[i]] = 4;
          done++;
        }
      }
    }
    if(done == size)
    {
      calculateResult();
    }
  }

  function calculateResult() onlyThis()
  {
    mapping(uint => int[]) clusters;
    for(uint j = 0; j < size; j++)
    {
      if(assessorState[assessors[i]] == 5)
      {
        finalAssessors.push(assessors[i]);
      }
    }
    int[] memory score = new int[] (finalAssessors.length);
    uint largestClusterIndex = 0;
    int averageScore;
    for(uint i = 0; i < finalAssessors.length; i++)
    {
      score[i] = scores[finalAssessors[i]];
    }
    int meanAbsoluteDeviation = Math(math).calculateMAD(score,int(finalAssessors.length));
    for(uint l = 0; l < score.length; l++)
    {
      for(uint m = 0; m < score.length; m++)
      {
        if(score[l] - score[m] <= meanAbsoluteDeviation)
        {
          clusters[l].push(score[m]);
        }
      }
      if(clusters[l].length > clusters[largestClusterIndex].length)
      {
        largestClusterIndex = l;
      }
    }
    for(uint o = 0; o < clusters[largestClusterIndex].length; o++)
    {
      averageScore += clusters[largestClusterIndex][o];
      inRewardCluster[clusters[largestClusterIndex][o]] = true;
    }
    averageScore /= int(clusters[largestClusterIndex].length);
    finalScore = averageScore;
    payout(clusters[largestClusterIndex].length);
  }

  function payout(uint largestSize) onlyThis()
  {
    for(uint i = 0; i < size; i++)
    {
      int score = scores[assessors[i]];
      int scoreDistance = ((score - finalScore)*100)/finalScore;
      if(scoreDistance < 0)
      {
        scoreDistance *= -1;
      }
      uint payoutValue; //Figure out new payout algorithm
      if(inRewardCluster[score] == true)
      {
        uint q = 1; //Inflation rate factor, WE NEED TO FIGURE THIS OUT AT SOME POINT
        payoutValue = q*cost*((100 - uint(scoreDistance))/100);
        Concept(concept).setBalance(assessors[i], UserRegistry(userRegistry).getBalance(assessors[i]) + payoutValue);
        User(assessors[i]).notification(concept, 15); //You Have Received Payment For Your Assessment
      }
      if(inRewardCluster[score] == false)
      {
        payoutValue = stake[assessors[i]]*((200 - uint(scoreDistance))/200);
        Concept(concept).setBalance(assessors[i], UserRegistry(userRegistry).getBalance(assessors[i]) + payoutValue);
        User(assessors[i]).notification(concept, 16); //You Have Received A Fine For Your Assessment
      }
    }
    Concept(concept).finishAssessment(finalScore, assessee, address(this));();
  }

}

pragma solidity ^0.4.0;

import "math.sol";
import "userRegistry.sol";
import "concept.sol";
import "user.sol";
import "conceptRegistry.sol";

contract Assessment
{
  address assessee; //The address of the user being assessed
  address[] assessors;
  address[] finalAssessors; //The assessors who actually give an assessment
  mapping (address => uint) assessorState;
  address[] assessorPool; //The addresses of the user's that the assessors are randomly selected from
  address concept;
  address userRegistry;
  address conceptRegistry;
  address math = 0x90B66E80448eb60938FAed4A738dE0D5b630B2Fd;
  uint public startTime;
  uint public size;
  uint cost;
  mapping(address => string[]) public data; //IFFS hashes of data that can be passed between the assessors and the assessee for the assessment to occur
  mapping(address => bytes32) commits;
  mapping(address => uint) stake;
  uint done = 0;
  mapping(address => int8) scores; //could save gas by making this an int8
  mapping(int => bool) inRewardCluster;
  int finalScore;
  event DataSet(address _dataSetter, uint _index);

  /*
  @type: modifier
  @name: onlyThis
  @purpose: to only allow the this contract to call a function to which this modifier is applied
  */
  modifier onlyThis()
  {
    if(msg.sender != address(this)) //Checks if msg.sender is this contract
    {
      throw; //Throws out the function call if it isn't
    }
    _;
  }

  /*
  @type: modifier
  @name: onlyAssessorAssessee
  @purpose: to only allow the assessors and assessee to call a function to which this modifier is applied
  */
  modifier onlyAssessorAssessee()
  {
    if(msg.sender != assessee && assessorState[msg.sender] == 0) //Checks if msg.sender has the same address as either the assessee or an assessor
    {
      throw; //Throws the function call if not
    }
    _;
  }

  /*
  @type: modifier
  @name: onlyConceptAssessment
  @purpose: to only allow the this contract or the Concept contract that spawned it to call a function to which this modifier is applied
  */
  modifier onlyConceptAssessment()
  {
    if(msg.sender != address(this) && msg.sender != concept) //Checks if msg.sender has the same address as this contract or the Concept that spawned it
    {
      throw; //Throws the function call if not
    }
    _;
  }

  modifier onlyConcept()
  {
    if(msg.sender != concept)
    {
      throw;
    }
    _;
  }

  function Assessment(address _assessee, address _userRegistry, address _conceptRegistry, uint _size, uint _cost)
  {
    assessee = _assessee;
    concept = msg.sender;
    userRegistry = _userRegistry;
    conceptRegistry = _conceptRegistry;
    startTime = block.timestamp;
    size = _size;
    cost = _cost;
    User(assessee).notification(concept, 0); //Assessment made
  }

  function cancelAssessment() onlyConceptAssessment()
  {
    Concept(concept).setBalance(assessee, UserRegistry(userRegistry).getBalance(assessee) + cost*size);
    User(assessee).notification(concept, 3); //Assessment Cancled and you have been refunded
    for(uint i = 0; i < assessors.length; i++)
    {
      Concept(concept).setBalance(assessors[i], UserRegistry(userRegistry).getBalance(assessors[i]) + cost);
      User(assessors[i]).notification(concept, 3); //Assessment Cancled and you have been refunded
    }
    suicide(conceptRegistry);
  }

  function addAssessorToPool(address assessor) onlyConcept()
  {
    if(assessorState[assessor] == 0)
    {
      User(assessor).notification(concept, 1); //Called As A Potential Assessor
      assessorState[assessor] = 1;
    }
  }

  /*
  @type: function
  @purpose: To recursively set the pool to draw assessors from in the assessment
  @param: uint seed = the seed number for random number generation
  @returns: nothing
  */
  function setAssessorPool(uint seed) onlyConceptAssessment()
  {
    if(Concept(ConceptRegistry(conceptRegistry).mewAddress()).getOwnerLength() < size*20) //Checks if the requested pool size is greater than the number of users in the system
    {
      for(uint i = 0; i < Concept(ConceptRegistry(conceptRegistry).mewAddress()).getOwnerLength(); i++) //If so, all users in the system are added to the pool
      {
        assessorPool.push(Concept(ConceptRegistry(conceptRegistry).mewAddress()).owners(i));
        User(Concept(ConceptRegistry(conceptRegistry).mewAddress()).owners(i)).notification(concept, 1); //Called As A Potential Assessor
        assessorState[Concept(ConceptRegistry(conceptRegistry).mewAddress()).owners(i)] = 1;
      }
    }
    else
    {
    Concept(concept).getAssessors(size*20, seed, address(this));
  }
  }

  function confirmAssessor()
  {
    if(block.number - startTime <= 15 && assessorState[msg.sender] == 1 && assessors.length < size && UserRegistry(userRegistry).getBalance(msg.sender) >= cost)
    {
      assessors.push(msg.sender);
      assessorState[msg.sender] = 2;
      stake[msg.sender] = cost;
      Concept(concept).setBalance(msg.sender,UserRegistry(userRegistry).getBalance(msg.sender) - cost);
      User(msg.sender).notification(concept, 2); //Confirmed for assessing, stake has been taken
    }
    if(assessors.length == size)
    {
      notifyStart();
    }
    else if(block.number - startTime > 15 && assessors.length < size)
    {
      cancelAssessment();
    }
  }

  function notifyStart() onlyThis()
  {
    for(uint i = 0; i < assessors.length; i++)
    {
      User(assessors[i]).notification(concept, 4); //Assessment Has Started
    }
    User(assessee).notification(concept, 4); //Assessment Has Started
  }

  function setData(string _data) onlyAssessorAssessee()
  {
    data[msg.sender].push(_data);
    DataSet(msg.sender, data[msg.sender].length - 1);
  }

  function commit(bytes32 hash)
  {
    if(done > size/2)
    {
      for(uint i = 0; i < assessors.length; i++)
      {
        if(assessorState[assessors[i]] == 2)
        {
          r = 38; //Inverse burn rate
          stake[assessors[i]] = cost*2**(-(now-startTime)/r) - 1;
        }
        if(stake[assessors[i]] == 0)
        {
          assessorState[assessors[i]] = 4;
          done++;
        }
      }
    }
    if(done == size)
    {
      for(uint j = 0; j < assessors.length; j++)
      {
        if(assessorState[assessors[j]] == 3)
        {
          User(assessors[j]).notification(concept, 5); //Send in Score
        }
      }
      startTime = block.number;
      done = 0;
    }
    if(assessorState[msg.sender] == 2)
    {
      commits[msg.sender] = hash;
      assessorState[msg.sender] == 3;
      done++;
      if(done <= size/2)
      {
        startTime = block.number;
      }
    }
  }

  function reveal(int8 score, bytes16 salt, address assessor)
  {
    if(block.number - startTime <= 10)
    {
      bytes32 hash = sha3(score,salt);
      if(commits[assessor] == hash)
      {
        if(msg.sender == assessor)
        {
          scores[msg.sender] = score;
          assessorState[assessor] = 5;
          done++;
        }
        else
        {
          Concept(concept).setBalance(msg.sender,UserRegistry(userRegistry).getBalance(msg.sender) + stake[assessor]);
          stake[assessor] = 0;
          assessorState[assessor] = 4;
        }
      }
      else if(msg.sender == assessor)
      {
        stake[assessor] = 0;
        assessorState[assessor] = 4;
        done++;
      }
    }
    else
    {
      for(uint i = 0; i < assessors.length; i++)
      {
        if(assessorState[assessors[i]] == 3)
        {
          stake[assessors[i]] = 0;
          assessorState[assessors[i]] = 4;
          done++;
        }
      }
    }
    if(done == size)
    {
      calculateResult();
    }
  }

  function calculateResult() onlyThis()
  {
    mapping(uint => int[]) clusters;
    for(uint j = 0; j < size; j++)
    {
      if(assessorState[assessors[i]] == 5)
      {
        finalAssessors.push(assessors[i]);
      }
    }
    int[] memory score = new int[] (finalAssessors.length);
    uint largestClusterIndex = 0;
    int averageScore;
    for(uint i = 0; i < finalAssessors.length; i++)
    {
      score[i] = scores[finalAssessors[i]];
    }
    int meanAbsoluteDeviation = Math(math).calculateMAD(score,int(finalAssessors.length));
    for(uint l = 0; l < score.length; l++)
    {
      for(uint m = 0; m < score.length; m++)
      {
        if(score[l] - score[m] <= meanAbsoluteDeviation)
        {
          clusters[l].push(score[m]);
        }
      }
      if(clusters[l].length > clusters[largestClusterIndex].length)
      {
        largestClusterIndex = l;
      }
    }
    for(uint o = 0; o < clusters[largestClusterIndex].length; o++)
    {
      averageScore += clusters[largestClusterIndex][o];
      inRewardCluster[clusters[largestClusterIndex][o]] = true;
    }
    averageScore /= int(clusters[largestClusterIndex].length);
    finalScore = averageScore;
    payout(clusters[largestClusterIndex].length);
  }

  function payout(uint largestSize) onlyThis()
  {
    for(uint i = 0; i < size; i++)
    {
      int score = scores[assessors[i]];
      int scoreDistance = ((score - finalScore)*100)/finalScore;
      if(scoreDistance < 0)
      {
        scoreDistance *= -1;
      }
      uint payoutValue = 1; //Figure out new payout algorithm
      if(inRewardCluster[score] == true)
      {
        Concept(concept).setBalance(assessors[i], UserRegistry(userRegistry).getBalance(assessors[i]) + payoutValue);
        User(assessors[i]).notification(concept, 15); //You Have Received Payment For Your Assessment
      }
      if(inRewardCluster[score] == false)
      {
        Concept(concept).setBalance(assessors[i], UserRegistry(userRegistry).getBalance(assessors[i]) - payoutValue);
        User(assessors[i]).notification(concept, 16); //You Have Received A Fine For Your Assessment
      }
    }
    Concept(concept).finishAssessment(finalScore, assessee, address(this));();
  }

}


Added code comments Formatted code for readibility

    pragma solidity ^0.4.8;

    //Small utility that batch checks to determine if an address is an external account or a contract address
    //This utility is useful for SuperDAO'S prommissory contract batch address input.
    //Only regular accounts can recieve ether and can be passed into the withdrawal process
    //Only menbers of the internal team initial leadership can pass in batches to avoid spam

    /**
    * @title Address Checker Contract
    * @author ola
    * --- Collaborators ---
    * @author anthony
    */
    contract AddressChecker {

    event ContractAddressesDetected(uint _batchId, uint _badAddresses, bool badBatch);

    address[]Team; //List containing Core team membbers addresses
    uint[] batchNumber; //List of all different batch numbers checked
    uint number = 0; //Number of batches checked

    mapping(uint => address[]) public Batches;

    /**
    * @notice Deploy Address Checker contract setting Core team membbers addresses
    * @dev This is the constructor of the Address Checker contract
    */
    function AddressChecker(){
        Team.push(0x5B44efC8E385371F524E508475eBE741A3858FdC);
        Team.push(0xBe715F6BfbEF7E45583ec6c87d4664d04b5C88Fd);
        Team.push(0x28013bf56eafd00664afc2d9ba649930976227b2);
        Team.push(0xc205B5B867EC8b769836c5D356A058881e3ce056);
        Team.push(0x653851cf3B10E017B25d6bC78bEceEA6d2D3100c);
        Team.push(0x6fC7Ff5baB36b1784047419847edC3Cc9C788b81);
    }

    /**
    * @notice Checking batch of addresses
    * @dev submit a batch of addresses to check if they are contracts or external addresses, triggering an event with the results
    * @param _AddressesToBeChecked (address[])Array of addresses to be checked
    * @return _batchNum (uint)Batch Number for the provided addresses
    * @return _goodOrBadBatch (bool)True if any of batch addresses is a contract address else false
    * @return _numberOfBad Batch (uint)Number fof bad(Contract) addresses in the batch
    */
    function checkAddressBatch(address[] _AddressesToBeChecked)
    external
    NotTeam
    returns (uint _batchNum, bool _goodOrBadBatch, uint _numberOfBad){

        uint badAddresses = 0;
        Batches[batchNumber[number]] = _AddressesToBeChecked;
        for (uint i = 0; i < _AddressesToBeChecked.length; i++) {
            if (getSize(_AddressesToBeChecked[i]) > 0){
                badAddresses += 1;
            }
        }

        if(badAddresses > 0){
            ContractAddressesDetected(number, badAddresses, true);
            number += 1;
            return (number,false, badAddresses);
        }

        ContractAddressesDetected(number, badAddresses, false);
        number += 1;
        return (number,true, badAddresses);
    }

    /**
    * @notice Fetching records of batch number: `_batchNumber`
    * @dev Fetch some historical processed batch using the batch number
    * @param _batchNumber (uint)Index of Batch to be retrieved
    * @return (address[])List of Addresses in the retrieved batch
    */
    function specificBatchCheck(uint _batchNumber) external constant returns(address[]) {
        return Batches[batchNumber[_batchNumber]];
    }

    /**
    * @notice Checking Address type of `_addr` by fetching code size
    * @dev Main function of the AddressChecker contract. Retrieve address code size
    * @param _addr (address) Address to retrieve code from
    * @return size (uint) Size of address's code
    */
    function getSize(address _addr) internal returns (uint size) {
        assembly {
            // retrieve the size of the code, this needs assembly
            size := extcodesize(_addr)
            mstore(mload(0x40), size)
        }
    }

    /*
    * Safeguard function.
    * This function gets executed if a transaction with invalid data is sent to
    * the contract or just ether without data.
    */
    function () {
        throw;
    }

    modifier NotTeam{
        // Team[msg.sender]
        _;
    }

    }

pragma solidity ^0.4.8;

//Small utility that batch checks to determine if an address is an external account or a contract address
//This utility is useful for SuperDAO'S prommissory contract batch address input.
//Only regular accounts can recieve ether and can be passed into the withdrawal process
//Only menbers of the internal team initial leadership can pass in batches to avoid spam
//
//
//
//

contract AddressChecker {

event ContractAddressesDetected(uint _batchId, uint _badAddresses, bool badBatch);

address[]Team;
uint[] batchNumber;
uint number = 0;

mapping(uint => address[]) public Batches;

        function AddressChecker(){
            Team.push(0x5B44efC8E385371F524E508475eBE741A3858FdC);
            Team.push(0xBe715F6BfbEF7E45583ec6c87d4664d04b5C88Fd);
            Team.push(0x28013bf56eafd00664afc2d9ba649930976227b2);
            Team.push(0xc205B5B867EC8b769836c5D356A058881e3ce056);
            Team.push(0x653851cf3B10E017B25d6bC78bEceEA6d2D3100c);
            Team.push(0x6fC7Ff5baB36b1784047419847edC3Cc9C788b81);
        }

        //submit a batch of addresses to check if they are contracts or external addresses
        function checkAddressBatch(address[] _AddressesToBeChecked)
        external
        NotTeam
        returns (uint _batchNum, bool _goodOrBadBatch, uint _numberOfBad){

            uint badAddresses = 0;
            Batches[batchNumber[number]] = _AddressesToBeChecked;
                for (uint i = 0; i < _AddressesToBeChecked.length; i++) {

                    if (getSize(_AddressesToBeChecked[i]) > 0){
                        badAddresses += 1;
                    }
                }

                if(badAddresses > 0){
                     ContractAddressesDetected(number, badAddresses, true);
                     number += 1;
                     return (number,false, badAddresses);
                 }

                 ContractAddressesDetected(number, badAddresses, false);
                 number += 1;
                 return (number,true, badAddresses);
        }

        //check some historical processed batch
        function specificBatchCheck(uint _batchNumber) external constant returns(address[]) {

            return Batches[batchNumber[_batchNumber]];

        }

        //retrieve address code size
        function getSize(address _addr) internal returns (uint size) {
                assembly {
                    // retrieve the size of the code, this needs assembly
                     size := extcodesize(_addr)
                     mstore(mload(0x40), size)

                }
            }

    //return accidental ether
      function () {
            throw;
        }

    modifier NotTeam{

          // Team[msg.sender]
        _;
        }

}


Changing sha256 to sha3 for key generation

contract EscrowCreator {
    struct Entity {
        address addr;
        bool accepted;
    }

    struct EscrowInfo {
        Entity buyer;
        Entity seller;
        uint amount;
    }

    mapping (bytes32 => EscrowInfo) contracts;

    function EscrowCreator() {
    }

    function initiateCreation(address buyerAddress, address sellerAddress, uint amount) returns (bytes32 token) {
        token = sha3(buyerAddress, sellerAddress, amount);
        Entity memory buyer = Entity(buyerAddress, false);
        Entity memory seller = Entity(sellerAddress, true);
        contracts[token] = EscrowInfo(buyer, seller, amount);
        return token;
    }

    function getEscrowInfo(bytes32 token) returns (
        address buyerAddr,
        bool buyerAccepted,
        address sellerAddr,
        bool sellerAccepted,
        uint amount
    ) {
        buyerAddr = contracts[token].buyer.addr;
        buyerAccepted = contracts[token].buyer.accepted;
        sellerAddr = contracts[token].seller.addr;
        sellerAccepted = contracts[token].seller.accepted;
        amount = contracts[token].amount;
    }
}

contract EscrowCreator {
    struct Entity {
        address addr;
        bool accepted;
    }

    struct EscrowInfo {
        Entity buyer;
        Entity seller;
        uint amount;
    }

    mapping (bytes32 => EscrowInfo) contracts;

    function EscrowCreator() {
    }

    function initiateCreation(address buyerAddress, address sellerAddress, uint amount) returns (bytes32 token) {
        token = sha256(buyerAddress, sellerAddress, amount);
        Entity memory buyer = Entity(buyerAddress, false);
        Entity memory seller = Entity(sellerAddress, true);
        contracts[token] = EscrowInfo(buyer, seller, amount);
        return token;
    }

    function getEscrowInfo(bytes32 token) returns (
        address buyerAddr,
        bool buyerAccepted,
        address sellerAddr,
        bool sellerAccepted,
        uint amount
    ) {
        buyerAddr = contracts[token].buyer.addr;
        buyerAccepted = contracts[token].buyer.accepted;
        sellerAddr = contracts[token].seller.addr;
        sellerAccepted = contracts[token].seller.accepted;
        amount = contracts[token].amount;
    }
}


multiowned: grouping confirmation-related functions together

// Code taken from https://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol
// Audit and improvements by github.com/Eenae

// @authors:
// Gav Wood <g@ethdev.com>
// inheritable "property" contract that enables methods to be protected by requiring the acquiescence of either a
// single, or, crucially, each of a number of, designated owners.
// usage:
// use modifiers onlyowner (just own owned) or onlymanyowners(hash), whereby the same hash must be provided by
// some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the
// interior is executed.

pragma solidity ^0.4.10;

contract multiowned {

	// TYPES

    // struct for the status of a pending operation.
    struct PendingState {
        // count of confirmations needed
        uint yetNeeded;

        // bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
        uint ownersDone;

        // position of this operation key in m_pendingIndex
        uint index;
    }

	// EVENTS

    // this contract only has six types of events: it can accept a confirmation, in which case
    // we record owner and operation (hash) alongside it.
    event Confirmation(address owner, bytes32 operation);
    event Revoke(address owner, bytes32 operation);
    // some others are in the case of an owner changing.
    event OwnerChanged(address oldOwner, address newOwner);
    event OwnerAdded(address newOwner);
    event OwnerRemoved(address oldOwner);
    // the last one is emitted if the required signatures change
    event RequirementChanged(uint newRequirement);

	// MODIFIERS

    // simple single-sig function modifier.
    modifier onlyowner {
        require(isOwner(msg.sender));
        _;
    }
    // multi-sig function modifier: the operation must have an intrinsic hash in order
    // that later attempts can be realised as the same underlying operation and
    // thus count as confirmations.
    modifier onlymanyowners(bytes32 _operation) {
        if (confirmAndCheck(_operation)) {
            _;
        }
        // Even if required number of confirmations has't been collected yet,
        // we can't throw here - because changes to the state have to be preserved.
        // But, confirmAndCheck itself will throw in case sender is not an owner.
    }

	// METHODS

    // constructor is given number of sigs required to do protected "onlymanyowners" transactions
    // as well as the selection of extra addresses capable of confirming them (msg.sender also added to owners).
    function multiowned(address[] _extraOwners, uint _required) {
        m_numOwners = _extraOwners.length + 1;
        require(m_numOwners <= c_maxOwners);
        require(_required > 0 && _required <= m_numOwners);

        m_owners[1] = uint(msg.sender);
        m_ownerIndex[uint(msg.sender)] = 1;
        for (uint i = 0; i < _extraOwners.length; ++i)
        {
            m_owners[2 + i] = uint(_extraOwners[i]);
            m_ownerIndex[uint(_extraOwners[i])] = 2 + i;
        }
        m_required = _required;

        assertOwnersAreConsistent();
    }

    // Replaces an owner `_from` with another `_to`.
    // All pending operations will be canceled!
    function changeOwner(address _from, address _to) onlymanyowners(sha3(msg.data)) external {
        require(isOwner(_from) && !isOwner(_to));   // this usage error should be noticed by the caller

        assertOwnersAreConsistent();

        clearPending();
        uint ownerIndex = m_ownerIndex[uint(_from)];
        m_owners[ownerIndex] = uint(_to);
        m_ownerIndex[uint(_from)] = 0;
        m_ownerIndex[uint(_to)] = ownerIndex;

        assertOwnersAreConsistent();
        OwnerChanged(_from, _to);
    }

    // All pending operations will be canceled!
    function addOwner(address _owner) onlymanyowners(sha3(msg.data)) external {
        require(! isOwner(_owner));     // this usage error should be noticed by the caller
        require(m_numOwners < c_maxOwners);

        assertOwnersAreConsistent();

        clearPending();
        m_numOwners++;
        m_owners[m_numOwners] = uint(_owner);
        m_ownerIndex[uint(_owner)] = m_numOwners;

        assertOwnersAreConsistent();
        OwnerAdded(_owner);
    }

    // All pending operations will be canceled!
    function removeOwner(address _owner) onlymanyowners(sha3(msg.data)) external {
        require(isOwner(_owner));   // this usage error should be noticed by the caller
        require(m_numOwners > 1);   // wont remove the last owner
        require(m_required <= m_numOwners - 1);

        assertOwnersAreConsistent();

        clearPending();
        uint ownerIndex = m_ownerIndex[uint(_owner)];
        m_owners[ownerIndex] = 0;
        m_ownerIndex[uint(_owner)] = 0;
        //make sure m_numOwners is equal to the number of owners and always points to the last owner
        reorganizeOwners();

        assertOwnersAreConsistent();
        OwnerRemoved(_owner);
    }

    // All pending operations will be canceled!
    function changeRequirement(uint _newRequired) onlymanyowners(sha3(msg.data)) external {
        require(_newRequired > 0 && _newRequired <= m_numOwners);
        m_required = _newRequired;
        clearPending();
        RequirementChanged(_newRequired);
    }

    // Gets an owner by 0-indexed position
    function getOwner(uint ownerIndex) external constant returns (address) {
        return address(m_owners[ownerIndex + 1]);
    }

    function isOwner(address _addr) constant returns (bool) {
        return m_ownerIndex[uint(_addr)] > 0;
    }

    // Tests ownership of the current caller.
    // It's advisable to call it by new owner to make sure that the same erroneous address is not copy-pasted to
    // addOwner/changeOwner and to isOwner.
    function amIOwner() constant onlyowner returns (bool) {
        return true;
    }

    // Revokes a prior confirmation of the given operation
    function revoke(bytes32 _operation) external {
        uint ownerIndex = m_ownerIndex[uint(msg.sender)];
        // make sure they're an owner
        if (ownerIndex == 0) return;
        uint ownerIndexBit = 2**ownerIndex;
        var pending = m_pending[_operation];
        if (pending.ownersDone & ownerIndexBit > 0) {
            pending.yetNeeded++;
            pending.ownersDone -= ownerIndexBit;
            Revoke(msg.sender, _operation);
        }
    }

    function hasConfirmed(bytes32 _operation, address _owner) constant returns (bool) {
        var pending = m_pending[_operation];
        uint ownerIndex = m_ownerIndex[uint(_owner)];

        // make sure they're an owner
        if (ownerIndex == 0) return false;

        // determine the bit to set for this owner.
        uint ownerIndexBit = 2**ownerIndex;
        return !(pending.ownersDone & ownerIndexBit == 0);
    }

    // INTERNAL METHODS

    function confirmAndCheck(bytes32 _operation) internal returns (bool) {
        // determine what index the present sender is:
        uint ownerIndex = m_ownerIndex[uint(msg.sender)];
        // make sure they're an owner
        require(ownerIndex != 0);

        var pending = m_pending[_operation];
        // if we're not yet working on this operation, switch over and reset the confirmation status.
        if (pending.yetNeeded == 0) {
            // reset count of confirmations needed.
            pending.yetNeeded = m_required;
            // reset which owners have confirmed (none) - set our bitmap to 0.
            pending.ownersDone = 0;
            pending.index = m_pendingIndex.length++;
            m_pendingIndex[pending.index] = _operation;
            assertOperationIsConsistent(_operation);
        }
        // determine the bit to set for this owner.
        uint ownerIndexBit = 2**ownerIndex;
        // make sure we (the message sender) haven't confirmed this operation previously.
        if (pending.ownersDone & ownerIndexBit == 0) {
            Confirmation(msg.sender, _operation);
            // ok - check if count is enough to go ahead.
            if (pending.yetNeeded <= 1) {
                // enough confirmations: reset and run interior.
                delete m_pendingIndex[m_pending[_operation].index];
                delete m_pending[_operation];
                return true;
            }
            else
            {
                // not enough: record that this owner in particular confirmed.
                pending.yetNeeded--;
                pending.ownersDone |= ownerIndexBit;
            }
        }
    }

    // Reclaims free slots between valid owners in m_owners.
    // TODO given that its called after each removal, it could be simplified.
    function reorganizeOwners() private {
        uint free = 1;
        while (free < m_numOwners)
        {
            // iterating to the first free slot from the beginning
            while (free < m_numOwners && m_owners[free] != 0) free++;

            // iterating to the first occupied slot from the end
            while (m_numOwners > 1 && m_owners[m_numOwners] == 0) m_numOwners--;

            // swap, if possible, so free slot is located at the end after the swap
            if (free < m_numOwners && m_owners[m_numOwners] != 0 && m_owners[free] == 0)
            {
                // owners between swapped slots should't be renumbered - that saves a lot of gas
                m_owners[free] = m_owners[m_numOwners];
                m_ownerIndex[m_owners[free]] = free;
                m_owners[m_numOwners] = 0;
            }
        }
    }

    function clearPending() internal {
        uint length = m_pendingIndex.length;
        for (uint i = 0; i < length; ++i)
            if (m_pendingIndex[i] != 0)
                delete m_pending[m_pendingIndex[i]];
        delete m_pendingIndex;
    }

    function assertOwnersAreConsistent() private constant {
        assert(m_numOwners > 0);
        assert(m_numOwners <= c_maxOwners);
        assert(m_owners[0] == 0);
        assert(0 != m_required && m_required <= m_numOwners);
    }

    function assertOperationIsConsistent(bytes32 _operation) private constant {
        var pending = m_pending[_operation];
        assert(m_pendingIndex[pending.index] == _operation);
        assert(pending.yetNeeded <= m_required);
    }

   	// FIELDS

    uint constant c_maxOwners = 250;

    // the number of owners that must confirm the same operation before it is run.
    uint public m_required;

    // pointer used to find a free slot in m_owners
    uint public m_numOwners;

    // list of owners (addresses),
    // slot 0 is unused so there are no owner which index is 0.
    // TODO could we save space at the end of the array for the common case of <10 owners? and should we?
    uint[256] m_owners;

    // index on the list of owners to allow reverse lookup: owner address => index in m_owners
    mapping(uint => uint) m_ownerIndex;

    // the ongoing operations.
    mapping(bytes32 => PendingState) m_pending;
    bytes32[] m_pendingIndex;
}

// Code taken from https://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol
// Audit and improvements by github.com/Eenae

// @authors:
// Gav Wood <g@ethdev.com>
// inheritable "property" contract that enables methods to be protected by requiring the acquiescence of either a
// single, or, crucially, each of a number of, designated owners.
// usage:
// use modifiers onlyowner (just own owned) or onlymanyowners(hash), whereby the same hash must be provided by
// some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the
// interior is executed.

pragma solidity ^0.4.10;

contract multiowned {

	// TYPES

    // struct for the status of a pending operation.
    struct PendingState {
        // count of confirmations needed
        uint yetNeeded;

        // bitmap of confirmations where owner #ownerIndex's decision corresponds to 2**ownerIndex bit
        uint ownersDone;

        // position of this operation key in m_pendingIndex
        uint index;
    }

	// EVENTS

    // this contract only has six types of events: it can accept a confirmation, in which case
    // we record owner and operation (hash) alongside it.
    event Confirmation(address owner, bytes32 operation);
    event Revoke(address owner, bytes32 operation);
    // some others are in the case of an owner changing.
    event OwnerChanged(address oldOwner, address newOwner);
    event OwnerAdded(address newOwner);
    event OwnerRemoved(address oldOwner);
    // the last one is emitted if the required signatures change
    event RequirementChanged(uint newRequirement);

	// MODIFIERS

    // simple single-sig function modifier.
    modifier onlyowner {
        require(isOwner(msg.sender));
        _;
    }
    // multi-sig function modifier: the operation must have an intrinsic hash in order
    // that later attempts can be realised as the same underlying operation and
    // thus count as confirmations.
    modifier onlymanyowners(bytes32 _operation) {
        if (confirmAndCheck(_operation)) {
            _;
        }
        // Even if required number of confirmations has't been collected yet,
        // we can't throw here - because changes to the state have to be preserved.
        // But, confirmAndCheck itself will throw in case sender is not an owner.
    }

	// METHODS

    // constructor is given number of sigs required to do protected "onlymanyowners" transactions
    // as well as the selection of extra addresses capable of confirming them (msg.sender also added to owners).
    function multiowned(address[] _extraOwners, uint _required) {
        m_numOwners = _extraOwners.length + 1;
        require(m_numOwners <= c_maxOwners);
        require(_required > 0 && _required <= m_numOwners);

        m_owners[1] = uint(msg.sender);
        m_ownerIndex[uint(msg.sender)] = 1;
        for (uint i = 0; i < _extraOwners.length; ++i)
        {
            m_owners[2 + i] = uint(_extraOwners[i]);
            m_ownerIndex[uint(_extraOwners[i])] = 2 + i;
        }
        m_required = _required;

        assertOwnersAreConsistent();
    }

    // Revokes a prior confirmation of the given operation
    function revoke(bytes32 _operation) external {
        uint ownerIndex = m_ownerIndex[uint(msg.sender)];
        // make sure they're an owner
        if (ownerIndex == 0) return;
        uint ownerIndexBit = 2**ownerIndex;
        var pending = m_pending[_operation];
        if (pending.ownersDone & ownerIndexBit > 0) {
            pending.yetNeeded++;
            pending.ownersDone -= ownerIndexBit;
            Revoke(msg.sender, _operation);
        }
    }

    // Replaces an owner `_from` with another `_to`.
    // All pending operations will be canceled!
    function changeOwner(address _from, address _to) onlymanyowners(sha3(msg.data)) external {
        require(isOwner(_from) && !isOwner(_to));   // this usage error should be noticed by the caller

        assertOwnersAreConsistent();

        clearPending();
        uint ownerIndex = m_ownerIndex[uint(_from)];
        m_owners[ownerIndex] = uint(_to);
        m_ownerIndex[uint(_from)] = 0;
        m_ownerIndex[uint(_to)] = ownerIndex;

        assertOwnersAreConsistent();
        OwnerChanged(_from, _to);
    }

    // All pending operations will be canceled!
    function addOwner(address _owner) onlymanyowners(sha3(msg.data)) external {
        require(! isOwner(_owner));     // this usage error should be noticed by the caller
        require(m_numOwners < c_maxOwners);

        assertOwnersAreConsistent();

        clearPending();
        m_numOwners++;
        m_owners[m_numOwners] = uint(_owner);
        m_ownerIndex[uint(_owner)] = m_numOwners;

        assertOwnersAreConsistent();
        OwnerAdded(_owner);
    }

    // All pending operations will be canceled!
    function removeOwner(address _owner) onlymanyowners(sha3(msg.data)) external {
        require(isOwner(_owner));   // this usage error should be noticed by the caller
        require(m_numOwners > 1);   // wont remove the last owner
        require(m_required <= m_numOwners - 1);

        assertOwnersAreConsistent();

        clearPending();
        uint ownerIndex = m_ownerIndex[uint(_owner)];
        m_owners[ownerIndex] = 0;
        m_ownerIndex[uint(_owner)] = 0;
        //make sure m_numOwners is equal to the number of owners and always points to the last owner
        reorganizeOwners();

        assertOwnersAreConsistent();
        OwnerRemoved(_owner);
    }

    // All pending operations will be canceled!
    function changeRequirement(uint _newRequired) onlymanyowners(sha3(msg.data)) external {
        require(_newRequired > 0 && _newRequired <= m_numOwners);
        m_required = _newRequired;
        clearPending();
        RequirementChanged(_newRequired);
    }

    // Gets an owner by 0-indexed position
    function getOwner(uint ownerIndex) external constant returns (address) {
        return address(m_owners[ownerIndex + 1]);
    }

    function isOwner(address _addr) constant returns (bool) {
        return m_ownerIndex[uint(_addr)] > 0;
    }

    // Tests ownership of the current caller.
    // It's advisable to call it by new owner to make sure that the same erroneous address is not copy-pasted to
    // addOwner/changeOwner and to isOwner.
    function amIOwner() constant onlyowner returns (bool) {
        return true;
    }

    function hasConfirmed(bytes32 _operation, address _owner) constant returns (bool) {
        var pending = m_pending[_operation];
        uint ownerIndex = m_ownerIndex[uint(_owner)];

        // make sure they're an owner
        if (ownerIndex == 0) return false;

        // determine the bit to set for this owner.
        uint ownerIndexBit = 2**ownerIndex;
        return !(pending.ownersDone & ownerIndexBit == 0);
    }

    // INTERNAL METHODS

    function confirmAndCheck(bytes32 _operation) internal returns (bool) {
        // determine what index the present sender is:
        uint ownerIndex = m_ownerIndex[uint(msg.sender)];
        // make sure they're an owner
        require(ownerIndex != 0);

        var pending = m_pending[_operation];
        // if we're not yet working on this operation, switch over and reset the confirmation status.
        if (pending.yetNeeded == 0) {
            // reset count of confirmations needed.
            pending.yetNeeded = m_required;
            // reset which owners have confirmed (none) - set our bitmap to 0.
            pending.ownersDone = 0;
            pending.index = m_pendingIndex.length++;
            m_pendingIndex[pending.index] = _operation;
            assertOperationIsConsistent(_operation);
        }
        // determine the bit to set for this owner.
        uint ownerIndexBit = 2**ownerIndex;
        // make sure we (the message sender) haven't confirmed this operation previously.
        if (pending.ownersDone & ownerIndexBit == 0) {
            Confirmation(msg.sender, _operation);
            // ok - check if count is enough to go ahead.
            if (pending.yetNeeded <= 1) {
                // enough confirmations: reset and run interior.
                delete m_pendingIndex[m_pending[_operation].index];
                delete m_pending[_operation];
                return true;
            }
            else
            {
                // not enough: record that this owner in particular confirmed.
                pending.yetNeeded--;
                pending.ownersDone |= ownerIndexBit;
            }
        }
    }

    // Reclaims free slots between valid owners in m_owners.
    // TODO given that its called after each removal, it could be simplified.
    function reorganizeOwners() private {
        uint free = 1;
        while (free < m_numOwners)
        {
            // iterating to the first free slot from the beginning
            while (free < m_numOwners && m_owners[free] != 0) free++;

            // iterating to the first occupied slot from the end
            while (m_numOwners > 1 && m_owners[m_numOwners] == 0) m_numOwners--;

            // swap, if possible, so free slot is located at the end after the swap
            if (free < m_numOwners && m_owners[m_numOwners] != 0 && m_owners[free] == 0)
            {
                // owners between swapped slots should't be renumbered - that saves a lot of gas
                m_owners[free] = m_owners[m_numOwners];
                m_ownerIndex[m_owners[free]] = free;
                m_owners[m_numOwners] = 0;
            }
        }
    }

    function clearPending() internal {
        uint length = m_pendingIndex.length;
        for (uint i = 0; i < length; ++i)
            if (m_pendingIndex[i] != 0)
                delete m_pending[m_pendingIndex[i]];
        delete m_pendingIndex;
    }

    function assertOwnersAreConsistent() private constant {
        assert(m_numOwners > 0);
        assert(m_numOwners <= c_maxOwners);
        assert(m_owners[0] == 0);
        assert(0 != m_required && m_required <= m_numOwners);
    }

    function assertOperationIsConsistent(bytes32 _operation) private constant {
        var pending = m_pending[_operation];
        assert(m_pendingIndex[pending.index] == _operation);
        assert(pending.yetNeeded <= m_required);
    }

   	// FIELDS

    uint constant c_maxOwners = 250;

    // the number of owners that must confirm the same operation before it is run.
    uint public m_required;

    // pointer used to find a free slot in m_owners
    uint public m_numOwners;

    // list of owners (addresses),
    // slot 0 is unused so there are no owner which index is 0.
    // TODO could we save space at the end of the array for the common case of <10 owners? and should we?
    uint[256] m_owners;

    // index on the list of owners to allow reverse lookup: owner address => index in m_owners
    mapping(uint => uint) m_ownerIndex;

    // the ongoing operations.
    mapping(bytes32 => PendingState) m_pending;
    bytes32[] m_pendingIndex;
}


Add multi else-if source

Add multi else-if source

pragma solidity >=0.4.22 <0.6.0;

contract Test {
  mapping (address => uint) balances;

  event Transfer(address indexed _from, address indexed _to, uint256 _value);

  constructor() public {
    balances[tx.origin] = 10000;
  }

  function sendCoin(address receiver, uint amount) public returns(bool sufficient) {
    if (balances[msg.sender] < amount)
      return false;
    else if (amount == 1)
      return false;
    else if (amount == 2 || amount == 3 || amount == 4)
      return false;
    else if (amount == 5)
      return false;
    else if (amount == 1)
      return false;
    else if (amount == 2 || amount == 3 || amount == 4)
      return false;
    else if (amount == 5)
      return false;
    else if (amount == 1)
      return false;
    else if (amount == 2 || amount == 3 || amount == 4)
      return false;
    else if (amount == 5)
      return false;
    else if (amount == 1)
      return false;
    else if (amount == 2 || amount == 3 || amount == 4)
      return false;
    else if (amount == 5)
      return false;
    else if (amount == 1)
      return false;
    else if (amount == 2 || amount == 3 || amount == 4)
      return false;
    else if (amount == 5)
      return false;

    balances[msg.sender] -= amount;
    balances[receiver] += amount;
    emit Transfer(msg.sender, receiver, amount);

    if(balances[receiver] >= amount)
      sufficient = true;
  }

  function getBalance(address addr) public view returns(uint) {
    return balances[addr];
  }
}

error: pathspec 'test/sources/if/else-if-unbracketed-multi.sol' did not match any file(s) known to git


checkInvariants Solidity limitation

checkInvariants Solidity limitation

Mention current Solidity limitation because this is an example that some people may just copy without being aware of the limitation.

contract TokenWithInvariants {
  mapping(address => uint) public balanceOf;
  uint public totalSupply;

  // until https://github.com/ethereum/solidity/issues/686 is fixed, this modifier
  // only fully works for function bodies that do not have a `return`
  modifier checkInvariants {
    _
    if (this.balance < totalSupply) throw;
  }

  function deposit(uint amount) checkInvariants {
    // intentionally vulnerable
    balanceOf[msg.sender] += amount;
    totalSupply += amount;
  }

  function transfer(address to, uint value) checkInvariants {
    if (balanceOf[msg.sender] >= value) {
      balanceOf[to] += value;
      balanceOf[msg.sender] -= value;
    }
  }

  function withdraw() checkInvariants {
    // intentionally vulnerable
    uint balance = balanceOf[msg.sender];
    if (msg.sender.call.value(balance)()) {
      totalSupply -= balance;
      balanceOf[msg.sender] = 0;
    }
  }
}

contract TokenWithInvariants {
  mapping(address => uint) public balanceOf;
  uint public totalSupply;

  modifier checkInvariants {
    _
    if (this.balance < totalSupply) throw;
  }

  function deposit(uint amount) checkInvariants {
    // intentionally vulnerable
    balanceOf[msg.sender] += amount;
    totalSupply += amount;
  }

  function transfer(address to, uint value) checkInvariants {
    if (balanceOf[msg.sender] >= value) {
      balanceOf[to] += value;
      balanceOf[msg.sender] -= value;
    }
  }

  function withdraw() checkInvariants {
    // intentionally vulnerable
    uint balance = balanceOf[msg.sender];
    if (msg.sender.call.value(balance)()) {
      totalSupply -= balance;
      balanceOf[msg.sender] = 0;
    }
  }
}