Пример #1
0
    def load_moc_bpro_token_contract(self, contract_address):

        network = self.connection_manager.network
        if not contract_address:
            contract_address = self.connection_manager.options['networks'][
                network]['addresses']['BProToken']

        sc = RIFPro(self.connection_manager, contract_address=contract_address)

        return sc
Пример #2
0
contract = RDOCMoCBProxManager(connection_manager)
count += 1
line = '| {0} | {1}  | {2}  | {3} |'.format(count, 'MoCBProxManager',
                                            addresses['MoCBProxManager'],
                                            contract.implementation())
lines.append(line)

# RIFDoC
contract = RIFDoC(connection_manager)
count += 1
line = '| {0} | {1}  | {2}  | {3} |'.format(count, 'RIFDoC', '',
                                            contract.address())
lines.append(line)

# RIFPro
contract = RIFPro(connection_manager)
count += 1
line = '| {0} | {1}  | {2}  | {3} |'.format(count, 'RIFPro', '',
                                            contract.address())
lines.append(line)

# Oracle
contract = RDOCMoCMedianizer(connection_manager)
count += 1
line = '| {0} | {1}  | {2}  | {3} |'.format(count, 'MoCMedianizer', '',
                                            contract.address())
lines.append(line)

# finally print
print(md_header)
print('\n'.join(lines))
Пример #3
0
amount_allow = 0  # 0 if you dont want to allow anything

dex_address = connection_manager.options['networks'][network]['addresses']['dex']

if token in ['DOC']:
    token_sc = DoCToken(connection_manager, contract_address=settings[network]['DOC'])
elif token in ['BPRO']:
    token_sc = BProToken(connection_manager, contract_address=settings[network]['BPRO'])
elif token in ['WRBTC']:
    token_sc = WRBTC(connection_manager, contract_address=settings[network]['WRBTC'])
elif token in ['RDOC']:
    token_sc = RIFDoC(connection_manager, contract_address=settings[network]['RDOC'])
elif token in ['RIF']:
    token_sc = RIF(connection_manager, contract_address=settings[network]['RIF'])
elif token in ['RIFP']:
    token_sc = RIFPro(connection_manager, contract_address=settings[network]['RIFP'])
else:
    raise Exception("Token not recognize")

print("TOKEN INFO")
print("==========")
print("")
print("Token Name: {0}".format(token_sc.name()))
print("Token Symbol: {0}".format(token_sc.symbol()))
print("Total Supply: {0}".format(token_sc.total_supply()))
print("")
print("BALANCES")
print("==========")
print("")
print("Balance: {0} {1}".format(token_sc.balance_of(account), token))
print("Allowance: {0} {1}".format(token_sc.allowance(account, dex_address), token))
Пример #4
0
token_name = 'BPRO'
token = settings[network][token_name]
token_sc = BProToken(connection_manager, contract_address=token)

table.add_row(token_name, str(token_sc.balance_of(account)), token,
              str(block_identifier))

token_name = 'RDOC'
token = settings[network][token_name]
token_sc = RIFDoC(connection_manager, contract_address=token)

table.add_row(token_name, str(token_sc.balance_of(account)), token,
              str(block_identifier))

token_name = 'RIF'
token = settings[network][token_name]
token_sc = RIF(connection_manager, contract_address=token)

table.add_row(token_name, str(token_sc.balance_of(account)), token,
              str(block_identifier))

token_name = 'RIFP'
token = settings[network][token_name]
token_sc = RIFPro(connection_manager, contract_address=token)

table.add_row(token_name, str(token_sc.balance_of(account)), token,
              str(block_identifier))

console.print(table)
Пример #5
0
network = 'rdocTestnet'
connection_manager = ConnectionManager(network=network)
print("Connecting to %s..." % network)
print("Connected: {conectado}".format(conectado=connection_manager.is_connected))

account = '0xCD8a1C9aCC980Ae031456573e34Dc05CD7dAE6e3'

print("Connecting to RIF TOKEN")
rif_token = RIF(connection_manager)
print("Token Name: {0}".format(rif_token.name()))
print("Token Symbol: {0}".format(rif_token.symbol()))
print("Total Supply: {0}".format(rif_token.total_supply()))
print("Account: {0} Balance RIF: {1}".format(account, rif_token.balance_of(account, block_identifier=1442600)))
print(rif_token.address())


doc_token = RIFDoC(connection_manager)
print("Token Name: {0}".format(doc_token.name()))
print("Token Symbol: {0}".format(doc_token.symbol()))
print("Total Supply: {0}".format(doc_token.total_supply()))
print("Account: {0} Balance DOC: {1}".format(account, doc_token.balance_of(account, block_identifier=1442000)))
print(doc_token.address())


rifp_token = RIFPro(connection_manager)
print("Token Name: {0}".format(rifp_token.name()))
print("Token Symbol: {0}".format(rifp_token.symbol()))
print("Total Supply: {0}".format(rifp_token.total_supply()))
print("Account: {0} Balance DOC: {1}".format(account, rifp_token.balance_of(account)))
print(rifp_token.address())