tx · FE8nknrpwXchLx2oD7BQJdmzEsvpmnXe2X4pMLvfiU4H 3Myb6G8DkdBb8YcZzhrky65HrmiNuac3kvS: -0.00200000 Waves 2023.05.19 22:30 [2585273] smart account 3Myb6G8DkdBb8YcZzhrky65HrmiNuac3kvS > SELF 0.00000000 Waves
{ "type": 13, "id": "FE8nknrpwXchLx2oD7BQJdmzEsvpmnXe2X4pMLvfiU4H", "fee": 200000, "feeAssetId": null, "timestamp": 1684524614153, "version": 2, "chainId": 84, "sender": "3Myb6G8DkdBb8YcZzhrky65HrmiNuac3kvS", "senderPublicKey": "Ab4L9nu8oFkaz3goia9d2YmgZZCZciUsmuKTWq8rMYN4", "proofs": [ "3wLtUdpCdaNCa8eNfiMq95cKrheJxHsWwS8aD1xTXeL8o5jwfyrvcwH7qM4GDDaKdKBxCmQv17e4yv3UMyvh6RrZ" ], "script": "base64:BgIECAISAAoAA1NFUAICX18ABU1VTFQ2AMCEPQAFTVVMVDgAgMLXLwAKV0FWRVNJRFNUUgIFV0FWRVMAB1dBVkVTSUQJANkEAQUKV0FWRVNJRFNUUgAIWFROSURTVFICLDI1RkVxRWpSa3FLNnlDa2lUN0x6NlNBWXo3Z1VGQ3R4ZkNDaG5yVkZENUFUAAhORVVUUklOTwIjM016YngzNEV4NXJSYm4zOXZVSHg5a2l3aDNubmVGOFM1d2UAE1dYX1NXQVBfQUREUkVTU19TVFICIzNONkxIamZHYjZGZ2N5N1lzVmNOeEd5UFRqNDlYYlFBaWpxAA9XWF9TV0FQX0FERFJFU1MJARFAZXh0ck5hdGl2ZSgxMDYyKQEFE1dYX1NXQVBfQUREUkVTU19TVFIBFmtleU1pbkRpc3RyaWJ1dGVBbW91bnQAAh4lcyVzX19jZmdfX21pbkRpc3RyaWJ1dGVBbW91bnQBAWkBB2RlZmF1bHQABApidXlCYWNrQW10CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMJARZrZXlNaW5EaXN0cmlidXRlQW1vdW50AAkAaAIADQUFTVVMVDg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XB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFDGNhbGxlclJld2FyZAUEdW5pdAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAITMmNM=", "height": 2585273, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6Gv8G5ZeVt4oCtr73CMW686siYUuSuJm6Pr1hYipbEHo Next: Rd6vNQjZxDeieNeXs5YJyBWj4Di9bZauyghwTFSJaXq Diff:
Old | New | Differences | |
---|---|---|---|
41 | 41 | then throw("fee amount couldn't exceed 0.005") | |
42 | 42 | else if ((minRequiredWavesBalance > wavesBalance(this).available)) | |
43 | 43 | then throw(("wavelets balance is less then " + toString(minRequiredWavesBalance))) | |
44 | - | else { | |
45 | - | let swapResult = invoke(WX_SWAP_ADDRESS, "swap", [1, XTNIDSTR, NEUTRINO], [AttachedPayment(unit, buyBackAmt)]) | |
46 | - | if ((swapResult == swapResult)) | |
47 | - | then [ScriptTransfer(i.caller, callerReward, unit)] | |
48 | - | else throw("Strict value is not equal to itself.") | |
49 | - | } | |
44 | + | else if ((addressFromPublicKey(i.callerPublicKey) != i.caller)) | |
45 | + | then throw("Alias is not allowed") | |
46 | + | else { | |
47 | + | let swapResult = invoke(WX_SWAP_ADDRESS, "swap", [1, XTNIDSTR, NEUTRINO], [AttachedPayment(unit, buyBackAmt)]) | |
48 | + | if ((swapResult == swapResult)) | |
49 | + | then [ScriptTransfer(i.caller, callerReward, unit)] | |
50 | + | else throw("Strict value is not equal to itself.") | |
51 | + | } | |
50 | 52 | } | |
51 | 53 | } | |
52 | 54 |
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 default () = { | |
27 | 27 | let buyBackAmt = valueOrElse(getInteger(this, keyMinDistributeAmount()), (13 * MULT8)) | |
28 | 28 | if ((size(i.payments) != 0)) | |
29 | 29 | then throw("no payments are expected") | |
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 feeAmt = i.fee | |
34 | 34 | let feeAssetId = valueOrElse(i.feeAssetId, WAVESID) | |
35 | 35 | let allowedFee = ((5 * MULT8) / 1000) | |
36 | 36 | let callerReward = (2 * allowedFee) | |
37 | 37 | let minRequiredWavesBalance = (buyBackAmt + callerReward) | |
38 | 38 | if ((feeAssetId != WAVESID)) | |
39 | 39 | then throw("only Waves can be used in fees") | |
40 | 40 | else if ((feeAmt != allowedFee)) | |
41 | 41 | then throw("fee amount couldn't exceed 0.005") | |
42 | 42 | else if ((minRequiredWavesBalance > wavesBalance(this).available)) | |
43 | 43 | then throw(("wavelets balance is less then " + toString(minRequiredWavesBalance))) | |
44 | - | else { | |
45 | - | let swapResult = invoke(WX_SWAP_ADDRESS, "swap", [1, XTNIDSTR, NEUTRINO], [AttachedPayment(unit, buyBackAmt)]) | |
46 | - | if ((swapResult == swapResult)) | |
47 | - | then [ScriptTransfer(i.caller, callerReward, unit)] | |
48 | - | else throw("Strict value is not equal to itself.") | |
49 | - | } | |
44 | + | else if ((addressFromPublicKey(i.callerPublicKey) != i.caller)) | |
45 | + | then throw("Alias is not allowed") | |
46 | + | else { | |
47 | + | let swapResult = invoke(WX_SWAP_ADDRESS, "swap", [1, XTNIDSTR, NEUTRINO], [AttachedPayment(unit, buyBackAmt)]) | |
48 | + | if ((swapResult == swapResult)) | |
49 | + | then [ScriptTransfer(i.caller, callerReward, unit)] | |
50 | + | else throw("Strict value is not equal to itself.") | |
51 | + | } | |
50 | 52 | } | |
51 | 53 | } | |
52 | 54 | ||
53 | 55 |
github/deemru/w8io/026f985 19.19 ms ◑