def main(): safebox_eth = SafeBoxETH.at('0xeEa3311250FE4c3268F8E684f7C87A82fF183Ec1') safebox_usdt = SafeBox.at('0x020eDC614187F9937A1EfEeE007656C6356Fb13A') safebox_usdc = SafeBox.at('0x08bd64BFC832F1C2B3e07e634934453bA7Fa2db2') safebox_dai = SafeBox.at('0xee8389d235E092b2945fE363e97CDBeD121A0439') cy_eth = interface.IAny(safebox_eth.cToken()) cy_usdt = interface.IAny(safebox_usdt.cToken()) cy_usdc = interface.IAny(safebox_usdc.cToken()) cy_dai = interface.IAny(safebox_dai.cToken()) print('eth', safebox_eth.totalSupply() * cy_eth.exchangeRateStored() / 1e36) print('usdt', safebox_usdt.totalSupply() * cy_usdt.exchangeRateStored() / 1e24) print('usdc', safebox_usdc.totalSupply() * cy_usdc.exchangeRateStored() / 1e24) print('dai', safebox_dai.totalSupply() * cy_dai.exchangeRateStored() / 1e36)
def get_safebox(token): if token == Tokens.weth: return SafeBoxETH.at('0xeEa3311250FE4c3268F8E684f7C87A82fF183Ec1') elif token == Tokens.dai: return SafeBox.at('0xee8389d235E092b2945fE363e97CDBeD121A0439') elif token == Tokens.usdt: return SafeBox.at('0x020eDC614187F9937A1EfEeE007656C6356Fb13A') elif token == Tokens.usdc: return SafeBox.at('0x08bd64BFC832F1C2B3e07e634934453bA7Fa2db2') elif token == Tokens.yfi: return SafeBox.at('0x3614644AE157280b5C1d17AE686C153a204aaf3b') elif token == Tokens.dpi: return SafeBox.at('0x9E6aCA6B13a0Bc3364D035fF6D97ff4dB319F88A') elif token == Tokens.snx: return SafeBox.at('0x9446614037a839730A92E28a7ec870344B7B8F09') elif token == Tokens.susd: return SafeBox.at('0x3E1F2Feb27738609a22aa8B192a1a9138c445aa0') else: raise Exception(f'safebox not supported for token {token}')