Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 134 in /var/www/tg-me/post.php on line 75
Библиотека питониста | Python, Django, Flask | Telegram Webview: pyproglib/6819 -
Telegram Group & Telegram Channel
🎮 Создание и развертывание простого смарт-контракта с использованием Python

Проблема: разработка смарт-контрактов часто требует глубокого понимания Solidity и сложных инструментов. Для Python-разработчиков важен упрощённый подход к написанию и тестированию смарт-контрактов.

Решение: в книге Hands-On Blockchain for Python Developers автор показывает, как использовать библиотеку web3.py для взаимодействия с Ethereum-сетью и создания простого смарт-контракта, написанного на Solidity, из Python.

Пример кода:

from web3 import Web3

# Подключение к локальному Ethereum ноду
w3 = Web3(Web3.HTTPProvider('http://127.0.0.1:8545'))

# ABI и байткод контракта (упрощённый пример)
abi = '[{"inputs":[],"name":"getValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]'
bytecode = '0x6080604052348015600f57600080fd5b5060a88061001e6000396000f3fe60806040...'

# Развёртывание контракта
SimpleContract = w3.eth.contract(abi=abi, bytecode=bytecode)
tx_hash = SimpleContract.constructor().transact({'from': w3.eth.accounts[0]})
tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)

print(f'Контракт развернут по адресу: {tx_receipt.contractAddress}')


Преимущества:
— Позволяет Python-разработчикам работать со смарт-контрактами без глубокого погружения в Solidity
— Использование знакомых инструментов Python
— Автоматизация и тестирование контрактов на локальных сетях

🆖 Еще больше полезных книг — в нашем канале @progbook

Библиотека питониста #буст
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/pyproglib/6819
Create:
Last Update:

🎮 Создание и развертывание простого смарт-контракта с использованием Python

Проблема: разработка смарт-контрактов часто требует глубокого понимания Solidity и сложных инструментов. Для Python-разработчиков важен упрощённый подход к написанию и тестированию смарт-контрактов.

Решение: в книге Hands-On Blockchain for Python Developers автор показывает, как использовать библиотеку web3.py для взаимодействия с Ethereum-сетью и создания простого смарт-контракта, написанного на Solidity, из Python.

Пример кода:

from web3 import Web3

# Подключение к локальному Ethereum ноду
w3 = Web3(Web3.HTTPProvider('http://127.0.0.1:8545'))

# ABI и байткод контракта (упрощённый пример)
abi = '[{"inputs":[],"name":"getValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]'
bytecode = '0x6080604052348015600f57600080fd5b5060a88061001e6000396000f3fe60806040...'

# Развёртывание контракта
SimpleContract = w3.eth.contract(abi=abi, bytecode=bytecode)
tx_hash = SimpleContract.constructor().transact({'from': w3.eth.accounts[0]})
tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash)

print(f'Контракт развернут по адресу: {tx_receipt.contractAddress}')


Преимущества:
— Позволяет Python-разработчикам работать со смарт-контрактами без глубокого погружения в Solidity
— Использование знакомых инструментов Python
— Автоматизация и тестирование контрактов на локальных сетях

🆖 Еще больше полезных книг — в нашем канале @progbook

Библиотека питониста #буст

BY Библиотека питониста | Python, Django, Flask


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/pyproglib/6819

View MORE
Open in Telegram


Библиотека питониста | Python Django Flask Telegram | DID YOU KNOW?

Date: |

What Is Bitcoin?

Bitcoin is a decentralized digital currency that you can buy, sell and exchange directly, without an intermediary like a bank. Bitcoin’s creator, Satoshi Nakamoto, originally described the need for “an electronic payment system based on cryptographic proof instead of trust.” Each and every Bitcoin transaction that’s ever been made exists on a public ledger accessible to everyone, making transactions hard to reverse and difficult to fake. That’s by design: Core to their decentralized nature, Bitcoins aren’t backed by the government or any issuing institution, and there’s nothing to guarantee their value besides the proof baked in the heart of the system. “The reason why it’s worth money is simply because we, as people, decided it has value—same as gold,” says Anton Mozgovoy, co-founder & CEO of digital financial service company Holyheld.

Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.

Библиотека питониста | Python Django Flask from us


Telegram Библиотека питониста | Python, Django, Flask
FROM USA