Sponsored Link:   Etheal: Backed by a Finance Minister & Michael Terpin & Harvard alumnus Prof 30% bonus - First hour only: June 25
 Latest 25 txns from a total Of 1733 transactions
View All

TxHash Age From To Value [TxFee]
0x2252b516bc40c5373f73fa08a6222f780bb447db9740d6f610c3f827bc1aa0da9 hrs 23 mins ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.004116896
0x7e9586c0df85f43b216a1141dae1aba093857c92e132d3054b719e7a4cca5fba16 hrs 36 mins ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003826242
0x429f9ab984546ef761f3874988d817aadc614676069fa8ce1a9437bd2af3b10d16 hrs 38 mins ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003204936
0x7041d2191b97d458da343ee389241bbe29482900a55c7aed222ab3bc083201562 days 10 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003516548
0xd036eed1535d9bf38463cb00815a0abe181cc7e057e1f2310d786e9ea78ca1d52 days 11 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.00288953
0x06e4c3ac2ee118ac4fc917ccc7177ffc10c7ccbbb00e1366324f67e094e4b4f32 days 12 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003502268
0x5d927a08a3c062a792d231e9c283d3b22aac13274c1de7e150814de3fc7af8ec2 days 12 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003502268
0x99c0d6225501b8f91772bfe96af5a633f0be393f55d5b45a8a2fc536d67e1d882 days 20 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003807202
0x58f305a04ef73c4eacfc7f971215b7ba98f237b24aff2de6d633308cdf3201c53 days 9 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003505124
0xec2ccbccac807be978a4defeecad16d038c590101f1c2906608d446866acadf65 days 4 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.002883818
0xbcaf5c6cf4d5ee5468a5c97ae83d2933ab6d7c426ec6df85809560f2614a78f65 days 6 hrs ago0xc46a5363695da3b0cce2876c0046e68eef5d11d9  IN   Chainy.info0 Ether0.014877957
0xc4930fa1598111b1366807fbeea91d373e646a9b30db900c3de6c36879ef08d45 days 6 hrs ago0xc46a5363695da3b0cce2876c0046e68eef5d11d9  IN   Chainy.info0 Ether0.014877916
0x54494f950338a0fadc3f8ff44d05e861e4b97668411d7d95b53cca2d23b877eb5 days 11 hrs ago0xc46a5363695da3b0cce2876c0046e68eef5d11d9  IN   Chainy.info0 Ether0.014825477
0x052c3976859256a5906728e8ed84a0137b86ad8fd82e5bf71d24de1f348ca0f56 days 7 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003183992
0x21f20403c388b618032bd92c32d504940a337f9dca8d0f0fad0643ef7f9d5d566 days 8 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003819578
0xf1b5a25e204b9db0a8594ae48bcdc3c30324796536dc988533a3e0c1bc035e396 days 8 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003819578
0xf4df2e9b837fa276175602f360bf8052327ee1fdf38d7092ac7d0963cb5647db6 days 9 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003827194
0x8da044821eb379209b0a1a415a39542bcf75299634b6c55e8c4525b29c326d406 days 9 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003826242
0xf5e2900d66c67ed40f0240189587a05a64407695a770de507d5a560b03245c366 days 9 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.004134032
0x4ce2c1c4ce179080ad7fc510396d3f5154fbd39a46fe82cfb88d2b812b71500f6 days 9 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.004131176
0x094f4a155bd5ce741bc22890e85f4c6a2142cb7a661a50c6e70444a8dfbb90186 days 14 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003822434
0xb05754a1a80da7ea94f6c973e4c1ef04aecb0dfcc7f5c8ee1be2717ba99408166 days 16 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.004126416
0xd6da36c1d1967e3186f45a028bafdf57b800ed8496e1b32e4df6efb78aeb31e76 days 19 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.004138792
0xab76a4c4e921f29cb9088ef8d57b993a5a4ce0eac5de0a7e64eebe6f5a7c82b27 days 7 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.003505124
0x332a719d18b475b181eb4488ac9546354b89b89a6dd64749ea6f0ae740ad6d0f7 days 9 hrs ago0xfcd661e3ed0f5d2c4788f0f6284855872986f73b  IN   Chainy.info0 Ether0.005704384
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 1 Internal Transaction

ParentTxHash Block Age From To Value
0x9d0f227ad53ca11411e8d5160918e696fe3b8f0d23f1c31b9178e3f7bcd942b12721000568 days 16 hrs ago0xf3763c30dd6986b53402d41a8552b8f7f6a6089b0xc2be1c765d622bcfa3ab30bedb508b633ab792171 Ether
[ Download CSV Export  ] 



  Contract Source Code   Find Similiar Contracts

/**
 * Copyright 2016 Everex https://everex.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


/* String utility library */
library strUtils {
    string constant CHAINY_JSON_ID = '"id":"CHAINY"';
    uint8 constant CHAINY_JSON_MIN_LEN = 32;

    /* Converts given number to base58, limited by _maxLength symbols */
    function toBase58(uint256 _value, uint8 _maxLength) internal returns (string) {
        string memory letters = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
        bytes memory alphabet = bytes(letters);
        uint8 base = 58;
        uint8 len = 0;
        uint256 remainder = 0;
        bool needBreak = false;
        bytes memory bytesReversed = bytes(new string(_maxLength));

        for (uint8 i = 0; i < _maxLength; i++) {
            if(_value < base){
                needBreak = true;
            }
            remainder = _value % base;
            _value = uint256(_value / base);
            bytesReversed[i] = alphabet[remainder];
            len++;
            if(needBreak){
                break;
            }
        }

        // Reverse
        bytes memory result = bytes(new string(len));
        for (i = 0; i < len; i++) {
            result[i] = bytesReversed[len - i - 1];
        }
        return string(result);
    }

    /* Concatenates two strings */
    function concat(string _s1, string _s2) internal returns (string) {
        bytes memory bs1 = bytes(_s1);
        bytes memory bs2 = bytes(_s2);
        string memory s3 = new string(bs1.length + bs2.length);
        bytes memory bs3 = bytes(s3);

        uint256 j = 0;
        for (uint256 i = 0; i < bs1.length; i++) {
            bs3[j++] = bs1[i];
        }
        for (i = 0; i < bs2.length; i++) {
            bs3[j++] = bs2[i];
        }

        return string(bs3);
    }

    /* Checks if provided JSON string has valid Chainy format */
    function isValidChainyJson(string _json) internal returns (bool) {
        bytes memory json = bytes(_json);
        bytes memory id = bytes(CHAINY_JSON_ID);

        if (json.length < CHAINY_JSON_MIN_LEN) {
            return false;
        } else {
            uint len = 0;
            if (json[1] == id[0]) {
                len = 1;
                while (len < id.length && (1 + len) < json.length && json[1 + len] == id[len]) {
                    len++;
                }
                if (len == id.length) {
                    return true;
                }
            }
        }

        return false;
    }
}


// Ownership
contract owned {
    address public owner;

    function owned() {
        owner = msg.sender;
    }

    modifier onlyOwner {
        if (msg.sender != owner) throw;
        _
    }

    function transferOwnership(address newOwner) onlyOwner {
        owner = newOwner;
    }
}

contract Chainy is owned {
    // Chainy viewer url
    string CHAINY_URL;

    // Configuration
    mapping(string => uint256) private chainyConfig;

    // Service accounts
    mapping (address => bool) private srvAccount;

    // Fee receiver
    address private receiverAddress;

    struct data {uint256 timestamp; string json; address sender;}
    mapping (string => data) private chainy;

    event chainyShortLink(uint256 timestamp, string code);

    // Constructor
    function Chainy(){
        setConfig("fee", 0);
        // change the block offset to 1000000 to use contract in testnet
        setConfig("blockoffset", 2000000);
        setChainyURL("https://txn.me/");
    }

    // Sets new Chainy viewer URL
    function setChainyURL(string _url) onlyOwner {
        CHAINY_URL = _url;
    }

    // Returns current Chainy viewer URL
    function getChainyURL() constant returns(string){
        return CHAINY_URL;
    }

    // Sets configuration option
    function setConfig(string _key, uint256 _value) onlyOwner {
        chainyConfig[_key] = _value;
    }

    // Returns configuration option
    function getConfig(string _key) constant returns (uint256 _value) {
        return chainyConfig[_key];
    }

    // Add/Remove service account
    function setServiceAccount(address _address, bool _value) onlyOwner {
        srvAccount[_address] = _value;
    }

    // Set receiver address
    function setReceiverAddress(address _address) onlyOwner {
        receiverAddress = _address;
    }

    // Send all ether back to owner
    function releaseFunds() onlyOwner {
        if(!owner.send(this.balance)) throw;
    }

    // Add record
    function addChainyData(string json) {
        checkFormat(json);

        var code = generateShortLink();
        // Checks if the record exist
        if (getChainyTimestamp(code) > 0) throw;

        processFee();
        chainy[code] = data({
            timestamp: block.timestamp,
            json: json,
            sender: tx.origin
        });

        // Fire event
        var link = strUtils.concat(CHAINY_URL, code);
        chainyShortLink(block.timestamp, link);
    }

    // Get record timestamp
    function getChainyTimestamp(string code) constant returns (uint256) {
        return chainy[code].timestamp;
    }

    // Get record JSON
    function getChainyData(string code) constant returns (string) {
        return chainy[code].json;
    }

    // Get record sender
    function getChainySender(string code) constant returns (address) {
        return chainy[code].sender;
    }

    // Checks if enough fee provided
    function processFee() internal {
        var fee = getConfig("fee");
        if (srvAccount[msg.sender] || (fee == 0)) return;

        if (msg.value < fee)
            throw;
        else
            if (!receiverAddress.send(fee)) throw;
    }

    // Checks if provided string has valid format
    function checkFormat(string json) internal {
        if (!strUtils.isValidChainyJson(json)) throw;
    }

    // Generates a shortlink code for this transaction
    function generateShortLink() internal returns (string) {
        var s1 = strUtils.toBase58(block.number - getConfig("blockoffset"), 11);
        var s2 = strUtils.toBase58(uint256(tx.origin), 2);

        var s = strUtils.concat(s1, s2);
        return s;
    }

}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"code","type":"string"}],"name":"getChainyData","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"},{"name":"_value","type":"bool"}],"name":"setServiceAccount","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"getChainyURL","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_key","type":"string"},{"name":"_value","type":"uint256"}],"name":"setConfig","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"releaseFunds","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"setReceiverAddress","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"code","type":"string"}],"name":"getChainySender","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"json","type":"string"}],"name":"addChainyData","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_key","type":"string"}],"name":"getConfig","outputs":[{"name":"_value","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"code","type":"string"}],"name":"getChainyTimestamp","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_url","type":"string"}],"name":"setChainyURL","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"type":"function"},{"inputs":[],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":false,"name":"code","type":"string"}],"name":"chainyShortLink","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60008054600160a060020a0319163317815560a0604052600360609081527f6665650000000000000000000000000000000000000000000000000000000000608052610063915b600054600160a060020a0390811633919091161461010757610002565b60408051808201909152600b81527f626c6f636b6f666673657400000000000000000000000000000000000000000060208201526100a490621e8480610046565b60408051808201909152600f81527f68747470733a2f2f74786e2e6d652f000000000000000000000000000000000060208201526100f990600054600160a060020a0390811633919091161461015157610002565b611094806101e56000396000f35b80600260005083604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150509081526020016040518091039020600050819055505050565b8060016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101b657805160ff1916601e1785555b506101dc9291505b808211156101e1576000815583016101a3565b601f85559182015b8281111561019b5782518260005055916020019190600101906101be565b505050565b509056606060405236156100a35760e060020a6000350463045236b481146100a557806309d2d0b9146101b3578063233120aa146101d85780633e8f5b901461024057806369d89575146102a85780638279c7db146102c75780638da5cb5b146102e9578063919edc7c146102fb578063ac3e7d24146103a7578063b44bd51d14610476578063e8b13c441461050c578063eef8e35f146105a8578063f2fde38b1461060e575b005b61062f6004808035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437509496505050505050506020604051908101604052806000815260200150600560005082604051808280519060200190808383829060006004602084601f0104600f02600301f15090500191505090815260200160405180910390206000506001016000508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106f75780601f106106cc576101008083540402835291602001916106f7565b6100a3600435602435600054600160a060020a03908116339091161461070357610002565b61062f604080516020818101835260008252825160018054600281831615610100026000190190911604601f810184900484028301840190955284825292939092918301828280156107545780601f1061072957610100808354040283529160200191610754565b6100a36004808035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437509496505093359350505050600054600160a060020a03908116339091161461075e57610002565b6100a3600054600160a060020a0390811633909116146107a857610002565b6100a3600435600054600160a060020a0390811633909116146107db57610002565b61069d600054600160a060020a031681565b61069d6004808035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437509496505050505050506000600560005082604051808280519060200190808383829060006004602084601f0104600f02600301f150905001915050908152602001604051809103902060005060020160009054906101000a9004600160a060020a031690505b919050565b6100a36004808035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437509496505050505050506040805160208181018352600080835283519182019093529182529061089083610c82816040805160208181018352600091829052825180820184528290528251808401909352600d83527f226964223a22434841494e59220000000000000000000000000000000000000083820152835191928492909184911015610f7757610f6f565b6106ba6004808035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437509496505050505050505b6000600260005082604051808280519060200190808383829060006004602084601f0104600f02600301f15090500191505090815260200160405180910390206000505490506103a2565b6106ba6004808035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437509496505050505050505b6000600560005082604051808280519060200190808383829060006004602084601f0104600f02600301f15090500191505090815260200160405180910390206000506000016000505490506103a2565b6100a36004808035906020019082018035906020019191908080601f01602080910402602001604051908101604052809392919081815260200183838082843750949650505050505050600054600160a060020a039081163390911614610be657610002565b6100a360043560005433600160a060020a03908116911614610c6d57610002565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561068f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051600160a060020a03929092168252519081900360200190f35b60408051918252519081900360200190f35b820191906000526020600020905b8154815290600101906020018083116106da57829003601f168201915b505050505090506103a2565b600160a060020a0382166000908152600360205260409020805460ff1916821790555050565b820191906000526020600020905b81548152906001019060200180831161073757829003601f168201915b5050505050905090565b80600260005083604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150509081526020016040518091039020600050819055505050565b60405160008054600160a060020a039081169230909116319082818181858883f1935050505015156107d957610002565b565b60048054600160a060020a031916821790555b50565b90507fdad5c3eecfdb62dd69e6e72053b88029e1d6277d4bc773c00fef243982adcb7d428260405180838152602001806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561087c5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15b505050565b610904604080516020818101835260008083528351808301855281815284518084018652828152855180850187529283528551808701909652600b86527f626c6f636b6f6666736574000000000000000000000000000000000000000000938601939093529293610c8d90610e73906104c1565b9150600061091183610557565b111561091c57610002565b61095f60408051808201909152600381527f66656500000000000000000000000000000000000000000000000000000000006020820152600090610e90906104c1565b60606040519081016040528042815260200184815260200132815260200150600560005083604051808280519060200190808383829060006004602084601f0104600f02600301f1509050019150509081526020016040518091039020600050600082015181600001600050556020820151816001016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610a3957805160ff19168380011785555b50610a699291505b80821115610ae05760008155600101610a25565b82800160010185558215610a1d579182015b82811115610a1d578251826000505591602001919060010190610a4b565b505060409182015160029182018054600160a060020a0319169091179055600180548351602082841615610100026000190190921693909304601f81018290048202840182019094528383526107f19390830182828015610b0f5780601f10610ae457610100808354040283529160200191610b0f565b5090565b820191906000526020600020905b815481529060010190602001808311610af257829003601f168201915b5050505050835b60408051602081810183526000808352835180830185528190528351808301855281905283518083018552818152845192830185528183529351855187519495889588959194919391928392910190805910610b6f5750595b9080825280602002602001820160405250935083925060009150600090505b8551811015610f0157858181518110156100025790602001015160f860020a900460f860020a028383806001019450815181101561000257906020010190600160f860020a031916908160001a905350600101610b8e565b8060016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c3d57805160ff19168380011785555b5061088b929150610a25565b82800160010185558215610c31579182015b82811115610c31578251826000505591602001919060010190610c4f565b60008054600160a060020a0319168217905550565b15156107ee57610002565b9250610e7c32600160a060020a031660025b60408051602081810183526000808352835180830185528190528351808301855281905283518083018552818152845180840186528281528551606081018752603a8082527f3132333435363738396162636465666768696a6b6d6e6f707172737475767778958201959095527f797a41424344454647484a4b4c4d4e505152535455565758595a000000000000818801529551949594859493928392839283919060ff8c1690805910610d505750595b90808252806020026020018201604052509250600091505b8a60ff168260ff161015610de5578660ff168c1015610d8657600193505b875160ff8816808e049d069550889086908110156100025790602001015160f860020a900460f860020a02838360ff16815181101561000257906020010190600160f860020a031916908160001a905350600195909501948315611079575b8560ff16604051805910610df65750595b818152602091820281019091016040526000925090505b8560ff168260ff161015611085578260018388030360ff1681518110156100025790602001015160f860020a900460f860020a02818360ff16815181101561000257906020010190600160f860020a031916908160001a90535060019190910190610e0d565b4303600b610c9f565b9150610e888383610b16565b949350505050565b33600160a060020a031660009081526003602052604090205490915060ff1680610eba5750806000145b15610ec4576107ee565b80341015610ed157610002565b600454604051600160a060020a039190911690600090839082818181858883f1935050505015156107ee57610002565b5060005b8451811015610f5d57848181518110156100025790602001015160f860020a900460f860020a028383806001019450815181101561000257906020010190600160f860020a031916908160001a905350600101610f05565b5090979650505050505050565b600093505b505050919050565b6000905081600081518110156100025790602001015160f860020a900460f860020a02600160f860020a03191683600181518110156100025790602001015160f860020a900460f860020a02600160f860020a0319161415610f6a575060015b815181108015610fea5750825181600101105b801561105a5750818181518110156100025790602001015160f860020a900460f860020a02600160f860020a0319168382600101815181101561000257016020015160f860020a90819004027fff0000000000000000000000000000000000000000000000000000000000000016145b1561106757600101610fd7565b8151811415610f6a5760019350610f6f565b60019190910190610d68565b9b9a505050505050505050505056

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.