Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pragma solidity ^0.4.0;
- contract Child {
- uint X;
- function Child (uint a) {
- X = a;
- }
- function getChild() view public returns ( uint) {
- return (10);
- } }
- contract Constructor {
- Child public d;
- event Mined (address childAdd);
- function createChild(uint a) public {
- Child d = new Child(a);
- Mined (address (d));
- }
- }
- var childEvent = Constructor.Mined();
- childEvent.watch(function(error, result){
- if (!error) console.log('Child created');
- else console.error(error);
- });
- var childEvent = Constructor.Mined({}, {fromBlock: 2000, toBlock:'latest'});
- Constructor.Mined({}, { fromBlock: 0, toBlock: 'latest' }).get((error, eventResult) => {
- if (error)
- console.log(error);
- else
- console.log('Ok');
- });
Add Comment
Please, Sign In to add comment