contract VeTokenizedAsset is StandardToken, Ownable {

    //--- Definitions

    using SafeMath for uint256;

    //--- Storage

    bool public configured;
    string public symbol;
    string public name;
    string public description;
    uint256 public decimals;
    string public source;
    string public proof;
    uint256 public totalSupply;

    //--- Construction

    function VeTokenizedAsset() {
        // asset should be parametrized using `setup()` function
    }

    //--- Events

    event SourceChanged(string newSource, string newProof, uint256 newTotalSupply);
    event SupplyChanged(uint256 newTotalSupply);

    //--- Public mutable functions

    function setup(
        string _symbol,
        string _name,
        string _description,
        uint256 _decimals,
        string _source,
        string _proof,
        uint256 _totalSupply
    )
        public
        onlyOwner
    {
        require(!configured);
        require(bytes(_symbol).length > 0);
        require(bytes(_name).length > 0);
        require(_decimals > 0 && _decimals <= 32);

        symbol = _symbol;
        name = _name;
        description = _description;
        decimals = _decimals;
        source = _source;
        proof = _proof;
        totalSupply = _totalSupply;
        configured = true;

        balances[owner] = _totalSupply;

        SourceChanged(_source, _proof, _totalSupply);
    }

    function changeSource(string newSource, string newProof, uint256 newTotalSupply) onlyOwner {
        uint256 prevBalance = balances[owner];

        if (newTotalSupply < totalSupply) {
            uint256 decrease = totalSupply.sub(newTotalSupply);
            balances[owner] = prevBalance.sub(decrease); // throws when balance is insufficient
        } else if (newTotalSupply > totalSupply) {
            uint256 increase = newTotalSupply.sub(totalSupply);
            balances[owner] = prevBalance.add(increase);
        }

        source = newSource;
        proof = newProof;
        totalSupply = newTotalSupply;

        SourceChanged(newSource, newProof, newTotalSupply);
    }

    function mint(uint256 amount) public onlyOwner {
        require(amount > 0);

        totalSupply = totalSupply.add(amount);
        balances[owner] = balances[owner].add(amount);

        SupplyChanged(totalSupply);
    }

    function burn(uint256 amount) public onlyOwner {
        require(amount > 0);
        require(amount <= balances[owner]);

        totalSupply = totalSupply.sub(amount);
        balances[owner] = balances[owner].sub(amount); // throws when balance is insufficient

        SupplyChanged(totalSupply);
    }
}
function VeTokenizedAsset() {
    // asset should be parametrized using `setup()` function
}

//--- Construction