2% edge example above should say 196 / 100 but you get the idea.
I'm aiming to make this generally available concurrent with POC-4. In the meantime, if you asked for an invite and didn't get one, please remind me and I'll send you the temporary link.
Intervals are tricky. Ethereum contract code only runs when called (you send it a transaction or some other contract does). So you have to poke it to make it do something.
But a simple way for the owner to draw down the contract balance would be to put in a check "when tx.sender = [your address] send 10ether to [your address]". (You can make that with just a few blocks. You could get fancier.)
Contracts that call other contracts, (contracts and subcontracts), imho, are the next big step for those developing contracts for Ethereum. A subcontract, in my mind, is very much like a function in a program, and the primary contract that calls contracts is "main".
JasperEindhoven, the NetherlandsMemberPosts: 514✭✭✭
@ethergrokJust on cll-sim, but did it with transaction exchanging for instance it could be used for trustlessly selling subcurrency, if the subcurrency script doesnt support it.(its just an example now, but silly for them not to support it, unless if it is not intended to be transferable at all) Users can also use across two instances of ethereum blockchains.
Another idea is to make a 'egalitarianizer'. Basically instead of using a non-egalitarian contract(C) directly, you send messages to the egalitarianizer(E), the E then uses contracts for each person(PC) passing on the commands. The point is that when the contract sends coin to PC, it is send through to E but E doesnt send it straight to P, instead it sends for instance the total income of E divided by the number of persons using it.(instead of P↔C we have P↔E↔PC↔C, where PC is there because C probably identifies by-adress.) Of course that is the extreme case. You could also give people by 'weight', using for instance dw/dt = a√I + k(C - w) there, for constant I after t>>1/k, w=a√I/k+C, the parameter k makes sure the income doesnt change too quickly. (Note that the income is not proportional to w, its by w/∑w with the sum over all people) The square root damps income disparity, you could use any function instead.(or linear, and let the constant deal with it.Sorry i
With contracts as 'closures' you can use contracts as parts of other contracts. Instead of a contract having a fixed set of options, it has a sort of protocol, and users of contracts can accept a closure, and for which the return value of another particular contract to be used to create behavior.
A lot of this depends on how expensive calling and creating contracts is. I think it should be cheaper to call from a contract than to make a Tx that goes into a block. I think that is where this is heading, really i should read more. Havent gotten round to Gavin Woods paper yet.
Uhm.. sorry from derailing from the topic. mode80 made a neat bit of software.
@Jasper, we need to start a new thread for this issue of contract ETH CLL/LLL/SLL best practices (BP). I see some major simplicity and missteps during this early stage of contract development. mode80's etherscripter would be a good/great repository of BP: these ideas and the code blocks in each appropriate language, but we need to point out the obvious ones so that it becomes rote for everyone eventually.
@mode80, I'm tearing through this code and the B***** creator mechanisms, but I am missing some basics so I'll PM later.
JasperEindhoven, the NetherlandsMemberPosts: 514✭✭✭
edited April 2014
@FreddyFender?, well it is pretty clear they're examples now Also, i'd rather code in ascii, i dont like using the mouse for that stuff. As cool as it is, the difference between this application and coding is pretty thin, the difference is that the application forces you to think of the objects as ... objects. (the gui approach is never going to be faster if tab completion is available)
The term 'Best Practices' seems more arrogant than it should be. Should just be advice and checklists of ways to look at the code and tests to put it through. (edit: being a pita in mentioning that..)
I'm a keyboard guy myself. EtherScripter is meant to be easier not faster. If it bridges users to a comfort level that they can bust out contracts in vim, that'd be great.
I've sent out links to the updated beta of EtherScripter.
This version lets you build smart contracts with an expanded set of blocks and generates LLL that you can paste into the POC-4 Ethereum client.
I'm interested your feedback. Is EtherScripter useful to you are? Are you building smart contracts with it? What would make it better? And of course, what's broken that I need to fix?
It looks very useful; here are a few comments and questions * The 'About' button doesn't work at the top of the page. * Do you plan to allow people to save contracts? * In the name registrar; it seems like the reverse hash (name to address) could be taken care of easily off the blockchain. Why are you putting both there? * Did you come up with the shapes yourself, or is there some standard form? A completely minor thing is why the notches on some of the blocks do not fit together; in the attached figure I'm wondering why the green block doesn't have a notch that the purple block fits into? This is very minor; so there's no need to change it if you just haven't fixed all the visual things; I'm just curious * I'm curious about the 'once' part of the data-feed contract. Is the 'once' thing something that is there in LLL or in Lisp?
The About link should work. If not, please send me your browser & OS details and I'll look into it.
Yes, "save" is high on the ToDo list. In the meantime it saves (just) your last work between sessions. You can also copy-paste the XML and stash it in a text file if you're going back and forth between contracts.
The items currently under the sample menu are from Gavin's LLL samples at: https://github.com/ethereum/cpp-ethereum/wiki/LLL-Examples-for-PoC-4 . (I'm using them as tests to make sure the EtherScripter's generated LLL compiles to the same EVM as those samples.) I think Gav intended them as quick illustrations.
A bottom puzzle tab indicates you can insert a block there. (Some blocks like [stop] don't have those naturally.)
The block you mention with the 'once do' piece actually corresponds to a for-loop, and that piece is the loop initializer. (You can see the LLL it compiles to when you click the 'Show LLL' button.) I would have used a while-loop there myself, but these aim to be an exact match to the model contracts.
I'm going to add new samples that might be better for learning basics.
Comments
Of course you can do the same thing by dividing by 2.
I'm aiming to make this generally available concurrent with POC-4. In the meantime, if you asked for an invite and didn't get one, please remind me and I'll send you the temporary link.
But a simple way for the owner to draw down the contract balance would be to put in a check "when tx.sender = [your address] send 10ether to [your address]". (You can make that with just a few blocks. You could get fancier.)
Another idea is to make a 'egalitarianizer'. Basically instead of using a non-egalitarian contract(C) directly, you send messages to the egalitarianizer(E), the E then uses contracts for each person(PC) passing on the commands. The point is that when the contract sends coin to PC, it is send through to E but E doesnt send it straight to P, instead it sends for instance the total income of E divided by the number of persons using it.(instead of P↔C we have P↔E↔PC↔C, where PC is there because C probably identifies by-adress.) Of course that is the extreme case. You could also give people by 'weight', using for instance dw/dt = a√I + k(C - w) there, for constant I after t>>1/k, w=a√I/k+C, the parameter k makes sure the income doesnt change too quickly. (Note that the income is not proportional to w, its by w/∑w with the sum over all people) The square root damps income disparity, you could use any function instead.(or linear, and let the constant deal with it.Sorry i
With contracts as 'closures' you can use contracts as parts of other contracts. Instead of a contract having a fixed set of options, it has a sort of protocol, and users of contracts can accept a closure, and for which the return value of another particular contract to be used to create behavior.
A lot of this depends on how expensive calling and creating contracts is. I think it should be cheaper to call from a contract than to make a Tx that goes into a block. I think that is where this is heading, really i should read more. Havent gotten round to Gavin Woods paper yet.
Uhm.. sorry from derailing from the topic. mode80 made a neat bit of software.
@mode80, I'm tearing through this code and the B***** creator mechanisms, but I am missing some basics so I'll PM later.
The term 'Best Practices' seems more arrogant than it should be. Should just be advice and checklists of ways to look at the code and tests to put it through. (edit: being a pita in mentioning that..)
This version lets you build smart contracts with an expanded set of blocks and generates LLL that you can paste into the POC-4 Ethereum client.
I'm interested your feedback. Is EtherScripter useful to you are? Are you building smart contracts with it? What would make it better? And of course, what's broken that I need to fix?
Thanks
* The 'About' button doesn't work at the top of the page.
* Do you plan to allow people to save contracts?
* In the name registrar; it seems like the reverse hash (name to address) could be taken care of easily off the blockchain. Why are you putting both there?
* Did you come up with the shapes yourself, or is there some standard form? A completely minor thing is why the notches on some of the blocks do not fit together; in the attached figure I'm wondering why the green block doesn't have a notch that the purple block fits into? This is very minor; so there's no need to change it if you just haven't fixed all the visual things; I'm just curious
* I'm curious about the 'once' part of the data-feed contract. Is the 'once' thing something that is there in LLL or in Lisp?
Yes, "save" is high on the ToDo list. In the meantime it saves (just) your last work between sessions. You can also copy-paste the XML and stash it in a text file if you're going back and forth between contracts.
The items currently under the sample menu are from Gavin's LLL samples at: https://github.com/ethereum/cpp-ethereum/wiki/LLL-Examples-for-PoC-4 . (I'm using them as tests to make sure the EtherScripter's generated LLL compiles to the same EVM as those samples.) I think Gav intended them as quick illustrations.
A bottom puzzle tab indicates you can insert a block there. (Some blocks like [stop] don't have those naturally.)
The block you mention with the 'once do' piece actually corresponds to a for-loop, and that piece is the loop initializer. (You can see the LLL it compiles to when you click the 'Show LLL' button.) I would have used a while-loop there myself, but these aim to be an exact match to the model contracts.
I'm going to add new samples that might be better for learning basics.