tx · 9ipHkRPdWWm6MTNR77qg3gn8tcF2VW3mdGFFBRk5XGsg 3N37eLdtWjhS31FGHvu2HpGLreF11i58Bv6: -0.01000000 Waves 2023.02.23 15:42 [2462321] smart account 3N37eLdtWjhS31FGHvu2HpGLreF11i58Bv6 > SELF 0.00000000 Waves
{ "type": 13, "id": "9ipHkRPdWWm6MTNR77qg3gn8tcF2VW3mdGFFBRk5XGsg", "fee": 1000000, "feeAssetId": null, "timestamp": 1677156160272, "version": 2, "chainId": 84, "sender": "3N37eLdtWjhS31FGHvu2HpGLreF11i58Bv6", "senderPublicKey": "3pW4h7e3NAcqGkvc1AyziZLMPSsG2eXvCGU7vLxPXkaq", "proofs": [ "52bctaKxd8F5P9stHJMdvfAJGJW2BnYzHvPAbRjXCMraCPgumkH9gGVrmNnCfhh3ZEJVsesDNWq3JujDLKfQC39E" ], "script": "base64:BgIMCAISABIAEgQKAgEBAwAWYnN0VXNkdEFzc2V0U3RvcmFnZUtleQIOYnN0VXNkdEFzc2V0SWQAFmJzdFN1cmZBc3NldFN0b3JhZ2VLZXkCDmJzdFN1cmZBc3NldElkARNjb252ZXJ0VG9CeXRlVmVjdG9yAQRkYXRhBAckbWF0Y2gwBQRkYXRhAwkAAQIFByRtYXRjaDACBlN0cmluZwQDc3RyBQckbWF0Y2gwCQCbAwEFA3N0cgkAAgECIUV4cGVjdGVkIHRoYXQgZGF0YSB3aWxsIGJlIHN0cmluZwMBaQEEY2FsbAAEBWFzc2V0CQDDCAcCBUFzc2V0AgAAZAAIBgUEdW5pdAAABAdhc3NldElkCQC4CAEFBWFzc2V0CQDMCAIJAQtCaW5hcnlFbnRyeQICA2JpbgEACQDMCAIJAQxCb29sZWFuRW50cnkCAgRib29sBgkAzAgCCQEMSW50ZWdlckVudHJ5AgIDaW50AAEJAMwIAgkBC1N0cmluZ0VudHJ5AgIDc3RyAgAJAMwIAgkBC0RlbGV0ZUVudHJ5AQIDc3RyCQDMCAIFBWFzc2V0BQNuaWwBaQELaXNz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wIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleam8X7k=", "height": 2462321, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BDv3FRwC5wKi6cKaUHMaZ4CF1mN5okqqFuvJVVgWyGwW Next: EQsk4kmittQy7Re7ZRkQgomcom7JZ6LGj5QAvDvA6xyp Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | let balance = assetBalance(this, convertToByteVector(assetId)) | |
44 | 44 | if ((balance >= amount)) | |
45 | 45 | then [ScriptTransfer(i.caller, amount, convertToByteVector(assetId))] | |
46 | - | else [ | |
46 | + | else [ScriptTransfer(i.caller, amount, convertToByteVector(assetId))] | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let bstUsdtAssetStorageKey = "bstUsdtAssetId" | |
5 | 5 | ||
6 | 6 | let bstSurfAssetStorageKey = "bstSurfAssetId" | |
7 | 7 | ||
8 | 8 | func convertToByteVector (data) = match data { | |
9 | 9 | case str: String => | |
10 | 10 | toBytes(str) | |
11 | 11 | case _ => | |
12 | 12 | throw("Expected that data will be string") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func call () = { | |
18 | 18 | let asset = Issue("Asset", "", 100, 8, true, unit, 0) | |
19 | 19 | let assetId = calculateAssetId(asset) | |
20 | 20 | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset] | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(i) | |
26 | 26 | func issueAssets () = { | |
27 | 27 | let bstUsdt = Issue("bstUsdtTest1", "", 1000000, 6, true, unit, 0) | |
28 | 28 | let bstUsdtAssetId = calculateAssetId(bstUsdt) | |
29 | 29 | let bstSurf = Issue("bstSurfTest1", "", 1000000, 6, true, unit, 1) | |
30 | 30 | let bstSurfAssetId = calculateAssetId(bstSurf) | |
31 | 31 | [StringEntry(bstUsdtAssetStorageKey, toBase58String(bstUsdtAssetId)), StringEntry(bstSurfAssetStorageKey, toBase58String(bstSurfAssetId)), BinaryEntry("TestData", bstSurfAssetId), bstUsdt, bstSurf] | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func sendInternalAssetsToTheCaller (id,amount) = { | |
38 | 38 | let assetId = if ((id == 0)) | |
39 | 39 | then getString(bstUsdtAssetStorageKey) | |
40 | 40 | else if ((id == 1)) | |
41 | 41 | then getString(bstSurfAssetStorageKey) | |
42 | 42 | else throw("Wrong Asset Id") | |
43 | 43 | let balance = assetBalance(this, convertToByteVector(assetId)) | |
44 | 44 | if ((balance >= amount)) | |
45 | 45 | then [ScriptTransfer(i.caller, amount, convertToByteVector(assetId))] | |
46 | - | else [ | |
46 | + | else [ScriptTransfer(i.caller, amount, convertToByteVector(assetId))] | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Verifier(tx) | |
51 | 51 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
52 | 52 |
github/deemru/w8io/169f3d6 52.28 ms ◑