I understand that contracts execute when a transaction is sent to them. Can contracts be executed automatically (like a cron job) without a third party action?
Can a contract call a URL/API and retrieve variables?
Can a contract send bitcoin or other crypto?
Thanks in advance.
0 ·
Comments
2) No, and won't, ever. Contracts are deterministic and access to URLs is random (I could be behind the great firewall of China for example). The dapp itself (ie, the HTML or QML interface), has full network access on the other hand.
3) Contracts can send/receive ether, and through schellingcoins abstractions, or having metacoins pegged to the value of some token, or listening to another contract which is fed information from a separate chain, transfer other types of crypto. We're doing quite a bit of work on this type of thing at the moment.
The first is rather simple, the contract expects certain calls from a certain address (for security). These calls are made using a centralized app, maybe an agent of some sort such as a python script on a schedule, 'feeding' outside world information to the contract.
The second one would be for one contract to call another. The second contract holds data fed to it by an agent similar to what I described above. It could be the only function of that contract to hold certified 3rd party data, for example, a data feed from Bloomberg.
I'm particularly interested in how people can create DAO services in non-ether prices. Once ether valuation becomes subject to market volatility, it's going to be pretty tough to price your service in ether. Bitcoin solves this by third parties like coinbase quoting the price in BTC at the point of sale.
It looks like an "Exchange Rate DAO" can be created that is fed a feed that prices ether in local currencies. Other DOAs simply refer to this DAO for the current exchange rate. My only concern is that this seems to break the chain of trustlessness.
https://blog.ethereum.org/2014/03/28/schellingcoin-a-minimal-trust-universal-data-feed/
If a contract will receive transactions regularly it can perform "tickle" code before responding to the actual content of each message, like :tell() handlers in LambdaMOO or poor man's cron for web apps. But a cron contract looks like the most robust solution at the moment.
Yeah, contracts could just run their 'time progression' to get to the current time, and then handle the input. In many cases this is not particularly hard, hard to foresee if there arent cases where this is difficult, though. All in all i am weakly against ALARM.
Let's I have a business with several partners and I want to have a way to distribute profits from storage depending on daily profit figures.
Since this is the profit of my company, I will be the one supplying the data. Is there a way establish a contract to say: only accept the data feed if the data has been signed by all 3 of the partners.
Might even be the size of a single signature, but so far how to implement aggegrate signatures elude me..(as do too many things..)
Of course, in some cases the contract might be able to figure out the profit itself. Could be that this is only the better way to do it for particular businesses though.