Contract Overview
Balance: 0 Ether
Transactions: 5 txns
 Latest 5 txns

TxHash Age From To Value [TxFee]
0x171f70ea22b3dd0aa3a99a3528fdbc2c90e38415901a80486186e11efefd8ad98 days 15 hrs ago0x195a07037e97cd576ce320bc7fbfbb41d8898b01  IN   0x05f74bc7ab28c6e19c74483164c036a661c0c76c0 Ether0.000602153
0x2c9948c751972405db8e484c00962663dfb08963626784d3c1bee0b29356f31f8 days 15 hrs ago0x195a07037e97cd576ce320bc7fbfbb41d8898b01  IN   0x05f74bc7ab28c6e19c74483164c036a661c0c76c0 Ether0.000602153
0x32185806b9819aaefd0aa8081533c1bb84652ebd573e743ee47cc2d3cf65f8aa8 days 15 hrs ago0x195a07037e97cd576ce320bc7fbfbb41d8898b01  IN   0x05f74bc7ab28c6e19c74483164c036a661c0c76c0 Ether0.000617153
0x8003b664a671785c23097f18e2214d064dfbff9f119026b14f9316e089dc9e5c8 days 16 hrs ago0x31efd75bc0b5fbafc6015bd50590f4fdab6a3f22  IN   0x05f74bc7ab28c6e19c74483164c036a661c0c76c0 Ether0.000028502
0x7b46e5d5576d480860980fdd1419e7ffca67b8fef3904c0fe5bc709e7472ffac10 days 10 hrs ago0x31efd75bc0b5fbafc6015bd50590f4fdab6a3f22  IN    Contract Creation0 Ether0.000986881
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 9 Internal Transactions

ParentTxHash Block Age From To Value
0x171f70ea22b3dd0aa3a99a3528fdbc2c90e38415901a80486186e11efefd8ad9635938 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c0x4e10a95f0bb2fec6ec1c4296a16420a018a5f9fe0 Ether
0x171f70ea22b3dd0aa3a99a3528fdbc2c90e38415901a80486186e11efefd8ad9635938 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c0x4e10a95f0bb2fec6ec1c4296a16420a018a5f9fe0 Ether
0x171f70ea22b3dd0aa3a99a3528fdbc2c90e38415901a80486186e11efefd8ad9635938 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c  Contract Creation0 Ether
0x2c9948c751972405db8e484c00962663dfb08963626784d3c1bee0b29356f31f635138 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c0x2d6a9044a88e8b6e175f31b71117dbb344c5892c0 Ether
0x2c9948c751972405db8e484c00962663dfb08963626784d3c1bee0b29356f31f635138 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c0x2d6a9044a88e8b6e175f31b71117dbb344c5892c0 Ether
0x2c9948c751972405db8e484c00962663dfb08963626784d3c1bee0b29356f31f635138 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c  Contract Creation0 Ether
0x32185806b9819aaefd0aa8081533c1bb84652ebd573e743ee47cc2d3cf65f8aa634508 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c0x8e730df7c70d33118d9e5f79ab81aed0be6f66350 Ether
0x32185806b9819aaefd0aa8081533c1bb84652ebd573e743ee47cc2d3cf65f8aa634508 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c0x8e730df7c70d33118d9e5f79ab81aed0be6f66350 Ether
0x32185806b9819aaefd0aa8081533c1bb84652ebd573e743ee47cc2d3cf65f8aa634508 days 15 hrs ago0x05f74bc7ab28c6e19c74483164c036a661c0c76c  Contract Creation0 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact Match)
Contract Name: LighthouseFactory
Compiler Version: v0.4.25+commit.59dbf8f1
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.24;

// Searcher is an interface for contracts that want to be notified of incoming data
//
contract Searcher {

    // poke is called when new data arrives
    //
    function poke() public;

    // this is called to ensure that only valid Searchers can be added to the Lighthouse - returns an arbitrarily chosen number
    //
    function identify() external pure returns(uint) {
        return 0xda4b055; 
    }
}

// for operation of this contract see the readme file.
//
contract Lighthouse {
    
    address public owner = msg.sender; 
    address public auth = msg.sender; // ownable model. No real value in making it transferrable.

    Searcher seeker;                  // a single contract that can be notified of data changes

    uint value;                       // holds all the data bit fiddled into a single 32 byte word.

    uint maxAge;                      // if non zero, sets a limit to data validity

    // admin functions
    
    modifier onlyOwner  {
        require(owner == msg.sender, "Unauthorised access");
        _;
    }
    
    modifier onlyAuth {
        require(auth == msg.sender, "Unauthorised access");
        _;
    }

    function changeAuth(address newAuth) public onlyOwner {
        auth = newAuth;
    }
    
    function changeOwner(address newOwner) public onlyOwner {
        owner = newOwner;
    }


    function changeSearcher(Searcher newSeeker) public onlyOwner {
        seeker = newSeeker;
        require(seeker.identify() == 0xda4b055,"invalid searcher");
    }

    function setMaxAge(uint newMaxAge) public onlyOwner {
        maxAge = newMaxAge;
    }
    
    function notTooLongSinceUpdated() public view returns (bool) {
        uint since = now - ((value >> 128) & 
        0x000000000000000000000000000000000000000000000000ffffffffffffffff);
        return (since < maxAge) || (maxAge == 0);
    }
    
    function peekData() external view returns (uint128 v,bool b) {
        v = uint128(value);
        b = notTooLongSinceUpdated() && value != 0;
        return;
    }
    
    function peekUpdated()  external view returns (uint32 v,bool b) {
        uint v2 = value >> 128;
        v = uint32(v2);
        b = notTooLongSinceUpdated() && value != 0;
        return;
    }
    
    function peekLastNonce() external view returns (uint32 v,bool b) {
        uint v2 = value >> 192;
        v = uint32(v2);
        b = notTooLongSinceUpdated() && value != 0;
        return;
    }

    function peek() external view returns (bytes32 v ,bool ok) {
        v = bytes32(value & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
        ok = notTooLongSinceUpdated() && value != 0;
        return;
    }
    
    function read() external view returns (bytes32 x) {
        require(notTooLongSinceUpdated() && value != 0, "Invalid data stored");
        return bytes32(value & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
    }
    
    function write(uint  DataValue, uint nonce) external onlyAuth {
        require ((DataValue >> 128) == 0, "Value too large");
        require ((nonce >> 32) == 0, "Nonce too large");
        value = DataValue + (nonce << 192) + (now << 128) ;
        if (address(seeker) != address(0)) {
            seeker.poke();
        }
    }
}

contract LighthouseFactory {
    
    address public auth = msg.sender; // ownable model.

    Lighthouse[] public lighthouses;
    
    event newLighthouse(address newLighthouse, uint housePosition);
    
    modifier onlyAuth {
        require(auth == msg.sender, "Unauthorised access");
        _;
    }

    function changeAuth(address newAuth) public onlyAuth {
        auth = newAuth;
    }
    
    function makeLighthouse() public onlyAuth {
        Lighthouse newLight = new Lighthouse();
        newLight.changeAuth(auth);
        newLight.changeOwner(auth);
        uint pos = lighthouses.push(newLight);
        emit newLighthouse(address(newLight),pos);
    }
    
    function numberOfLighthouses() public view returns (uint) {
        return lighthouses.length;
    }

}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"newAuth","type":"address"}],"name":"changeAuth","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"numberOfLighthouses","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"lighthouses","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"makeLighthouse","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"auth","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newLighthouse","type":"address"},{"indexed":false,"name":"housePosition","type":"uint256"}],"name":"newLighthouse","type":"event"}]

  Contract Creation Code Switch To Opcodes View
608060405260008054600160a060020a0319163317905534801561002257600080fd5b50610dc6806100326000396000f30060806040526004361061006c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166322969eac8114610071578063488ebb291461009457806399a06549146100bb578063dd7e88e7146100ef578063de9375f214610104575b600080fd5b34801561007d57600080fd5b50610092600160a060020a0360043516610119565b005b3480156100a057600080fd5b506100a96101c1565b60408051918252519081900360200190f35b3480156100c757600080fd5b506100d36004356101c7565b60408051600160a060020a039092168252519081900360200190f35b3480156100fb57600080fd5b506100926101ef565b34801561011057600080fd5b506100d3610427565b600054600160a060020a0316331461019257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e617574686f72697365642061636365737300000000000000000000000000604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015490565b60018054829081106101d557fe5b600091825260209091200154600160a060020a0316905081565b600080548190600160a060020a0316331461026b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e617574686f72697365642061636365737300000000000000000000000000604482015290519081900360640190fd5b610273610436565b604051809103906000f08015801561028f573d6000803e3d6000fd5b5060008054604080517f22969eac000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201529051939550908516926322969eac9260248084019391929182900301818387803b1580156102f857600080fd5b505af115801561030c573d6000803e3d6000fd5b505060008054604080517fa6f9dae1000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201529051918716945063a6f9dae19350602480820193929182900301818387803b15801561037457600080fd5b505af1158015610388573d6000803e3d6000fd5b5050600180548082018083556000929092527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038716908117909155604080519182526020820183905280519295507f035beaf06f9aaeac59c9d5cb26b559a872fc1c2f3c67c5792d13b35bbfa85856945090829003019150a15050565b600054600160a060020a031681565b6040516109548061044783390190560060806040526000805433600160a060020a0319918216811790925560018054909116909117905534801561003257600080fd5b50610912806100426000396000f3006080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166322969eac81146100c9578063420b81f6146100ec57806357de26a41461012d57806359e02dd7146101545780635ae28fc9146101825780638da5cb5b1461019a5780639c0e3f7a146101cb578063a6f9dae1146101e6578063bdf384a814610207578063becfbf691461023c578063d6e848ac14610251578063de9375f214610272578063e2f9063214610287575b600080fd5b3480156100d557600080fd5b506100ea600160a060020a03600435166102b0565b005b3480156100f857600080fd5b5061010161032f565b604080516fffffffffffffffffffffffffffffffff909316835290151560208301528051918290030190f35b34801561013957600080fd5b5061014261034f565b60408051918252519081900360200190f35b34801561016057600080fd5b506101696103d5565b6040805192835290151560208301528051918290030190f35b34801561018e57600080fd5b506100ea6004356103f4565b3480156101a657600080fd5b506101af610449565b60408051600160a060020a039092168252519081900360200190f35b3480156101d757600080fd5b506100ea600435602435610458565b3480156101f257600080fd5b506100ea600160a060020a036004351661063e565b34801561021357600080fd5b5061021c6106bd565b6040805163ffffffff909316835290151560208301528051918290030190f35b34801561024857600080fd5b5061021c6106f3565b34801561025d57600080fd5b506100ea600160a060020a036004351661071d565b34801561027e57600080fd5b506101af61087a565b34801561029357600080fd5b5061029c610889565b604080519115158252519081900360200190f35b600054600160a060020a03163314610300576040805160e560020a62461bcd02815260206004820152601360248201526000805160206108c7833981519152604482015290519081900360640190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600061033c610889565b8015610349575060035415155b90509091565b6000610359610889565b8015610366575060035415155b15156103bc576040805160e560020a62461bcd02815260206004820152601360248201527f496e76616c696420646174612073746f72656400000000000000000000000000604482015290519081900360640190fd5b506003546fffffffffffffffffffffffffffffffff1690565b6003546fffffffffffffffffffffffffffffffff16600061033c610889565b600054600160a060020a03163314610444576040805160e560020a62461bcd02815260206004820152601360248201526000805160206108c7833981519152604482015290519081900360640190fd5b600455565b600054600160a060020a031681565b600154600160a060020a031633146104a8576040805160e560020a62461bcd02815260206004820152601360248201526000805160206108c7833981519152604482015290519081900360640190fd5b700100000000000000000000000000000000820415610511576040805160e560020a62461bcd02815260206004820152600f60248201527f56616c756520746f6f206c617267650000000000000000000000000000000000604482015290519081900360640190fd5b64010000000081041561056e576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f6e636520746f6f206c617267650000000000000000000000000000000000604482015290519081900360640190fd5b780100000000000000000000000000000000000000000000000081028201700100000000000000000000000000000000420201600355600254600160a060020a03161561063a57600260009054906101000a9004600160a060020a0316600160a060020a031663181783586040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15801561062157600080fd5b505af1158015610635573d6000803e3d6000fd5b505050505b5050565b600054600160a060020a0316331461068e576040805160e560020a62461bcd02815260206004820152601360248201526000805160206108c7833981519152604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60035470010000000000000000000000000000000090046000816106df610889565b80156106ec575060035415155b9150509091565b600354780100000000000000000000000000000000000000000000000090046000816106df610889565b600054600160a060020a0316331461076d576040805160e560020a62461bcd02815260206004820152601360248201526000805160206108c7833981519152604482015290519081900360640190fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055604080517feeb728660000000000000000000000000000000000000000000000000000000081529051929091169163eeb72866916004808201926020929091908290030181600087803b1580156107f157600080fd5b505af1158015610805573d6000803e3d6000fd5b505050506040513d602081101561081b57600080fd5b5051630da4b05514610877576040805160e560020a62461bcd02815260206004820152601060248201527f696e76616c696420736561726368657200000000000000000000000000000000604482015290519081900360640190fd5b50565b600154600160a060020a031681565b600354600454600091700100000000000000000000000000000000900467ffffffffffffffff164203908110806108c05750600454155b915050905600556e617574686f72697365642061636365737300000000000000000000000000a165627a7a723058202b9a5a7f79aaf35e5d575bd96d33197c4dc2c32460de1d5b79dbebb2f1363d300029a165627a7a72305820e52130a6bbde8d27a7800c38531fd44ac362b89a8cf18230acc141c39aa1bc4f0029

   Swarm Source:
bzzr://e52130a6bbde8d27a7800c38531fd44ac362b89a8cf18230acc141c39aa1bc4f

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward