contract BLMain is BLBlocks {

    event ChangedInitialPrice(uint price);
    event ChangedFeePercentage(uint percentage);
    event ChangedNeighbourReward(uint percentage);

    // provides the total number of purchased blocks
    function totalSupply() public view returns (uint count) {
        count = s.getUInt("blockCount");
        return count;
    }

    // allows to change the price of an empty block
    function setInitialPrice(uint price) public onlyPrimary {
        s.setUInt("initialPrice", price);
        ChangedInitialPrice(price);
    }

    // allows to change the platform fee percentage
    function setFeePercentage(uint feePercentage) public onlyPrimary {
        s.setUInt("buyOutFeePercentage", feePercentage);
        ChangedFeePercentage(feePercentage);
    }
    
    // allows to change the neighbour reward percentage
    function setNeighbourRewardPercentage(uint rewardPercentage) public onlyPrimary {
        s.setUInt("neighbourRewardPercentage", rewardPercentage);
        ChangedNeighbourReward(rewardPercentage);
    }

    // provides the neighbourRewardPercentage
    function getNeighbourReward() public view returns (uint) {
        return s.getUInt("neighbourRewardPercentage");
    }
    
        // provides the starting price for an empty block
    function getInitialPrice() public view returns (uint) {
        return s.getUInt("initialPrice");
    }

    // provides the price of an empty block
    function getFeePercentage() public view returns (uint) {
        return s.getUInt("buyOutFeePercentage");
    }
}
/*
 Main Blocklord contract. It exposes some commodity functions and functions from its subcontracts.
 */
function totalSupply() public view returns (uint count) {
    count = s.getUInt("blockCount");
    return count;
}

// provides the total number of purchased blocks