SC CODE: //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
// ______ |
// .-" "-. |
// / \ |
// _ | | _ |
// ( \ |, .-. .-. ,| / ) |
// > "=._ | )(__/ \__)( | _.=" < |
// (_/"=._"=._ |/ /\ \| _.="_.="\_) |
// "=._"(_ ^^ _)"_.=" |
// "=\__|IIIIII|__/=" |
// _.="| \IIIIII/ |"=._ |
// _ _.="_.="\ /"=._"=._ _ |
// ( \_.="_.=" `--------` "=._"=._/ ) |
// > _.=" "=._ < |
// (_/ MARKET \_) |
// |
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
Function TransferOwnership(newowner String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("tmpowner",ADDRESS_RAW(newowner))
40 RETURN 0
End Function
Function ClaimOwnership() Uint64
10 IF LOAD("tmpowner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("owner", SIGNER())
40 RETURN 0
End Function
Function UpdateCode(newCode String) Uint64
1 IF LOAD("owner") != SIGNER() THEN GOTO 101
2 IF STRLEN(newCode) == 0 THEN GOTO 10
3 IF STRLEN(newCode) == 1 THEN GOTO 20
4 IF EXISTS("nCode") == 1 THEN GOTO 7
5 STORE("nCode", newCode)
6 GOTO 100
7 STORE("nCode", LOAD("nCode") + "\n" + newCode)
8 GOTO 100
10 IF STRLEN(LOAD("nCode")) == 0 THEN GOTO 100
11 UPDATE_SC_CODE(LOAD("nCode"))
12 STORE("nCode", "")
13 GOTO 100
20 STORE("nCode", "")
100 RETURN 0
101 RETURN 1
End Function
Function Initialize() Uint64
10 STORE("owner", SIGNER())
100 RETURN 0
End Function |
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
// ______ |
// .-" "-. |
// / \ |
// _ | | _ |
// ( \ |, .-. .-. ,| / ) |
// > "=._ | )(__/ \__)( | _.=" < |
// (_/"=._"=._ |/ /\ \| _.="_.="\_) |
// "=._"(_ ^^ _)"_.=" |
// "=\__|IIIIII|__/=" |
// _.="| \IIIIII/ |"=._ |
// _ _.="_.="\ /"=._"=._ _ |
// ( \_.="_.=" `--------` "=._"=._/ ) |
// > _.=" "=._ < |
// (_/ MARKET \_) |
// |
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
Function TransferOwnership(newowner String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("tmpowner",ADDRESS_RAW(newowner))
40 RETURN 0
End Function
Function ClaimOwnership() Uint64
10 IF LOAD("tmpowner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE("owner", SIGNER())
40 RETURN 0
End Function
Function UpdateCode(newCode String) Uint64
1 IF LOAD("owner") != SIGNER() THEN GOTO 101
2 IF STRLEN(newCode) == 0 THEN GOTO 10
3 IF STRLEN(newCode) == 1 THEN GOTO 20
4 IF EXISTS("nCode") == 1 THEN GOTO 7
5 STORE("nCode", newCode)
6 GOTO 100
7 STORE("nCode", LOAD("nCode") + "\n" + newCode)
8 GOTO 100
10 IF STRLEN(LOAD("nCode")) == 0 THEN GOTO 100
11 UPDATE_SC_CODE(LOAD("nCode"))
12 STORE("nCode", "")
13 GOTO 100
20 STORE("nCode", "")
100 RETURN 0
101 RETURN 1
End Function
Function Initialize() Uint64
10 STORE("owner", SIGNER())
100 RETURN 0
End Function'] |