mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Javascript code mixes with Solidity code, not good
This commit is contained in:
parent
4d48785089
commit
484e1325ef
@ -403,8 +403,12 @@ event LogSent(address indexed from, address indexed to, uint amount); // note ca
|
|||||||
// Call
|
// Call
|
||||||
LogSent(from, to, amount);
|
LogSent(from, to, amount);
|
||||||
|
|
||||||
// For an external party (a contract or external entity), to watch using
|
/**
|
||||||
// the Web3 Javascript library:
|
|
||||||
|
For an external party (a contract or external entity), to watch using
|
||||||
|
the Web3 Javascript library:
|
||||||
|
|
||||||
|
// The following is Javascript code, not Solidity code
|
||||||
Coin.LogSent().watch({}, '', function(error, result) {
|
Coin.LogSent().watch({}, '', function(error, result) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
console.log("Coin transfer: " + result.args.amount +
|
console.log("Coin transfer: " + result.args.amount +
|
||||||
@ -415,6 +419,8 @@ Coin.LogSent().watch({}, '', function(error, result) {
|
|||||||
"Receiver: " + Coin.balances.call(result.args.to));
|
"Receiver: " + Coin.balances.call(result.args.to));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
**/
|
||||||
|
|
||||||
// Common paradigm for one contract to depend on another (e.g., a
|
// Common paradigm for one contract to depend on another (e.g., a
|
||||||
// contract that depends on current exchange rate provided by another)
|
// contract that depends on current exchange rate provided by another)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user