tx · 549hCTwGimtbiPzzGWqc5y3Rump1TL83hPzSEun1ckds

3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E:  -0.00200000 Waves

2024.11.12 23:48 [3368703] smart account 3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E > SELF 0.00000000 Waves

{ "type": 13, "id": "549hCTwGimtbiPzzGWqc5y3Rump1TL83hPzSEun1ckds", "fee": 200000, "feeAssetId": null, "timestamp": 1731444538845, "version": 1, "sender": "3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E", "senderPublicKey": "4Hyg7NjV4cswejcnGeMvk6x68P2RLt9Y1ontHkWtTcEQ", "proofs": [ "41aU1WdQsqAAdYQwxJLLD8Z3MmQfFhtypV9VaLUPxggLwgZkndsDiZDqZZuje52trnouU2eqy26DQevbqqSjWaco" ], "script": "base64:CAIQCAISBQoDCAgBEgMKAQgSAAEBDGdldEFzc2V0TmFtZQEHYXNzZXRJZAQEaW5mbwkBBXZhbHVlAQkA7AcBBQdhc3NldElkCAUEaW5mbwRuYW1lAwFpAQ10cmFuc2ZlclRva2VuAwxyZWNpcGllbnRTdHIKYXNzZXRJZFN0cgZhbW91bnQECXJlY2lwaWVudAkBEUBleHRyTmF0aXZlKDEwNjIpAQUMcmVjaXBpZW50U3RyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTBA5jdXJyZW50QmFsYW5jZQgJAO8HAQUEdGhpcwdyZWd1bGFyAwkAZwIFDmN1cnJlbnRCYWxhbmNlBQZhbW91bnQECHRyYW5zZmVyCQEOU2NyaXB0VHJhbnNmZXIDBQlyZWNpcGllbnQFBmFtb3VudAUEdW5pdAQGdHhEYXRhCQDMCAIJAQtCaW5hcnlFbnRyeQICEGxhc3RUcmFuc2ZlclR4SWQIBQFpDXRyYW5zYWN0aW9uSWQJAMwIAgkBC1N0cmluZ0VudHJ5AgINbGFzdFJlY2lwaWVudAUMcmVjaXBpZW50U3RyCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgpsY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5AgIMcXVlcmllZEFzc2V0BQphc3NldElkU3RyCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgdiYWxhbmNlBQdiYWxhbmNlBQNuaWwFB2JhbGFuY2UBaQENbGlzdEFsbEFzc2V0cwAEC3dhdmVzQW1vdW50CAkA7wcBBQR0aGlzB3JlZ3VsYXIEBnJlc3VsdAkAzAgCCQELU3RyaW5nRW50cnkCAg1XQVZFU19iYWxhbmNlCQCkAwEFC3dhdmVzQW1vdW50BQNuaWwJAJQKAgUGcmVzdWx0BQR1bml0AQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GCQDEEwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V50O+Kiw==", "chainId": 84, "height": 3368703, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: tiWaXWaY3T6Htac7kbo7eb79yt3evFS3552kDEHPHhx Next: E3Nz8TkeiFediEXxoCr1UTQN64v2Y5UwxW3oazLfUNbx Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 8 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let targetPublicKey = base58'HpeKQu8xawfaxbbTSPNMNqVvWM9xhebUcemDK5REzG2j'
4+func getAssetName (assetId) = {
5+ let info = value(assetInfo(assetId))
6+ info.name
7+ }
58
6-let targetAddress = base58'3N3wBswhGGLLvVmd6KAA7hH8tZsu2iSY5Yx'
79
810 @Callable(i)
9-func executeSetScriptNull () = {
10- let tx = [IntegerEntry("type", 13), IntegerEntry("version", 1), IntegerEntry("chainId", 84), IntegerEntry("fee", 100000), IntegerEntry("timestamp", lastBlock.timestamp), BinaryEntry("senderPublicKey", targetPublicKey), BinaryEntry("script", base58''), BinaryEntry("address", targetAddress)]
11- $Tuple2(tx, unit)
11+func transferToken (recipientStr,assetIdStr,amount) = {
12+ let recipient = addressFromStringValue(recipientStr)
13+ if ((assetIdStr == "WAVES"))
14+ then {
15+ let currentBalance = wavesBalance(this).regular
16+ if ((currentBalance >= amount))
17+ then {
18+ let transfer = ScriptTransfer(recipient, amount, unit)
19+ let txData = [BinaryEntry("lastTransferTxId", i.transactionId), StringEntry("lastRecipient", recipientStr), IntegerEntry("lastAmount", amount), StringEntry("lastAsset", "WAVES")]
20+ $Tuple2((txData :+ transfer), unit)
21+ }
22+ else throw("Yetersiz WAVES bakiyesi")
23+ }
24+ else {
25+ let assetId = fromBase58String(assetIdStr)
26+ let currentBalance = assetBalance(this, assetId)
27+ if ((currentBalance >= amount))
28+ then {
29+ let transfer = ScriptTransfer(recipient, amount, assetId)
30+ let txData = [BinaryEntry("lastTransferTxId", i.transactionId), StringEntry("lastRecipient", recipientStr), IntegerEntry("lastAmount", amount), StringEntry("lastAsset", assetIdStr)]
31+ $Tuple2((txData :+ transfer), unit)
32+ }
33+ else throw("Yetersiz token bakiyesi")
34+ }
35+ }
36+
37+
38+
39+@Callable(i)
40+func getBalance (assetIdStr) = if ((assetIdStr == "WAVES"))
41+ then {
42+ let balance = wavesBalance(this).regular
43+ $Tuple2([StringEntry("queriedAsset", "WAVES"), IntegerEntry("balance", balance)], balance)
44+ }
45+ else {
46+ let assetId = fromBase58String(assetIdStr)
47+ let balance = assetBalance(this, assetId)
48+ $Tuple2([StringEntry("queriedAsset", assetIdStr), IntegerEntry("balance", balance)], balance)
49+ }
50+
51+
52+
53+@Callable(i)
54+func listAllAssets () = {
55+ let wavesAmount = wavesBalance(this).regular
56+ let result = [StringEntry("WAVES_balance", toString(wavesAmount))]
57+ $Tuple2(result, unit)
1258 }
1359
1460
1561 @Verifier(tx)
16-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
62+func verify () = match tx {
63+ case _: InvokeScriptTransaction =>
64+ true
65+ case _ =>
66+ sigVerify_8Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
67+}
1768

github/deemru/w8io/026f985 
16.06 ms