Transaction Details
Open on Dero ExplorerInternal ID:
3413831
Transaction Hash:
87a485d1951fd694abdba1f208f4ef457ffcfa2c262527b7982e33a12e2f2ab0
Block:
Timestamp:
2023-04-02 13:28:30 UTC (2.5 years ago)
Type:
sc
Ring Size:
2
Payloads:
1
Caller:
pedr02b2
(1764903)
SC Data:
[{"name":"SC_ACTION","datatype":"U","value":"1"},{"name":"SC_CODE","datatype":"S","value":"Function CreateProfile(dero_name String, bio String) Uint64\n10 DIM profile_count as Uint64\n20 DIM signer as String\n30 LET signer = SIGNER()\n40 IF EXISTS(\"signer_\" + signer) != 0 THEN GOTO 110 // if signer already has a profile\n50 LET profile_count = LOAD(\"profile_count\") + 1\n60 STORE(\"profile_address_\" + profile_count, signer)\n70 STORE(\"signer_\" + signer, profile_count)\n80 STORE(\"dero_name_\" + profile_count, dero_name)\n90 STORE(\"bio_\" + profile_count, bio)\n100 STORE(\"profile_count\", profile_count)\n110 RETURN 0\n120 RETURN 1 // Error: profile already exists\nEnd Function\n\nFunction Deposit() Uint64\n10 RETURN 0\nEnd Function\n\nFunction UpdateProfile(dero_name String, bio String) Uint64\n10 DIM signer as String\n20 DIM userId as Uint64\n30 LET signer = SIGNER()\n40 IF EXISTS(\"signer_\" + signer) == 0 THEN GOTO 70 // if signer doesn't exist\n50 LET userId = LOAD(\"signer_\" + signer)\n60 STORE(\"dero_name_\" + userId, dero_name)\n70 STORE(\"bio_\" + userId, bio)\n80 RETURN 0\n90 RETURN 1 // Error: signer doesn't exist\nEnd Function\n\n\nFunction GetProfile(profile_index Uint64) String\n10 DIM dero_name as String\n20 DIM bio as String\n30 dero_name = LOAD(\"dero_name_\" + profile_index)\n40 bio = LOAD(\"bio_\" + profile_index)\n50 RETURN \"dero_name: \" + dero_name + \", bio: \" + bio\nEnd Function\n\n// if signer is owner, withdraw any requested funds\n// if everthing is okay, thety will be showing in signers wallet\nFunction Withdraw( amount Uint64) Uint64 \n10 IF (LOAD(\"owner\")) == (SIGNER()) THEN GOTO 30 \n20 RETURN 1\n30 SEND_DERO_TO_ADDRESS(SIGNER(),amount)\n40 RETURN 0\nEnd Function\n\n\n\nFunction Initialize() Uint64\n10 STORE(\"owner\", SIGNER())\n20 STORE(\"profile_count\", 0) // initial number of profiles\n30 STORE(\"contract_balance\", 0) // initial contract balance\n40 RETURN 0\nEnd Function\n"}]
Payload
Token (SCID):
DERO
Deposited:
none
Fees:
0.02815 DERO