Ive been using the python compiler to create ES. After this is created and you have the opcodes, is it just a case of pasting it in the data textfield in the client? Are there any tutorials on this? I cant seem to get it to work
With the latest 'develop' version of the AlethZero client:
1) Write a minimal contract in CLL, for example this one: contract.storage[tx.sender] = tx.value
(This stores the value that was sent to the contract into the contract storage at the location of the sender's address)
2) Compile it with http://multisig.info:3000/ or the `compiler` project, result: TXVALUE TXSENDER SSTORE
3) Now create the contract in AlethZero: - Leave "To" empty to create a contract - Specify a high enough fee (current basefee is 100 szabo), lets do 1000 finney to be safe - paste the above instructions in the left most DATA field - Click on Send
4) The transaction will appear in the pending list, wait for it to be mined.
5) Now look at the mined block, select it to inspect its contents:
6) Your new contract now lives on the location indicated with `Creates`: f693eec2dbbe897089e113769c3298aae5eaad7d
7) You can inspect the contract state in the contract list: "1000 finney [0 @ f693eec2.."
8) Send a transaction to the contract: To: f693eec2dbbe897089e113769c3298aae5eaad7d Amount: high enough for the execution + storage fee, lets do 100 finney Data: empty Hit Send
9) Wait for the transaction to be mined
10) Inspect the contract stage again, you'll see that the storage was modified:
I performed the steps 1 thru 4, but I could not figure out how to inspect the mined block - WHAT I'M MISSING. In alethzero, I could not perform this "inspection" - WHAT R THE STEPS?
@mids106? - also I noticed today's version of the gui (altehzero) has a few additional sections - the one labeled contract - will that allow inspection?
Found this thread when wondering how to enter contracts to the network. Things seem to have changed since Feb.
It seems that in POC4 you can enter LLL code into the contract's data field. In POC5 (develop branch) you can enter code by prefixing it with 'code:', e.g.: code: 0x6005600054 where the value is the code compiled by the Serpent compiler. See http://blog.ethereum.org/2014/04/10/pyethereum-and-serpent-programming-guide-2/
Comments
1) Write a minimal contract in CLL, for example this one:
contract.storage[tx.sender] = tx.value
(This stores the value that was sent to the contract into the contract storage at the location of the sender's address)
2) Compile it with http://multisig.info:3000/ or the `compiler` project, result:
TXVALUE TXSENDER SSTORE
3) Now create the contract in AlethZero:
- Leave "To" empty to create a contract
- Specify a high enough fee (current basefee is 100 szabo), lets do 1000 finney to be safe
- paste the above instructions in the left most DATA field
- Click on Send
4) The transaction will appear in the pending list, wait for it to be mined.
5) Now look at the mined block, select it to inspect its contents:
917df7b8c5c7cd9ef2375854f693eec2dbbe897089e113769c3298aae5eaad7d
0504c6520789c5afeab11944f33aa103926ce2b6cadaf5c874744c84f15e82ab[0]
From: 672c8e16f2695baf62487d2144e94ab8800259a5
Creates: f693eec2dbbe897089e113769c3298aae5eaad7d
Value: 1000 finney #9
Data: TXVALUE TXSENDER SSTORE
6) Your new contract now lives on the location indicated with `Creates`:
f693eec2dbbe897089e113769c3298aae5eaad7d
7) You can inspect the contract state in the contract list:
"1000 finney [0 @ f693eec2.."
8) Send a transaction to the contract:
To: f693eec2dbbe897089e113769c3298aae5eaad7d
Amount: high enough for the execution + storage fee, lets do 100 finney
Data: empty
Hit Send
9) Wait for the transaction to be mined
10) Inspect the contract stage again, you'll see that the storage was modified:
@0x0 TXVALUE TXSENDER SSTORE STOP ...
@0x672C8E16F2695BAF62487D2144E94AB8800259A5 0x16345785D8A0000
0x16345785D8A0000 == 100 * 10^15 == 100 finney!
5) Now look at the mined block, select it to inspect its contents:
917df7b8c5c7cd9ef2375854f693eec2dbbe897089e113769c3298aae5eaad7d
0504c6520789c5afeab11944f33aa103926ce2b6cadaf5c874744c84f15e82ab[0]
From: 672c8e16f2695baf62487d2144e94ab8800259a5
Creates: f693eec2dbbe897089e113769c3298aae5eaad7d
Value: 1000 finney #9
Data: TXVALUE TXSENDER SSTORE
I performed the steps 1 thru 4, but I could not figure out how to inspect the mined block - WHAT I'M MISSING. In alethzero, I could not perform this "inspection" - WHAT R THE STEPS?
Thanks
comtechnet
7) You can inspect the contract state in the contract list:
"1000 finney [0 @ f693eec2.."
Likewise - WHERE DO I ACTUALLY PERFORM THIS INSPECTION?
10) Inspect the contract stage again, you'll see that the storage was modified:
@0x0 TXVALUE TXSENDER SSTORE STOP ...
@0x672C8E16F2695BAF62487D2144E94AB8800259A5 0x16345785D8A0000
0x16345785D8A0000 == 100 * 10^15 == 100 finney!
WHERE DO I PERFORM THIS INSPECTION - pls clarify
Thanks
comtechnet
I did see the posting regarding the Eth BC browser ...
http://www.etherchain.org
That might help?
It seems that in POC4 you can enter LLL code into the contract's data field. In POC5 (develop branch) you can enter code by prefixing it with 'code:', e.g.:
code: 0x6005600054
where the value is the code compiled by the Serpent compiler. See http://blog.ethereum.org/2014/04/10/pyethereum-and-serpent-programming-guide-2/