working version, before optimalization
This commit is contained in:
33
florida/tools/debug_factory.py
Normal file
33
florida/tools/debug_factory.py
Normal file
@ -0,0 +1,33 @@
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
from web3 import Web3
|
||||
from dotenv import load_dotenv
|
||||
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
from clp_abis import NONFUNGIBLE_POSITION_MANAGER_ABI
|
||||
|
||||
load_dotenv()
|
||||
RPC_URL = os.environ.get("BASE_RPC_URL")
|
||||
w3 = Web3(Web3.HTTPProvider(RPC_URL))
|
||||
|
||||
NPM_ADDRESS = "0x827922686190790b37229fd06084350E74485b72"
|
||||
WETH = "0x4200000000000000000000000000000000000006"
|
||||
USDC = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
|
||||
|
||||
def check_code():
|
||||
npm_addr = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
|
||||
try:
|
||||
code = w3.eth.get_code(npm_addr)
|
||||
print(f"Code at {npm_addr}: {len(code)} bytes")
|
||||
|
||||
if len(code) > 0:
|
||||
# Try calling factory()
|
||||
npm = w3.eth.contract(address=npm_addr, abi=NONFUNGIBLE_POSITION_MANAGER_ABI)
|
||||
f = npm.functions.factory().call()
|
||||
print(f"Factory: {f}")
|
||||
except Exception as e:
|
||||
print(f"Check failed: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_code()
|
||||
Reference in New Issue
Block a user