SC CODE: Function InitializePrivate() Uint64
10 STORE("owner", SIGNER())
11 STORE("scType", "TELA-ASSET")
40 RETURN 0
End Function
Function StoreItem(name String, content String) Uint64
16 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE(name, content)
60 RETURN 0
End Function
Function DeleteItem(name String) Uint64
16 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 DELETE(name)
60 RETURN 0
End Function
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(code String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 RETURN 0
End Function |
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate() Uint64
10 STORE("owner", SIGNER())
11 STORE("scType", "TELA-ASSET")
40 RETURN 0
End Function
Function StoreItem(name String, content String) Uint64
16 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 STORE(name, content)
60 RETURN 0
End Function
Function DeleteItem(name String) Uint64
16 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 DELETE(name)
60 RETURN 0
End Function
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(code String) Uint64
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 RETURN 0
End Function'] |