// The struct consists of ERC20-style token metadata. struct ERC20Metadata { string name; string symbol; uint8 decimals; } // The struct consists of token address, // and price per full share (1e18). struct Component { address token; int256 rate; }
view
function getComponents(address token) view returns (Component[])
The function returns underlying tokens and price of the base token's full share (1e18).
function getMetadata(address token) view returns (ERC20Metadata) { return ERC20Metadata({ name: getName(token), symbol: getSymbol(token), decimals: getDecimals(token) }); }