hide
You are viewing an archived web page, collected at the request of Ethereum Foundation using Archive-It. This page was captured on 15:56:52 Jun 05, 2021
, and is part of the Community collection.
The information on this web page may be out of date. See All versions of this archived page.
Loading media informationEnable QAView Missing URLs
It's example take from September meeting in Sydney. I use alethzero for test. Balance works and show my Ether balance, but eth.storageAt for my contract don't work in alethzero. When I use json on terminal
@Bezpol@robmyers what about doing the transfer in the d-app? is there a workaround for that? Also does this mean, AlethZero doesn't support serpent anymore?
Me too ( but I don't have ether on my accounts and Develope 0.6.8 cpp-ethereum build 64 ! ). After put code from example to Data Windows I was Error (file "main", line 1, char 0): Expected indented child block! Error (file "main", line 1, char 0): Expected indented child block! Error (file "main", line 1, char 0): Expected indented child block! Error (file "main", line 1, char 0): Expected indented child block!
@Bezpol: Python is indend-sensitive. Please make sure you have all the indent exactly as they appear in the file, depending on your OS the copy paste likely corrupted that.
Comments
( curl -X POST --data '{"jsonrpc": "2.0","method": "storageAt","params": {"a":"0xad2b15ffbd3204a69745e0d7c5b017bb2cb4015f", "x":"0x60bcc52db8acbb1bab463253cb3a2abf24950c28"},"id": 1}' http://localhost:8080 {"id":1,"jsonrpc":"2.0","result":"0x7d00"} )
everything is correct.
<html> <head> <script type="text/javascript"> function init() { var clientAddr = eth.coinbase; document.querySelector("#clientAddr").innerHTML = clientAddr; var contractAddr = "0xad2b15ffbd3204a69745e0d7c5b017bb2cb4015f"; var alethEtherBalance = eth.balanceAt(clientAddr).dec(); document.querySelector("#alethEtherBalance").innerHTML = (alethEtherBalance / Math.pow(10, 18)) + " eth"; var alexosBalance = eth.storageAt(contractAddr, clientAddr); document.querySelector("#alexosBalance").innerHTML = alexosBalance.dec() + " Alexos"; document.querySelector('#sendCoins').onclick = function() { var destAddr = ("0x" + document.querySelector("#receiver").value).pad(32); var amount = document.querySelector("#amount").value.pad(32); var data = (destAddr + amount).unbin(); document.querySelector("#data").innerHTML = data; var res = eth.doTransact(eth.key, 0, contractAddr, data, "100", "10000000000001"); }; } window.onload = init; </script> </head> <body> <h4>You are logged as:</h4> <div id="clientAddr"></div> <h4>Your Ethereum balance is:</h4> <div id="alethEtherBalance"></div> <h4>Your Alexos balance is:</h4> <div id="alexosBalance"></div> <h4>Send some coins</h4> <form action=""> <label>Receiver</label> <input id="receiver" type="text" /><br> <label>Amount</label> <input id="amount" type="text" /> <a href="#" id="sendCoins">Send coins</a> </form> <p id="notice"></p> <h4>data:</h4> <div id="data"></div> </body> </html>
Try using eth.stateAt rather than eth.storageAt in your Javascript, e.g. eth.stateAt(contract, 1001, "");
Also does this mean, AlethZero doesn't support serpent anymore?
Are you using the latest devel version? I'm running 0.6.8 build 32-1.
Error (file "main", line 1, char 0): Expected indented child block!
Error (file "main", line 1, char 0): Expected indented child block!
Error (file "main", line 1, char 0): Expected indented child block!
Error (file "main", line 1, char 0): Expected indented child block!