Python to EVM in Seconds
Watch your Python smart contracts transform into optimized Solidity code
Python Smart Contract
@contract
class SimpleToken:
def __init__(self, name: str, symbol: str):
self.name = name
self.symbol = symbol
self.balances = {}
def mint(self, to: address, amount: uint256):
self.balances[to] += amountWhy Choose PyVax?
Built for Python developers who want to enter Web3 without learning Solidity
Python-First Development
Write smart contracts in familiar Python syntax with full type safety and IDE support.
Lightning Fast Compilation
Compile Python to optimized EVM bytecode in milliseconds, not minutes.
Built-in Security
Automatic security checks and vulnerability detection during compilation.
EVM Compatible
Deploy to any EVM-compatible blockchain with full compatibility guarantees.
Learn from Real Python Smart Contracts
PyVax AI uses comprehensive examples like this stakeable token contract to generate accurate, production-ready Python code.
"""
Python Stakeable Token Contract
===============================
ERC-20 style token in Python with:
- Minting
- Staking system
- Transfer functionality
- Dynamic reward rate adjustment
"""
from avax_cli.py_contracts import PySmartContract
class StakeToken(PySmartContract):
def __init__(self):
super().__init__()
# Token metadata
self.name = self.state_var("name", "StakeableToken")
self.symbol = self.state_var("symbol", "STK")
self.decimals = self.state_var("decimals", 18)
self.total_supply = self.state_var("total_supply", 1000000)
@view_function
def get_name(self) -> str:
return self.name
@public_function
def stake(self, amount: int):
"""Stake tokens to earn rewards"""
if self.user_balance >= amount:
self.user_balance = self.user_balance - amount
self.user_stake = self.user_stake + amount
# Calculate reward instantly
reward = (amount * self.reward_rate) // 100
self.user_reward = self.user_reward + reward
self.event("Staked", amount, reward)See PyVax in Action
Write smart contracts in Python with familiar syntax and powerful AST parser compilation
Python Smart Contract
from avax_cli.py_contracts import PySmartContract
@PySmartContract
class ERC20Token:
def __init__(self, name: str, symbol: str, total_supply: uint256):
self.name = name
self.symbol = symbol
self.total_supply = total_supply
self.balances = {msg.sender: total_supply}
self.allowances = {}
@public
def transfer(self, to: address, amount: uint256) -> bool:
require(self.balances[msg.sender] >= amount, "Insufficient balance")
self.balances[msg.sender] -= amount
self.balances[to] += amount
emit Transfer(msg.sender, to, amount)
return True
@public
def approve(self, spender: address, amount: uint256) -> bool:
self.allowances[msg.sender][spender] = amount
emit Approval(msg.sender, spender, amount)
return TrueOur Vision for the Future
Empowering the next generation of Web3 developers with Python-first smart contract development