tx · 4dApoDbCd5w35jBWoMz1GnakH7iLHP24CkAomndkYNeS 3Myb6G8DkdBb8YcZzhrky65HrmiNuac3kvS: -0.00200000 Waves 2023.05.17 12:24 [2581766] smart account 3Myb6G8DkdBb8YcZzhrky65HrmiNuac3kvS > SELF 0.00000000 Waves
{ "type": 13, "id": "4dApoDbCd5w35jBWoMz1GnakH7iLHP24CkAomndkYNeS", "fee": 200000, "feeAssetId": null, "timestamp": 1684315454044, "version": 2, "chainId": 84, "sender": "3Myb6G8DkdBb8YcZzhrky65HrmiNuac3kvS", "senderPublicKey": "Ab4L9nu8oFkaz3goia9d2YmgZZCZciUsmuKTWq8rMYN4", "proofs": [ "376CiZjdrG5jGy5iVja6P4xb59cq8VmeHxgf2nAU4wTYmPeCbJCfQ2Dj71eLobuKCRHFnTT2hhnjmmg3K6JPidrs" ], "script": "base64:BgIECAISAAoAA1NFUAICX18ABU1VTFQ2AMCEPQAFTVVMVDgAgMLXLwAKV0FWRVNJRFNUUgIFV0FWRVMAB1dBVkVTSUQJANkEAQUKV0FWRVNJRFNUUgAIWFROSURTVFICLDI1RkVxRWpSa3FLNnlDa2lUN0x6NlNBWXo3Z1VGQ3R4ZkNDaG5yVkZENUFUAAhORVVUUklOTwIjM016YngzNEV4NXJSYm4zOXZVSHg5a2l3aDNubmVGOFM1d2UAE1dYX1NXQVBfQUREUkVTU19TVFICIzNONkxIamZHYjZGZ2N5N1lzVmNOeEd5UFRqNDlYYlFBaWpxAA9XWF9TV0FQX0FERFJFU1MJARFAZXh0ck5hdGl2ZSgxMDYyKQEFE1dYX1NXQVBfQUREUkVTU19TVFIBFmtleU1pbkRpc3RyaWJ1dGVBbW91bnQAAh4lcyVzX19jZmdfX21pbkRpc3RyaWJ1dGVBbW91bnQBAWkBCmJ1eUJhY2tYdG4ABBNtaW5EaXN0cmlidXRlQW1vdW50CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMJARZrZXlNaW5EaXN0cmlidXRlQW1vdW50AAkAaAIADQ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UITkVVVFJJTk8FA25pbAkAzAgCCQEPQXR0YWNoZWRQYXltZW50AgUEdW5pdAUKYnV5QmFja0FtdAUDbmlsAwkAAAIFCnN3YXBSZXN1bHQFCnN3YXBSZXN1bHQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQxjYWxsZXJSZXdhcmQFBHVuaXQFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgBTToDy", "height": 2581766, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8KDNV9brkkg7pURvLcQbxMfHG2dgA8XfRSYHTGEpfGM Next: EBuUVGfgwytQdJ4X5KnaAodkQ94fU1q4J554Fr5XrSGg Diff:
Old | New | Differences | |
---|---|---|---|
36 | 36 | let feeAmt = i.fee | |
37 | 37 | let feeAssetId = valueOrElse(i.feeAssetId, WAVESID) | |
38 | 38 | let allowedFee = ((5 * MULT8) / 1000) | |
39 | - | let callerReward = ( | |
39 | + | let callerReward = (2 * allowedFee) | |
40 | 40 | if ((pmtAmt != minDistributeAmount)) | |
41 | 41 | then throw((("attached payment must be exact " + toString(minDistributeAmount)) + " Wavelets")) | |
42 | 42 | else if ((pmtAssetId != WAVESID)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let MULT6 = 1000000 | |
7 | 7 | ||
8 | 8 | let MULT8 = 100000000 | |
9 | 9 | ||
10 | 10 | let WAVESIDSTR = "WAVES" | |
11 | 11 | ||
12 | 12 | let WAVESID = fromBase58String(WAVESIDSTR) | |
13 | 13 | ||
14 | 14 | let XTNIDSTR = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT" | |
15 | 15 | ||
16 | 16 | let NEUTRINO = "3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we" | |
17 | 17 | ||
18 | 18 | let WX_SWAP_ADDRESS_STR = "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq" | |
19 | 19 | ||
20 | 20 | let WX_SWAP_ADDRESS = addressFromStringValue(WX_SWAP_ADDRESS_STR) | |
21 | 21 | ||
22 | 22 | func keyMinDistributeAmount () = "%s%s__cfg__minDistributeAmount" | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(i) | |
26 | 26 | func buyBackXtn () = { | |
27 | 27 | let minDistributeAmount = valueOrElse(getInteger(this, keyMinDistributeAmount()), (13 * MULT8)) | |
28 | 28 | if ((size(i.payments) != 1)) | |
29 | 29 | then throw("exact 1 payment must be attached") | |
30 | 30 | else if ((i.caller != i.originCaller)) | |
31 | 31 | then throw("dapp to dapp calls are not allowed") | |
32 | 32 | else { | |
33 | 33 | let pmt = i.payments[0] | |
34 | 34 | let pmtAmt = pmt.amount | |
35 | 35 | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
36 | 36 | let feeAmt = i.fee | |
37 | 37 | let feeAssetId = valueOrElse(i.feeAssetId, WAVESID) | |
38 | 38 | let allowedFee = ((5 * MULT8) / 1000) | |
39 | - | let callerReward = ( | |
39 | + | let callerReward = (2 * allowedFee) | |
40 | 40 | if ((pmtAmt != minDistributeAmount)) | |
41 | 41 | then throw((("attached payment must be exact " + toString(minDistributeAmount)) + " Wavelets")) | |
42 | 42 | else if ((pmtAssetId != WAVESID)) | |
43 | 43 | then throw("only Waves can be used in payment") | |
44 | 44 | else if ((feeAssetId != WAVESID)) | |
45 | 45 | then throw("only Waves can be used in fees") | |
46 | 46 | else if ((feeAmt != allowedFee)) | |
47 | 47 | then throw("fee amount couldn't exceed 0.005") | |
48 | 48 | else { | |
49 | 49 | let buyBackAmt = (pmtAmt - callerReward) | |
50 | 50 | let swapResult = invoke(WX_SWAP_ADDRESS, "swap", [1, XTNIDSTR, NEUTRINO], [AttachedPayment(unit, buyBackAmt)]) | |
51 | 51 | if ((swapResult == swapResult)) | |
52 | 52 | then [ScriptTransfer(i.caller, callerReward, unit)] | |
53 | 53 | else throw("Strict value is not equal to itself.") | |
54 | 54 | } | |
55 | 55 | } | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 |
github/deemru/w8io/026f985 31.06 ms ◑