1

Hi actually I found the answer & I just wanted to share this with the community

You can use the web3.py or brownie module of Python to achieve this

  • web3.py
from web3 import Web3

# Connect to custom RPC network
rpc_url = 'http://localhost:8545'  # Replace with your custom RPC URL
#chain_id = 1337  # Replace with your custom chain ID
web3 = Web3(Web3.HTTPProvider(rpc_url))

# Replace with the address of your deployed contract
contract_address = "0x876807312079af775c49c916856A2D65f904e612"
# Get teh byte code  
contract_bytecode = web3.eth.getCode(contract_address).hex()
print(f"Contract Bytecode: {contract_bytecode}")
  • brownie
from brownie import web3

contract_address = "0x876807312079af775c49c916856A2D65f904e612"
contract_bytecode = web3.eth.getCode(contract_address).hex()
print(f"Contract Bytecode: {contract_bytecode}")
  • Both will give the same result.

enter image description here

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.