tx · 2rewbW6DzYJ2m9TpMftnNiHdzay3kRDrHkuiiVbaMkQh 3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD: -0.01000000 Waves 2023.07.30 13:26 [2688483] smart account 3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD > SELF 0.00000000 Waves
{ "type": 13, "id": "2rewbW6DzYJ2m9TpMftnNiHdzay3kRDrHkuiiVbaMkQh", "fee": 1000000, "feeAssetId": null, "timestamp": 1690712749036, "version": 2, "chainId": 84, "sender": "3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD", "senderPublicKey": "G6PnkMn8MpXBkNwsQKMn1o1V7EKMgZyHCJRdFMQuouBC", "proofs": [ "5EDRFeMcStinCpgxsZXHVwCqwRy69RAsux2DfeY4zYVg8DGhAmga97vLq8c75BfXTYvxofx7dei6cDTht78c235S" ], "script": "base64:BgIHCAISAwoBCAgAEGNvbnRyYWN0RmlsZU5hbWUCAnAxAA10b2tlbl9hZGRyZXNzCQEHQWRkcmVzcwEBGgFUUevquKc82yLj6POP0d8MGx4c9yM7LkYsAANTRVACASAACGthc3NldElkAgdBc3NldElEAQZrZXlNc2cACQC5CQIJAMwIAgICJXMJAMwIAgIp0J/QtdGA0LXQtNCw0L3QvdC+0LUg0YHQvtC+0LHRidC10L3QuNC1OiAFA25pbAUDU0VQAQprZXlBc3NldElEAAkAuQkCCQDMCAICAiVzCQDMCAICB2Fzc2V0SUQFA25pbAUDU0VQAQd3cmFwRXJyAQNtc2cJALkJAgkAzAgCBRBjb250cmFjdEZpbGVOYW1lCQDMCAICAToJAMwIAgUDbXNnBQNuaWwCAAEIdGhyb3dFcnIBA21zZwkAAgEJAQd3cmFwRXJyAQUDbXNnAQFpAQdtZXNzYWdlAQNtc2cEBXdvcmRzCQC1CQIFA21zZwUDU0VQBAl3b3JkQ291bnQJAJADAQUFd29yZHMECmdldEFzc2V0SUQJARFAZXh0ck5hdGl2ZSgxMDUzKQIFDXRva2VuX2FkZHJlc3MFCGthc3NldElkBA90b0J5dGVzX2Fzc2V0SUQJAJsDAQUKZ2V0QXNzZXRJRAQHcGF5bWVudAkAkQMCCAUBaQhwYXltZW50cwAABA5wYXltZW50X2Ftb3VudAgJAJEDAggFAWkIcGF5bWVudHMAAAZhbW91bnQDCQECIT0CBQ5wYXltZW50X2Ftb3VudAUJd29yZENvdW50CQEIdGhyb3dFcnIBAjLQmtC+0Lst0LLQviDRgdC70L7QsiAhPSDQutC+0Lst0LLRgyDRgtC+0LrQtdC90L7QsgMJAAACBQ90b0J5dGVzX2Fzc2V0SUQICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAkBCHRocm93RXJyAQJ20J/Qu9Cw0YLQtdC2INC00L7Qu9C20LXQvSDQsdGL0YLRjCDRgNCw0LLQtdC9INC60L7Qu9C40YfQtdGB0YLQstGDINGB0LvQvtCyINCyINC/0LXRgNC10LTQsNC90L3QvtC8INGB0L7QvtCx0YnQtdC90LjQuAkAzAgCCQELU3RyaW5nRW50cnkCBQhrYXNzZXRJZAUKZ2V0QXNzZXRJRAkAzAgCCQELU3RyaW5nRW50cnkCCQEGa2V5TXNnAAUDbXNnBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5FwT44Q==", "height": 2688483, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2oVz1zWkS44twHLxVoA5vh7GnVCVAGWe4D9ncLW95L9a Next: FafG5DvVanaRDEkCksLGrm7X1z6BKffizJEzQtzvwLwr Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | let toBytes_assetID = toBytes(getAssetID) | |
30 | 30 | let payment = i.payments[0] | |
31 | 31 | let payment_amount = i.payments[0].amount | |
32 | - | | |
33 | - | then ( | |
34 | - | else | |
35 | - | then | |
36 | - | else | |
32 | + | if ((payment_amount != wordCount)) | |
33 | + | then throwErr("Кол-во слов != кол-ву токенов") | |
34 | + | else if ((toBytes_assetID == i.payments[0].assetId)) | |
35 | + | then throwErr("Платеж должен быть равен количеству слов в переданном сообщении") | |
36 | + | else [StringEntry(kassetId, getAssetID), StringEntry(keyMsg(), msg)] | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFileName = "p1" | |
5 | 5 | ||
6 | 6 | let token_address = Address(base58'3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD') | |
7 | 7 | ||
8 | 8 | let SEP = " " | |
9 | 9 | ||
10 | 10 | let kassetId = "AssetID" | |
11 | 11 | ||
12 | 12 | func keyMsg () = makeString(["%s", "Переданное сообщение: "], SEP) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func keyAssetID () = makeString(["%s", "assetID"], SEP) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func wrapErr (msg) = makeString([contractFileName, ":", msg], "") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func throwErr (msg) = throw(wrapErr(msg)) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func message (msg) = { | |
26 | 26 | let words = split(msg, SEP) | |
27 | 27 | let wordCount = size(words) | |
28 | 28 | let getAssetID = getStringValue(token_address, kassetId) | |
29 | 29 | let toBytes_assetID = toBytes(getAssetID) | |
30 | 30 | let payment = i.payments[0] | |
31 | 31 | let payment_amount = i.payments[0].amount | |
32 | - | | |
33 | - | then ( | |
34 | - | else | |
35 | - | then | |
36 | - | else | |
32 | + | if ((payment_amount != wordCount)) | |
33 | + | then throwErr("Кол-во слов != кол-ву токенов") | |
34 | + | else if ((toBytes_assetID == i.payments[0].assetId)) | |
35 | + | then throwErr("Платеж должен быть равен количеству слов в переданном сообщении") | |
36 | + | else [StringEntry(kassetId, getAssetID), StringEntry(keyMsg(), msg)] | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | @Verifier(tx) | |
41 | 41 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
42 | 42 |
github/deemru/w8io/169f3d6 48.65 ms ◑