pragma solidity ^0.4.24; import "./ERC223TokenWidgetRenderer.sol"; import "tokenboost-solidity/contracts/widget/Widgets.sol"; contract TotalSupplyWidgetRenderer is ERC223TokenWidgetRenderer { using Widgets for Widgets.Widget; using strings for *; using UintUtils for uint; string public constant TOTAL_SUPPLY = "total_supply"; string public constant SHORT_DESC = "short_desc"; string public constant LONG_DESC = "long_desc"; function render(string _locale, ERC223Token _token) public view returns (string) { Elements.Element[] memory elements = new Elements.Element[](1); elements[0] = Elements.Element( true, TOTAL_SUPPLY, "token".toSlice().concat(uint(_token.decimals()).toString().toSlice()), resources[_locale][TOTAL_SUPPLY], _token.totalSupply().toString(), Actions.empty(), Tables.empty() ); Widgets.Widget memory widget = Widgets.Widget( resources[_locale][TOTAL_SUPPLY], resources[_locale][SHORT_DESC], resources[_locale][LONG_DESC], 4, elements ); return widget.toJson(); } }