Strike Docs
Search…
Market Metadata
The Comptroller contract has an array called allMarkets that contains the addresses of each sToken contract. Each address in the allMarkets array can be used to fetch a metadata struct in the Comptroller’s markets constant. See the Comptroller Storage contract for the Market struct definition.
Comptroller
1
SToken[] public allMarkets;
Copied!
Solidity
1
Comptroller troll = Comptroller(0xABCD...);
2
SToken sTokens[] = troll.allMarkets();
Copied!
Web3 1.2.6
1
const comptroller = new web3.eth.Contract(comptrollerAbi, comptrollerAddress);
2
const sTokens = await comptroller.methods.allMarkets().call();
3
const sToken = sTokens[0]; // address of a sToken
Copied!
Last modified 8mo ago
Copy link