Transaction Details
Open on Dero ExplorerInternal ID:
3669429
Transaction Hash:
cb375361fc5c73799d8c1f472431020327251eec1a4946b73d6c257c651e4cd9
Block:
Timestamp:
2024-03-04 17:12:45 UTC (1.5 years ago)
Type:
sc
Ring Size:
2
Payloads:
1
Caller:
…qgrdsvnq
(1396094)
SC Data:
[{"name":"SC_ACTION","datatype":"U","value":"1"},{"name":"SC_CODE","datatype":"S","value":"// Issue tokens after depositing DERO (Convert DERO to TOKENX)\r\nFunction IssueTOKENX() Uint64\r\n10 SEND_ASSET_TO_ADDRESS(SIGNER(), DEROVALUE(),SCID()) // Increment balance of user, without knowing original balance, this is done homomorphically\r\n20 RETURN 0\r\nEnd Function\r\n\r\n// Convert TOKENX to DERO after depositing TOKENX. Smart Contract can give DERO, Only if DERO balance exists.\r\nFunction ConvertTOKENX() Uint64\r\n10 SEND_DERO_TO_ADDRESS(SIGNER(),ASSETVALUE(SCID())) // Increment balance of user, without knowing original balance, this is done using Homomorphic Encryption.\r\n20 RETURN 0\r\nEnd Function\r\n\r\n// This function is used to initialize parameters during install time\r\n// InitializePrivate initializes a private SC\r\nFunction InitializePrivate() Uint64\r\n10 STORE(\"owner\", SIGNER()) // Store in DB [\"owner\"] = address\r\n30 SEND_ASSET_TO_ADDRESS(SIGNER(), "40000000", SCID()) // Gives initial encrypted balance of 1600000. \r\n40 RETURN 0 \r\nEnd Function\r\n\r\n// This function is used to change owner\r\n// owner is an string form of address\r\nFunction TransferOwnership(newowner String) Uint64\r\n10 IF LOAD(\"owner\") == SIGNER() THEN GOTO 30\r\n20 RETURN 1\r\n30 STORE(\"tmpowner\",ADDRESS_RAW(newowner))\r\n40 RETURN 0\r\nEnd Function\r\n\r\n// Until the new owner claims ownership, existing owner remains owner\r\nFunction ClaimOwnership() Uint64\r\n10 IF LOAD(\"tmpowner\") == SIGNER() THEN GOTO 30\r\n20 RETURN 1\r\n30 STORE(\"owner\",SIGNER()) // ownership claim successful\r\n40 RETURN 0\r\nEnd Function\r\n\r\n// if signer is owner, withdraw any requested funds\r\n// if everthing is okay, they will be showing in signers wallet\r\nFunction Withdraw( amount Uint64) Uint64 \r\n10 IF LOAD(\"owner\") == SIGNER() THEN GOTO 30 \r\n20 RETURN 1 \r\n30 SEND_DERO_TO_ADDRESS(SIGNER(),amount) \r\n40 RETURN 0 \r\nEnd Function\r\n\r\n// if signer is owner, provide him rights to update code anytime\r\n// make sure update is always available to SC\r\nFunction UpdateCode( code String) Uint64\r\n10 IF LOAD(\"owner\") == SIGNER() THEN GOTO 30\r\n20 RETURN 1\r\n30 UPDATE_SC_CODE(code)\r\n40 RETURN 0\r\nEnd Function"}]
Payload
Token (SCID):
DERO
Deposited:
none
Fees:
0.03246 DERO