SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'/* dShout v3 */
/* - store block height of previous sc call */
/* - input length: use number of characters instead of bytes
Function Initialize() Uint64
10 STORE("height", BLOCK_HEIGHT())
20 STORE("prev", BLOCK_HEIGHT())
30 RETURN 0
End Function
Function Store(data String) Uint64
/* 189 chars = public key (66 chars) + encrypted shared keys (66 chars each) + 1 seperator (1 char) + encrypted message (at least 28 bytes/56 chars) */
10 IF STRLEN(data) < 189 THEN GOTO 130
20 DIM h as Uint64
30 DIM ph as Uint64
40 LET h = BLOCK_HEIGHT()
50 LET ph = LOAD("height")
60 IF h == ph THEN GOTO 100
70 STORE("msg",data)
80 STORE("prev", ph)
90 GOTO 110
100 STORE("msg",LOAD("msg")+"+"+data)
110 STORE("height",h)
120 RETURN 0
130 RETURN 1
End Function
'] |