From c04004495e1ef2fb74034fd8f49d3ca8e9aba480 Mon Sep 17 00:00:00 2001 From: Marcus Aurelius Date: Thu, 16 Mar 2023 22:15:52 +0000 Subject: [PATCH] Fix renamed method names --- src/bond_alerts/main.py | 10 +++--- src/constants.py | 44 ++++++++++++------------ src/guerilla_marketing/guerilla_utils.py | 2 +- src/utils.py | 4 +-- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/bond_alerts/main.py b/src/bond_alerts/main.py index 9c2306f..9a49d96 100644 --- a/src/bond_alerts/main.py +++ b/src/bond_alerts/main.py @@ -39,7 +39,7 @@ def base_token_price(lp_address, known_address, known_price): # Retrieve token price by using the LP token try: - address = Web3.toChecksumAddress(lp_address) + address = Web3.to_checksum_address(lp_address) abi = json.loads('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"reserve0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"reserve1","type":"uint112"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"_reserve0","type":"uint112"},{"internalType":"uint112","name":"_reserve1","type":"uint112"},{"internalType":"uint32","name":"_blockTimestampLast","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sync","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]') # noqa: E501 LP_contract = web3.eth.contract(address=address, abi=abi) reserves = LP_contract.functions.getReserves().call() @@ -51,7 +51,7 @@ def base_token_price(lp_address, known_address, known_price): decimals0 = token0.functions.decimals().call() decimals1 = token1.functions.decimals().call() - if Web3.toChecksumAddress(known_address) == address0: + if Web3.to_checksum_address(known_address) == address0: tokenPrice = known_price * \ reserves[0] * 10**decimals1 / (reserves[1] * 10**decimals0) else: @@ -68,7 +68,7 @@ def base_token_price(lp_address, known_address, known_price): def lp_price(lp_address): # Retrieve price of the LP token try: - LP_address = Web3.toChecksumAddress(lp_address) + LP_address = Web3.to_checksum_address(lp_address) LP_abi = json.loads('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"reserve0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"reserve1","type":"uint112"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"_reserve0","type":"uint112"},{"internalType":"uint112","name":"_reserve1","type":"uint112"},{"internalType":"uint32","name":"_blockTimestampLast","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sync","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]') # noqa: E501 LP_contract = web3.eth.contract(address=LP_address, abi=LP_abi) @@ -193,8 +193,8 @@ def get_prices(): # Update bond info for b in bond_list: address, quote_token = fetch_bond_md(bond_db, b) - is_closed = max_debt_reached(bond_address=Web3.toChecksumAddress(address)) - price, disc, bond_max = contract_info(bond_address=Web3.toChecksumAddress(address), payoutTokenPrice=token_info[quote_token], maxReached=is_closed) # noqa: E501 + is_closed = max_debt_reached(bond_address=Web3.to_checksum_address(address)) + price, disc, bond_max = contract_info(bond_address=Web3.to_checksum_address(address), payoutTokenPrice=token_info[quote_token], maxReached=is_closed) # noqa: E501 update_bond_info(bond_db, update_bond=b, update_price=price, update_disc=float(disc), update_capacity=bond_max, update_debt=is_closed) # noqa: E501 print(b, price, quote_token, token_info[quote_token], f'{disc:,.2f}') diff --git a/src/constants.py b/src/constants.py index 781ba37..cd4919a 100755 --- a/src/constants.py +++ b/src/constants.py @@ -13,32 +13,32 @@ USDC_DECIMALS = 12 # Token Addresses -BCT_ADDRESS = Web3.toChecksumAddress('0x2f800db0fdb5223b3c3f354886d907a671414a7f') -C3_ADDRESS = Web3.toChecksumAddress('0xad01DFfe604CDc172D8237566eE3a3ab6524d4C6') -FRAX_ADDRESS = Web3.toChecksumAddress('0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89') -KLIMA_ADDRESS = Web3.toChecksumAddress('0x4e78011Ce80ee02d2c3e649Fb657E45898257815') -MCO2_ADDRESS = Web3.toChecksumAddress('0xfc98e825a2264d890f9a1e68ed50e1526abccacd') -MOSS_ADDRESS = Web3.toChecksumAddress('0x03e3369af9390493cb7cc599cd5233d50e674da4') -NBO_ADDRESS = Web3.toChecksumAddress('0x6BCa3B77C1909Ce1a4Ba1A20d1103bDe8d222E48') -NCT_ADDRESS = Web3.toChecksumAddress('0xD838290e877E0188a4A44700463419ED96c16107') -UBO_ADDRESS = Web3.toChecksumAddress('0x2B3eCb0991AF0498ECE9135bcD04013d7993110c') -USDC_ADDRESS = Web3.toChecksumAddress('0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174') +BCT_ADDRESS = Web3.to_checksum_address('0x2f800db0fdb5223b3c3f354886d907a671414a7f') +C3_ADDRESS = Web3.to_checksum_address('0xad01DFfe604CDc172D8237566eE3a3ab6524d4C6') +FRAX_ADDRESS = Web3.to_checksum_address('0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89') +KLIMA_ADDRESS = Web3.to_checksum_address('0x4e78011Ce80ee02d2c3e649Fb657E45898257815') +MCO2_ADDRESS = Web3.to_checksum_address('0xfc98e825a2264d890f9a1e68ed50e1526abccacd') +MOSS_ADDRESS = Web3.to_checksum_address('0x03e3369af9390493cb7cc599cd5233d50e674da4') +NBO_ADDRESS = Web3.to_checksum_address('0x6BCa3B77C1909Ce1a4Ba1A20d1103bDe8d222E48') +NCT_ADDRESS = Web3.to_checksum_address('0xD838290e877E0188a4A44700463419ED96c16107') +UBO_ADDRESS = Web3.to_checksum_address('0x2B3eCb0991AF0498ECE9135bcD04013d7993110c') +USDC_ADDRESS = Web3.to_checksum_address('0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174') # LP Pool Addresses -BCT_KLIMA_POOL = Web3.toChecksumAddress('0x9803c7ae526049210a1725f7487af26fe2c24614') -FRAX_C3_POOL = Web3.toChecksumAddress('0xb5600746f947c25c0cbc36429f87e6c88f9d6a88') -KLIMA_MCO2_POOL = Web3.toChecksumAddress('0x64a3b8ca5a7e406a78e660ae10c7563d9153a739') -KLIMA_NBO_POOL = Web3.toChecksumAddress('0x251cA6A70cbd93Ccd7039B6b708D4cb9683c266C') -KLIMA_USDC_POOL = Web3.toChecksumAddress('0x5786b267d35F9D011c4750e0B0bA584E1fDbeAD1') -MOSS_USDC_POOL = Web3.toChecksumAddress('0x75a7360e330c338007CF482e2CDf0A06573763A1') -UBO_KLIMA_POOL = Web3.toChecksumAddress('0x5400A05B8B45EaF9105315B4F2e31F806AB706dE') -USDC_NCT_POOL = Web3.toChecksumAddress('0xdb995f975f1bfc3b2157495c47e4efb31196b2ca') +BCT_KLIMA_POOL = Web3.to_checksum_address('0x9803c7ae526049210a1725f7487af26fe2c24614') +FRAX_C3_POOL = Web3.to_checksum_address('0xb5600746f947c25c0cbc36429f87e6c88f9d6a88') +KLIMA_MCO2_POOL = Web3.to_checksum_address('0x64a3b8ca5a7e406a78e660ae10c7563d9153a739') +KLIMA_NBO_POOL = Web3.to_checksum_address('0x251cA6A70cbd93Ccd7039B6b708D4cb9683c266C') +KLIMA_USDC_POOL = Web3.to_checksum_address('0x5786b267d35F9D011c4750e0B0bA584E1fDbeAD1') +MOSS_USDC_POOL = Web3.to_checksum_address('0x75a7360e330c338007CF482e2CDf0A06573763A1') +UBO_KLIMA_POOL = Web3.to_checksum_address('0x5400A05B8B45EaF9105315B4F2e31F806AB706dE') +USDC_NCT_POOL = Web3.to_checksum_address('0xdb995f975f1bfc3b2157495c47e4efb31196b2ca') # Klima Protocol Contracts -STAKING_ADDRESS = Web3.toChecksumAddress('0x25d28a24Ceb6F81015bB0b2007D795ACAc411b4d') -DISTRIBUTOR_ADDRESS = Web3.toChecksumAddress('0x4cC7584C3f8FAABf734374ef129dF17c3517e9cB') -SKLIMA_ADDRESS = Web3.toChecksumAddress('0xb0C22d8D350C67420f06F48936654f567C73E8C8') -DAO_WALLET_ADDRESS = Web3.toChecksumAddress('0x65a5076c0ba74e5f3e069995dc3dab9d197d995c') +STAKING_ADDRESS = Web3.to_checksum_address('0x25d28a24Ceb6F81015bB0b2007D795ACAc411b4d') +DISTRIBUTOR_ADDRESS = Web3.to_checksum_address('0x4cC7584C3f8FAABf734374ef129dF17c3517e9cB') +SKLIMA_ADDRESS = Web3.to_checksum_address('0xb0C22d8D350C67420f06F48936654f567C73E8C8') +DAO_WALLET_ADDRESS = Web3.to_checksum_address('0x65a5076c0ba74e5f3e069995dc3dab9d197d995c') # Subgraphs KLIMA_PROTOCOL_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/klimadao-protocol-metrics' diff --git a/src/guerilla_marketing/guerilla_utils.py b/src/guerilla_marketing/guerilla_utils.py index c016146..1ae763a 100644 --- a/src/guerilla_marketing/guerilla_utils.py +++ b/src/guerilla_marketing/guerilla_utils.py @@ -96,7 +96,7 @@ def validate_address(address): if not w3.isAddress(address): return False - aklima_contract = w3.eth.contract(w3.toChecksumAddress(AKLIMA_CONTRACT_ADDR), abi=ERC20_ABI) + aklima_contract = w3.eth.contract(w3.to_checksum_address(AKLIMA_CONTRACT_ADDR), abi=ERC20_ABI) akl_balance = aklima_contract.functions.balanceOf(address).call() if akl_balance > 0: diff --git a/src/utils.py b/src/utils.py index 89a6edd..8626de8 100755 --- a/src/utils.py +++ b/src/utils.py @@ -14,7 +14,7 @@ def get_polygon_web3(): web3 = Web3(Web3.HTTPProvider(PROVIDER_POLYGON_URL)) - assert web3.isConnected() + assert web3.is_connected() return web3 @@ -22,7 +22,7 @@ def get_polygon_web3(): def get_eth_web3(): web3_eth = Web3(Web3.HTTPProvider(PROVIDER_ETH_URL)) - assert web3_eth.isConnected() + assert web3_eth.is_connected() return web3_eth