Solc ethereum exchange rate
Alternatively, you could let them pull it from a contract granted that contract queries their balance of tokens but that seems like there might be problems. KenoLeon Convert fiat into Ether, give an option to ether withdraw Ether or get more tokens i.
Look at what mcdee does with dividends. Is there any other way I can install Solc on Ubuntu Trusty? You'll need wget installed, but that should be the only dependency.
Could change te curl if you wanted. It's on the list of articles for me to write to explain the rationale. Talking of which I wrote another article on ERC a couple of days ago: Right, so that's just how the tool that printed it represents an unknown opcode. Hi all - any recommendation of a good tutorial on getting started on Solidity? I found the ones on Ethereum. Do I understand it correctly that a will be left justified and b will be right justified on load? Dividends in the form of token itself, serve no purpose unless there is re-distribution of balances, which would happen if token owners pay out of their accounts.
If a dividend is in the form of ether or perhaps other tokens, it certainly would serve a purpose. Basically, if the tokens paid as part of the dividend have to come from somewhere. Dividends in Ether make more sense; I keep meaning to write a token contract that carries out efficient Ether dividends it's very much a variation on a theme of the current dividend functions but busy elsewhere.
I have implemented Ether dividends, similar to your dividend scheme. I am not claiming any exceptional efficiency but it aggregates Ether payments over an array of dividends before making a single payment. Dividends in the form of other tokens have proven to be more cumbersome because Solidity lacks in-memory maps to aggregate balances. Yes, although the idea of one token paying dividends in another is anathema to pretty much everyone unless the same company controls both tokens, of course.
I have implemented all three modes already. Because most token owners I've spoken to look at their tokens as competitive with other tokens all evidence to the contrary.
Although I do appear to have just managed to break bash with an accidental cut'n'paste. First time ever I've done that.
We can use the web3 API to call methods i. For more details about the difference between transactions and calls, see the Contracts and Transactions documentation.
Basically here is how to sell some energy via a transaction and then retrieve your balance via a call:. Since the contract is deployed on the blockchain, you can also use it from the Raspberry Pi: You can now interact with the contract using the apollotrade object from the Raspberry Pi geth console, in the same way as shown above, e. Note that it takes a while for a transaction to be executed, e. This is definitely a significant aspect of the blockchain platform: This will certainly impact the UI layer, which is what I will be working on in the next iteration.
First, a few words about what I would like to achieve based on the scenario I described before… Design of the Smart Contract Here are a few bullet points about what I would like to achieve with the Smart Contract. The energy producer will issue transactions sales for each kWh produced. This will allocate him a reward based on the current kWh rate. The rate should vary with the amount of total energy produced, i. The contract should calculate the rate.
An energy consumer can also purchase some kWh at the current rate. The rate should vary with the amount of energy purchased, i. You can now interact with it using red buttons. For example, enter a value in the setEnergy field and press the corresponding button. Then click the getCoinAccount button to check that you were credited with some coins.
Now that we have our code running in the compiler, we want to deploy it to our private blockchain! You can check out my previous article to find out which setup I am using.
In the spirit of learning, I am again going to do this using just the basic tools, i. After a little while the contract needs to be mined you should see something like this:. The address of the contract will be useful later, when you want to call it from another node.