tx · 8gZfH6eH8SCFnXwCTwxk1HrzH8ZxVh1E69oykQHe33e9 3N37eLdtWjhS31FGHvu2HpGLreF11i58Bv6: -0.01000000 Waves 2023.03.31 10:29 [2513822] smart account 3N37eLdtWjhS31FGHvu2HpGLreF11i58Bv6 > SELF 0.00000000 Waves
{ "type": 13, "id": "8gZfH6eH8SCFnXwCTwxk1HrzH8ZxVh1E69oykQHe33e9", "fee": 1000000, "feeAssetId": null, "timestamp": 1680247769329, "version": 2, "chainId": 84, "sender": "3N37eLdtWjhS31FGHvu2HpGLreF11i58Bv6", "senderPublicKey": "3pW4h7e3NAcqGkvc1AyziZLMPSsG2eXvCGU7vLxPXkaq", "proofs": [ "4hyNPAN2vgkcPWY5fYigy4Xnj8Hv8WGdVtZpCr9woTCHA8RJDDPbqvVDMfzPDRmYxqQB1vXmP7F9Jfvzs9Ujyky7" ], "script": "base64:BgIKCAISABIECgIBAQYAFmJzdFVzZHRBc3NldFN0b3JhZ2VLZXkCDmJzdFVzZHRBc3NldElkABZic3RTdXJmQXNzZXRTdG9yYWdlS2V5Ag5ic3RTdXJmQXNzZXRJZAALc3VyZk1vY2tLZXkCCHN1cmZNb2NrAAl3eE1vY2tLZXkCBnd4TW9jawAKeHRuTW9ja0tleQIHeHRuTW9jawEGdW53cmFwAQRkYXRhBAckbWF0Y2gwBQRkYXRhAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAXYFByRtYXRjaDAFAXYJAAIBAiFFeHBlY3RlZCB0aGF0IGRhdGEgd2lsbCBiZSBzdHJpbmcCAWkBC2lzc3VlQXNzZXRzAAQIc3VyZk1vY2sJAMMIBwIJU1VSRl9Nb2NrAgAAgK3iBAAGBgUEdW5pdAAABA9zdXJmTW9ja0Fzc2V0SWQJALgIAQUIc3VyZk1vY2sEBnd4TW9jawkAwwgHAgdXWF9Nb2NrAgAAgK3iBAAGBgUEdW5pdAAABA13eE1vY2tBc3NldElkCQC4CAEFBnd4TW9jawQHeHRuTW9jawkAwwg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YhUaQ==", "height": 2513822, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: PQdd2ZaZacPfM4MfmHywRt2mRvL384Z2hF1dih7ZvMf Next: EMBkHzEG1vyJKDjwbE514rtd61CJEMAVm4168Ktrm1Yv Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let bstUsdtAssetStorageKey = "bstUsdtAssetId" | |
5 | + | ||
6 | + | let bstSurfAssetStorageKey = "bstSurfAssetId" | |
7 | + | ||
8 | + | let surfMockKey = "surfMock" | |
9 | + | ||
10 | + | let wxMockKey = "wxMock" | |
11 | + | ||
12 | + | let xtnMockKey = "xtnMock" | |
13 | + | ||
14 | + | func unwrap (data) = match data { | |
15 | + | case v: ByteVector => | |
16 | + | v | |
17 | + | case _ => | |
18 | + | throw("Expected that data will be string") | |
19 | + | } | |
4 | 20 | ||
5 | 21 | ||
6 | 22 | @Callable(i) | |
7 | - | func call (firstNumber,secondNumber,multiply) = { | |
8 | - | let bigIntResult = fraction(toBigInt(firstNumber), toBigInt(multiply), toBigInt(secondNumber), HALFUP) | |
9 | - | let result = toInt(bigIntResult) | |
10 | - | let backward = fraction(bigIntResult, toBigInt(secondNumber), toBigInt(multiply), HALFUP) | |
11 | - | [IntegerEntry("result", result), IntegerEntry("backwardResult", toInt(backward))] | |
23 | + | func issueAssets () = { | |
24 | + | let surfMock = Issue("SURF_Mock", "", 10000000, 6, true, unit, 0) | |
25 | + | let surfMockAssetId = calculateAssetId(surfMock) | |
26 | + | let wxMock = Issue("WX_Mock", "", 10000000, 6, true, unit, 0) | |
27 | + | let wxMockAssetId = calculateAssetId(wxMock) | |
28 | + | let xtnMock = Issue("XTN_Mock", "", 10000000, 6, true, unit, 0) | |
29 | + | let xtnMockAssetId = calculateAssetId(xtnMock) | |
30 | + | [DeleteEntry(bstUsdtAssetStorageKey), DeleteEntry(bstSurfAssetStorageKey), StringEntry(surfMockKey, toBase58String(surfMockAssetId)), StringEntry(wxMockKey, toBase58String(wxMockAssetId)), StringEntry(xtnMockKey, toBase58String(xtnMockAssetId)), surfMock, wxMock, xtnMock] | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | @Callable(i) | |
36 | + | func sendInternalAssetsToTheCaller (id,amount) = { | |
37 | + | let assetId = if ((id == 0)) | |
38 | + | then unwrap(getBinary(bstUsdtAssetStorageKey)) | |
39 | + | else if ((id == 1)) | |
40 | + | then unwrap(getBinary(bstSurfAssetStorageKey)) | |
41 | + | else throw("Wrong Asset Id") | |
42 | + | let balance = assetBalance(this, assetId) | |
43 | + | if ((balance >= amount)) | |
44 | + | then [ScriptTransfer(i.caller, amount, assetId)] | |
45 | + | else [Reissue(assetId, amount, true), ScriptTransfer(i.caller, amount, assetId)] | |
12 | 46 | } | |
13 | 47 | ||
14 | 48 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let bstUsdtAssetStorageKey = "bstUsdtAssetId" | |
5 | + | ||
6 | + | let bstSurfAssetStorageKey = "bstSurfAssetId" | |
7 | + | ||
8 | + | let surfMockKey = "surfMock" | |
9 | + | ||
10 | + | let wxMockKey = "wxMock" | |
11 | + | ||
12 | + | let xtnMockKey = "xtnMock" | |
13 | + | ||
14 | + | func unwrap (data) = match data { | |
15 | + | case v: ByteVector => | |
16 | + | v | |
17 | + | case _ => | |
18 | + | throw("Expected that data will be string") | |
19 | + | } | |
4 | 20 | ||
5 | 21 | ||
6 | 22 | @Callable(i) | |
7 | - | func call (firstNumber,secondNumber,multiply) = { | |
8 | - | let bigIntResult = fraction(toBigInt(firstNumber), toBigInt(multiply), toBigInt(secondNumber), HALFUP) | |
9 | - | let result = toInt(bigIntResult) | |
10 | - | let backward = fraction(bigIntResult, toBigInt(secondNumber), toBigInt(multiply), HALFUP) | |
11 | - | [IntegerEntry("result", result), IntegerEntry("backwardResult", toInt(backward))] | |
23 | + | func issueAssets () = { | |
24 | + | let surfMock = Issue("SURF_Mock", "", 10000000, 6, true, unit, 0) | |
25 | + | let surfMockAssetId = calculateAssetId(surfMock) | |
26 | + | let wxMock = Issue("WX_Mock", "", 10000000, 6, true, unit, 0) | |
27 | + | let wxMockAssetId = calculateAssetId(wxMock) | |
28 | + | let xtnMock = Issue("XTN_Mock", "", 10000000, 6, true, unit, 0) | |
29 | + | let xtnMockAssetId = calculateAssetId(xtnMock) | |
30 | + | [DeleteEntry(bstUsdtAssetStorageKey), DeleteEntry(bstSurfAssetStorageKey), StringEntry(surfMockKey, toBase58String(surfMockAssetId)), StringEntry(wxMockKey, toBase58String(wxMockAssetId)), StringEntry(xtnMockKey, toBase58String(xtnMockAssetId)), surfMock, wxMock, xtnMock] | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | @Callable(i) | |
36 | + | func sendInternalAssetsToTheCaller (id,amount) = { | |
37 | + | let assetId = if ((id == 0)) | |
38 | + | then unwrap(getBinary(bstUsdtAssetStorageKey)) | |
39 | + | else if ((id == 1)) | |
40 | + | then unwrap(getBinary(bstSurfAssetStorageKey)) | |
41 | + | else throw("Wrong Asset Id") | |
42 | + | let balance = assetBalance(this, assetId) | |
43 | + | if ((balance >= amount)) | |
44 | + | then [ScriptTransfer(i.caller, amount, assetId)] | |
45 | + | else [Reissue(assetId, amount, true), ScriptTransfer(i.caller, amount, assetId)] | |
12 | 46 | } | |
13 | 47 | ||
14 | 48 | ||
15 | 49 | @Verifier(tx) | |
16 | 50 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
17 | 51 |
github/deemru/w8io/026f985 35.54 ms ◑