tx · BC8monaYtxij8jUZtvQkjqDSddmn8XpvsJHSbXwjf3GD 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id: -0.01400000 Waves 2021.04.23 01:31 [1494250] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves
{ "type": 13, "id": "BC8monaYtxij8jUZtvQkjqDSddmn8XpvsJHSbXwjf3GD", "fee": 1400000, "feeAssetId": null, "timestamp": 1619130775327, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "5ymaEMqQfgfwU1EJuAiK5GK6zvncq7JcyfxvhzvvxiPfkgwF2fkttgM3aLYDebGbEE43AaWV6eVx4CysrC3ovzUw" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAABAAAAAAEVVNETgEAAAAgtiYpwwT1zlORpA5LdSQvZIxRsfrfr1QpvUjSHSqyqtEAAAAAB1VTRHRlc3QBAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAAdhc3NldElkBQAAAAdVU0R0ZXN0AQAAAAxnZXRBc3NldEluZm8AAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAmlkBQAAAAckbWF0Y2gwBAAAAAhzdHJpbmdJZAkAAlgAAAABBQAAAAJpZAQAAAAEaW5mbwkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAD7AAAAAEFAAAAAmlkCQABLAAAAAIJAAEsAAAAAgIAAAAGQXNzZXQgBQAAAAhzdHJpbmdJZAIAAAAOIGRvZXNuJ3QgZXhpc3QJAAUVAAAAAwUAAAAIc3RyaW5nSWQIBQAAAARpbmZvAAAABG5hbWUIBQAAAARpbmZvAAAACGRlY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QAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABByZWNpcGllbnRBZGRyZXNzBQAAABBhbW91bnRXaXRob3V0RmVlBQAAAAdhc3NldElkBQAAAANuaWwAAAAA6qB40A==", "height": 1494250, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HXP6zH2EzVFi2JPYT9cgow6Nyym4RL3n2jSFBL3TCt2Z Next: 2GWm7BkWcubddzHbk3gwuizvVQbvLwFcY6TPVg9fBbGN Diff:
Old | New | Differences | |
---|---|---|---|
34 | 34 | else { | |
35 | 35 | let commission = 30000 | |
36 | 36 | let commissionScaleDelimiter = 1000000 | |
37 | - | let fee = fraction(pmtAmount, | |
37 | + | let fee = fraction(pmtAmount, 3, 100) | |
38 | 38 | let amountWithoutFee = (pmtAmount - fee) | |
39 | 39 | [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(recipientAddress, amountWithoutFee, assetId)] | |
40 | 40 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
5 | 5 | ||
6 | 6 | let USDtest = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg' | |
7 | 7 | ||
8 | 8 | let assetId = USDtest | |
9 | 9 | ||
10 | 10 | func getAssetInfo (assetId) = match assetId { | |
11 | 11 | case id: ByteVector => | |
12 | 12 | let stringId = toBase58String(id) | |
13 | 13 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
14 | 14 | $Tuple3(stringId, info.name, info.decimals) | |
15 | 15 | case waves: Unit => | |
16 | 16 | $Tuple3("WAVES", "WAVES", 8) | |
17 | 17 | case _ => | |
18 | 18 | throw("Match error") | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | @Callable(i) | |
23 | 23 | func call (recipient) = { | |
24 | 24 | let recipientAddress = addressFromStringValue(recipient) | |
25 | 25 | let $t0756831 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
26 | 26 | let pmtAmount = $t0756831._1 | |
27 | 27 | let pmtAssetId = $t0756831._2 | |
28 | 28 | let $t0834907 = getAssetInfo(pmtAssetId) | |
29 | 29 | let pmtStrAssetId = $t0834907._1 | |
30 | 30 | let pmtAssetName = $t0834907._2 | |
31 | 31 | let pmtDecimals = $t0834907._3 | |
32 | 32 | if ((pmtAssetId != assetId)) | |
33 | 33 | then throw("Assets must be USDN only") | |
34 | 34 | else { | |
35 | 35 | let commission = 30000 | |
36 | 36 | let commissionScaleDelimiter = 1000000 | |
37 | - | let fee = fraction(pmtAmount, | |
37 | + | let fee = fraction(pmtAmount, 3, 100) | |
38 | 38 | let amountWithoutFee = (pmtAmount - fee) | |
39 | 39 | [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(recipientAddress, amountWithoutFee, assetId)] | |
40 | 40 | } | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 |
github/deemru/w8io/026f985 21.43 ms ◑