tx · 93Suy4uY89dQApWJsPJtCag9kuaPkHv7633rR1ZouqjY
3N7ZQDNskguAikFYpHDs3nSLEqZ1kcawW2w: -0.01400000 Waves
2020.08.02 19:14 [1114951] smart account 3N7ZQDNskguAikFYpHDs3nSLEqZ1kcawW2w > SELF 0.00000000 Waves
{
"type": 13,
"id": "93Suy4uY89dQApWJsPJtCag9kuaPkHv7633rR1ZouqjY",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1596384899017,
"version": 1,
"sender": "3N7ZQDNskguAikFYpHDs3nSLEqZ1kcawW2w",
"senderPublicKey": "9Q2WA38S5hRejUw8CCQ7qorks92Bg8C8Mbfqwj6mQZgV",
"proofs": [
"2nZjxn7f6UzRskHK3yGHb2Nn9DKwNtMoMzYiYKGydWkZPVuHHicmydht94m5HquBNJhXCaTLETn39XW38CQqtNio"
],
"script": "base64:AAIDAAAAAAAAAAgIARIECgIICAAAAAAAAAABAAAAAWkBAAAABXN3YXBwAAAAAgAAAAxzd2FwcEFzc2V0SWQAAAACaWQEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAAlwbXRBbW91bnQIBQAAAANwbXQAAAAGYW1vdW50BAAAAAdhc3NldGlkCQACWQAAAAEFAAAAAmlkBAAAAAxzd2FwcGFzc2V0aWQJAAJZAAAAAQUAAAAMc3dhcHBBc3NldElkBAAAAA1hc3NldFF1YW50aXR5BAAAAAckbWF0Y2gwCQAD7AAAAAEFAAAAB2Fzc2V0aWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABUFzc2V0BAAAAAVhc3NldAUAAAAHJG1hdGNoMAgFAAAABWFzc2V0AAAACHF1YW50aXR5CQAAAgAAAAECAAAAEENhbid0IGZpbmQgYXNzZXQEAAAADHdhcHBRdWFudGl0eQQAAAAHJG1hdGNoMAkAA+wAAAABBQAAAAxzd2FwcGFzc2V0aWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABUFzc2V0BAAAAAVhc3N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QABkQAAAAIIBQAAAANkdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAADZHR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAA3N0eAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAADc3R4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAADc3R4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAA3N0eAAAAA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAA3R0eAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAADdHR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAADdHR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAA3R0eAAAAA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF01hc3NUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAANtdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAA210eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAA210eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAANtdHgAAAAPc2VuZGVyUHVibGljS2V5B0xdmRQ=",
"chainId": 84,
"height": 1114951,
"spentComplexity": 0
}
View: original | compacted
Prev: DxK1tED6kmrUjyqn3xemmwpza1SJNzkbiVqLRFCSNK5y
Next: 9n6u2qcU3G1mZFMTRT1rn3wSv45cnBmRz4nRw1aDgo2t
Diff:
Old | New | | Differences |
---|
25 | 25 | | if ((beforeRate > 1)) |
---|
26 | 26 | | then { |
---|
27 | 27 | | let sendAmount = (pmtAmount * 1) |
---|
28 | | - | TransferSet([ScriptTransfer(i.caller, sendAmount, swappassetid)]) |
---|
| 28 | + | if ((sendAmount > 100000000000)) |
---|
| 29 | + | then throw("Not SWAPP over 1000 WAPP") |
---|
| 30 | + | else TransferSet([ScriptTransfer(i.caller, sendAmount, swappassetid)]) |
---|
29 | 31 | | } |
---|
30 | 32 | | else if ((1 > beforeRate)) |
---|
31 | 33 | | then { |
---|
32 | 34 | | let sendAmount = (pmtAmount * beforeRate) |
---|
33 | | - | TransferSet([ScriptTransfer(i.caller, sendAmount, swappassetid)]) |
---|
| 35 | + | if ((sendAmount > 100000000000)) |
---|
| 36 | + | then throw("Not SWAPP over 1000 WAPP") |
---|
| 37 | + | else TransferSet([ScriptTransfer(i.caller, sendAmount, swappassetid)]) |
---|
34 | 38 | | } |
---|
35 | 39 | | else throw("Not SWAPP") |
---|
36 | 40 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func swapp (swappAssetId,id) = { |
---|
8 | 8 | | let pmt = extract(i.payment) |
---|
9 | 9 | | let pmtAmount = pmt.amount |
---|
10 | 10 | | let assetid = fromBase58String(id) |
---|
11 | 11 | | let swappassetid = fromBase58String(swappAssetId) |
---|
12 | 12 | | let assetQuantity = match assetInfo(assetid) { |
---|
13 | 13 | | case asset: Asset => |
---|
14 | 14 | | asset.quantity |
---|
15 | 15 | | case _ => |
---|
16 | 16 | | throw("Can't find asset") |
---|
17 | 17 | | } |
---|
18 | 18 | | let wappQuantity = match assetInfo(swappassetid) { |
---|
19 | 19 | | case asset: Asset => |
---|
20 | 20 | | asset.quantity |
---|
21 | 21 | | case _ => |
---|
22 | 22 | | throw("Can't find asset") |
---|
23 | 23 | | } |
---|
24 | 24 | | let beforeRate = (wappQuantity / assetQuantity) |
---|
25 | 25 | | if ((beforeRate > 1)) |
---|
26 | 26 | | then { |
---|
27 | 27 | | let sendAmount = (pmtAmount * 1) |
---|
28 | | - | TransferSet([ScriptTransfer(i.caller, sendAmount, swappassetid)]) |
---|
| 28 | + | if ((sendAmount > 100000000000)) |
---|
| 29 | + | then throw("Not SWAPP over 1000 WAPP") |
---|
| 30 | + | else TransferSet([ScriptTransfer(i.caller, sendAmount, swappassetid)]) |
---|
29 | 31 | | } |
---|
30 | 32 | | else if ((1 > beforeRate)) |
---|
31 | 33 | | then { |
---|
32 | 34 | | let sendAmount = (pmtAmount * beforeRate) |
---|
33 | | - | TransferSet([ScriptTransfer(i.caller, sendAmount, swappassetid)]) |
---|
| 35 | + | if ((sendAmount > 100000000000)) |
---|
| 36 | + | then throw("Not SWAPP over 1000 WAPP") |
---|
| 37 | + | else TransferSet([ScriptTransfer(i.caller, sendAmount, swappassetid)]) |
---|
34 | 38 | | } |
---|
35 | 39 | | else throw("Not SWAPP") |
---|
36 | 40 | | } |
---|
37 | 41 | | |
---|
38 | 42 | | |
---|
39 | 43 | | @Verifier(tx) |
---|
40 | 44 | | func verify () = match tx { |
---|
41 | 45 | | case dtx: DataTransaction => |
---|
42 | 46 | | sigVerify(dtx.bodyBytes, dtx.proofs[0], dtx.senderPublicKey) |
---|
43 | 47 | | case stx: SetScriptTransaction => |
---|
44 | 48 | | sigVerify(stx.bodyBytes, stx.proofs[0], stx.senderPublicKey) |
---|
45 | 49 | | case ttx: TransferTransaction => |
---|
46 | 50 | | sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) |
---|
47 | 51 | | case mtx: MassTransferTransaction => |
---|
48 | 52 | | sigVerify(mtx.bodyBytes, mtx.proofs[0], mtx.senderPublicKey) |
---|
49 | 53 | | case _ => |
---|
50 | 54 | | false |
---|
51 | 55 | | } |
---|
52 | 56 | | |
---|