Permalink
Browse files

Getter and setter for viewer URL part

  • Loading branch information...
ArtemKo7v committed Sep 15, 2016
1 parent d5168a0 commit 6901999babb7bdefa0a5344e9cf301ef2050fe99
Showing with 14 additions and 1 deletion.
  1. +14 −1 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);

0 comments on commit 6901999

Please sign in to comment.