SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'{\rtf1\ansi\ansicpg1252\cocoartf2761
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs24 \cf0 Function Initialize() Uint64\
10 STORE("owner", SIGNER())\
20 STORE("amount", 2)\
40 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 Withdraw( amount Uint64) Uint64\
10 IF LOAD("owner") == SIGNER() THEN GOTO 30\
20 RETURN 1\
30 SEND_DERO_TO_ADDRESS(SIGNER(),amount)\
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\
}'] |