From 6901999babb7bdefa0a5344e9cf301ef2050fe99 Mon Sep 17 00:00:00 2001 From: ArtemKo7v Date: Thu, 15 Sep 2016 11:29:56 +0700 Subject: [PATCH] Getter and setter for viewer URL part --- contract/Chainy.sol | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/contract/Chainy.sol b/contract/Chainy.sol index b66b0a5..20bad23 100644 --- a/contract/Chainy.sol +++ b/contract/Chainy.sol @@ -113,7 +113,8 @@ contract owned { } contract Chainy is owned { - string constant CHAINY_URL = "https://txn.me/"; + // Chainy viewer url + string CHAINY_URL; // Configuration mapping(string => uint256) private chainyConfig; @@ -134,6 +135,17 @@ contract Chainy is owned { 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 @@ -212,6 +224,7 @@ contract Chainy is owned { 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);