
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
XDCweb3.py is a Python library for interacting with XDC (XinFin Digital Contract) tokens using web3.py
XDCweb3.py is a Python library for interacting with XDC (XinFin Digital Contract) tokens (XRC20 for now) using web3.py.
You can install XDCweb3.py using pip:
pip install XDCweb3
import XDCweb3
# Initialize XRC20 object with RPC URL
rpc_url = 'https://rpc.xdcrpc.com' # Replace with your RPC URL
xrc20 = XRC20(rpc_url)
token_addr = '0x...' # Replace with the token contract address
name = xrc20.name(token_addr)
print(f"Token Name: {name}")
token_addr = '0x...' # Replace with the token contract address
total_supply = xrc20.total_supply(token_addr)
print(f"Total Supply: {total_supply}")
token_addr = '0x...' # Replace with the token contract address
decimals = xrc20.decimals(token_addr)
print(f"Decimals: {decimals}")
token_addr = '0x...' # Replace with the token contract address
symbol = xrc20.symbol(token_addr)
print(f"Symbol: {symbol}")
token_addr = '0x...' # Replace with the token contract address
owner_address = '0x...' # Replace with the address to check balance
balance = xrc20.balance_of(token_addr, owner_address)
print(f"Balance of {owner_address}: {balance}")
owner_address = '0x...' # Sender's address
owner_private_key = '0x...' # Sender's private key
receiver_address = '0x...' # Receiver's address
amount = 1 # Amount to transfer in XDC
tx_hash = xrc20.transfer_xdc(owner_address, owner_private_key, receiver_address, amount)
print(f"Transfer XDC Transaction Hash: {tx_hash}")
owner_address = '0x...' # Sender's address
owner_private_key = '0x...' # Sender's private key
receiver_address = '0x...' # Receiver's address
amount = 1 # Amount of tokens to transfer
tx_hash = xrc20.transfer_token(token_addr, owner_address, owner_private_key, receiver_address, amount)
print(f"Transfer Token Transaction Hash: {tx_hash}")
owner_address = '0x...' # Sender's address
owner_private_key = '0x...' # Sender's private key
spender_address = '0x...' # Address allowed to spend tokens
amount = 1 # Amount of tokens to approve
tx_hash = xrc20.approve(token_addr, owner_address, owner_private_key, spender_address, amount)
print(f"Approve Token Transfer Transaction Hash: {tx_hash}")
spender_address = '0x...' # Address allowed to spend tokens
amount = 1 # Amount of tokens to adjust allowance
# Increase Allowance
tx_hash_increase = xrc20.increase_allowance(token_addr, owner_address, owner_private_key, spender_address, amount)
print(f"Increase Allowance Transaction Hash: {tx_hash_increase}")
# Decrease Allowance
tx_hash_decrease = xrc20.decrease_allowance(token_addr, owner_address, owner_private_key, spender_address, amount)
print(f"Decrease Allowance Transaction Hash: {tx_hash_decrease}")
spender_address = '0x...' # Spender's address
receiver_address = '0x...' # Receiver's address
spender_private_key = '0x...' # Spender's private key
amount = 1 # Amount of tokens to transfer
tx_hash = xrc20.transfer_from(token_addr, owner_address, spender_address, spender_private_key, receiver_address, amount)
print(f"Transfer From Transaction Hash: {tx_hash}")
This library is licensed under the MIT License.
FAQs
XDCweb3.py is a Python library for interacting with XDC (XinFin Digital Contract) tokens using web3.py
We found that XDCweb3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.