SC CODE: Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "nfatool.html")
31 STORE("descrHdr", "revised nfa tool")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "webguy.tela")
34 STORE("docType", "TELA-HTML-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "15f6bb7960e53ff0efde23ce4e210d8cabd0fd1ab9087e5b772ef9fa59f666d9")
37 STORE("fileCheckS", "3d2e75d053ad8a710a0e69c944b1feb8057922885acb61f43c015891eefeffd")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
/*
<style>
#image {float:left;}
#image img{max-width:100%;height:auto;}
table#info{width:100%;}
table#info, table#info th, table#info td {
border: 1px solid black;
border-collapse: collapse;
}
table#info td:nth-child(2) { word-break: break-all;}
#sccode{overflow-x:auto;}
</style>
<h1>Enter your NFA SCID to load the details</h1>
<p>Note: Images are pulled in from public resources.</p>
<form id="lookup">
<input type="text" name="scid" placeholder="Enter SCID">
<button type="submit">Check NFA</button>
</form>
<div id="image"></div>
<table id="info"></table>
<div id="sccode"></div>
*/ |
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "nfatool.html")
31 STORE("descrHdr", "revised nfa tool")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "webguy.tela")
34 STORE("docType", "TELA-HTML-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "15f6bb7960e53ff0efde23ce4e210d8cabd0fd1ab9087e5b772ef9fa59f666d9")
37 STORE("fileCheckS", "3d2e75d053ad8a710a0e69c944b1feb8057922885acb61f43c015891eefeffd")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
/*
<style>
#image {float:left;}
#image img{max-width:100%;height:auto;}
table#info{width:100%;}
table#info, table#info th, table#info td {
border: 1px solid black;
border-collapse: collapse;
}
table#info td:nth-child(2) { word-break: break-all;}
#sccode{overflow-x:auto;}
</style>
<h1>Enter your NFA SCID to load the details</h1>
<p>Note: Images are pulled in from public resources.</p>
<form id="lookup">
<input type="text" name="scid" placeholder="Enter SCID">
<button type="submit">Check NFA</button>
</form>
<div id="image"></div>
<table id="info"></table>
<div id="sccode"></div>
*/'] |