Contrats
Vous trouverez ici le code Solidity des smart contracts utilisés par le site
Graphes
Serveur WebSocket
Petit serveur WebSocket fait avec Deno
Sert simplement à obtenir le nombre de connectés sur chaque page en temps réel
Logos
Compile the contract
compiled_sol = compile_source(contract_source_code) # Compiled source code
contract_interface = compiled_sol[':Factory']
web3.py instance
w3 = Web3(HTTPProvider('http://localhost:8545'))
set pre-funded account as sender
w3.eth.defaultAccount = w3.eth.accounts[0]
Instantiate and deploy contract
Factory = w3.eth.contract(abi=contract_interface['abi'], bytecode=contract_interface['bin'])
Submit the transaction that deploys the contract
tx_hash = Factory.constructor().transact()
Wait for the transaction to be mined, and get the transaction receipt
tx_receipt = w3.eth.waitForTransactionReceipt(tx_hash)
Create the contract instance with the newly-deployed address
factory = w3.eth.contract(
address=tx_receipt.contractAddress,
abi=contract_interface['abi'],
)
Display the default greeting from the contract
print('Default contract greeting: {}'.format(
factory.functions.token().call()
))
Ajoute les cors à ta socket, tu acceptes tout le monde. C'est dommage d'utiliser des bons outils comme Deno et de laisser des trous comme ça.
Pas encore publié