Skip to content

Commit

Permalink
Getter and setter for viewer URL part
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemKo7v committed Sep 15, 2016
1 parent d5168a0 commit 6901999
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion contract/Chainy.sol
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6901999

Please sign in to comment.