tx · DZvUv44d7MepV29V7XMH89rPWn4vCDLiR8axb57WeUXj
3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD: -0.01000000 Waves
2023.07.30 14:16 [2688528] smart account 3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD > SELF 0.00000000 Waves
{
"type": 13,
"id": "DZvUv44d7MepV29V7XMH89rPWn4vCDLiR8axb57WeUXj",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1690715790284,
"version": 2,
"chainId": 84,
"sender": "3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD",
"senderPublicKey": "G6PnkMn8MpXBkNwsQKMn1o1V7EKMgZyHCJRdFMQuouBC",
"proofs": [
"3BY9GqxPL7ZKTeGTXcKS6fWD2u3XtbEuvYnni4MKSKtfLgbc7om63ozfwu6nXYaFYwV5y9wwic6fy7yJgweHYeSp"
],
"script": "base64:BgIHCAISAwoBCAgAEGNvbnRyYWN0RmlsZU5hbWUCAnAxAA10b2tlbl9hZGRyZXNzCQEHQWRkcmVzcwEBGgFUUevquKc82yLj6POP0d8MGx4c9yM7LkYsAANTRVACASAACGthc3NldElkAgdBc3NldElEAQZrZXlNc2cACQC5CQIJAMwIAgICJXMJAMwIAgIp0J/QtdGA0LXQtNCw0L3QvdC+0LUg0YHQvtC+0LHRidC10L3QuNC1OiAFA25pbAUDU0VQAQprZXlBc3NldElEAAkAuQkCCQDMCAICAiVzCQDMCAICB2Fzc2V0SUQFA25pbAUDU0VQAQd3cmFwRXJyAQNtc2cJALkJAgkAzAgCBRBjb250cmFjdEZpbGVOYW1lCQDMCAICAToJAMwIAgUDbXNnBQNuaWwCAAEIdGhyb3dFcnIBA21zZwkAAgEJAQd3cmFwRXJyAQUDbXNnAQFpAQdtZXNzYWdlAQNtc2cEBXdvcmRzCQC1CQIFA21zZwUDU0VQBAl3b3JkQ291bnQJAJADAQUFd29yZHMEB3BheW1lbnQJAJEDAggFAWkIcGF5bWVudHMAAAQOcGF5bWVudF9hbW91bnQICQCRAwIIBQFpCHBheW1lbnRzAAAGYW1vdW50AwkBAiE9AgUOcGF5bWVudF9hbW91bnQFCXdvcmRDb3VudAkBCHRocm93RXJyAQIy0JrQvtC7LdCy0L4g0YHQu9C+0LIgIT0g0LrQvtC7LdCy0YMg0YLQvtC60LXQvdC+0LIDCQAAAgEhETjui5BwgM7t2anpXm9A2pY3WzHpaxK8FWRPhw4Bo1GXCAkAkQMCCAUBaQhwYXltZW50cwAAB2Fzc2V0SWQJAQh0aHJvd0VycgECLtCf0LvQsNGC0LXQtiDQtNC+0LvQttC10L0g0LHRi9GC0Ywg0LIgUFJBQ1RJQ0UJAMwIAgkBC1N0cmluZ0VudHJ5AgUIa2Fzc2V0SWQFEGNvbnRyYWN0RmlsZU5hbWUJAMwIAgkBC1N0cmluZ0VudHJ5AgkBBmtleU1zZwAFA21zZwUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleXHycJc=",
"height": 2688528,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: h8bsiUMBLDnnbG3YpUVZi6cfnoorRfzvaZVG9jzg8J7
Next: H6oRCa1f4g9FNwMekmVMi7GwJJKWu9keasgyhNTwybRL
Diff:
Old | New | | Differences |
---|
25 | 25 | | func message (msg) = { |
---|
26 | 26 | | let words = split(msg, SEP) |
---|
27 | 27 | | let wordCount = size(words) |
---|
28 | | - | let getAssetID = getStringValue(this, kassetId) |
---|
29 | | - | let toBytes_assetID = toBytes(getAssetID) |
---|
30 | 28 | | let payment = i.payments[0] |
---|
31 | 29 | | let payment_amount = i.payments[0].amount |
---|
32 | 30 | | if ((payment_amount != wordCount)) |
---|
33 | 31 | | then throwErr("Кол-во слов != кол-ву токенов") |
---|
34 | | - | else if ((toBytes_assetID == i.payments[0].assetId)) |
---|
35 | | - | then throwErr("Платеж должен быть равен количеству слов в переданном сообщении") |
---|
36 | | - | else [StringEntry(kassetId, getAssetID), StringEntry(keyMsg(), msg)] |
---|
| 32 | + | else if ((base58'67jd6w7KdYT8s2sPCfkP7B3jMoXXeSnM9UjwtvBPp19yQ' == i.payments[0].assetId)) |
---|
| 33 | + | then throwErr("Платеж должен быть в PRACTICE") |
---|
| 34 | + | else [StringEntry(kassetId, contractFileName), StringEntry(keyMsg(), msg)] |
---|
37 | 35 | | } |
---|
38 | 36 | | |
---|
39 | 37 | | |
---|
Full:
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 | | - | let getAssetID = getStringValue(this, kassetId) |
---|
29 | | - | let toBytes_assetID = toBytes(getAssetID) |
---|
30 | 28 | | let payment = i.payments[0] |
---|
31 | 29 | | let payment_amount = i.payments[0].amount |
---|
32 | 30 | | if ((payment_amount != wordCount)) |
---|
33 | 31 | | then throwErr("Кол-во слов != кол-ву токенов") |
---|
34 | | - | else if ((toBytes_assetID == i.payments[0].assetId)) |
---|
35 | | - | then throwErr("Платеж должен быть равен количеству слов в переданном сообщении") |
---|
36 | | - | else [StringEntry(kassetId, getAssetID), StringEntry(keyMsg(), msg)] |
---|
| 32 | + | else if ((base58'67jd6w7KdYT8s2sPCfkP7B3jMoXXeSnM9UjwtvBPp19yQ' == i.payments[0].assetId)) |
---|
| 33 | + | then throwErr("Платеж должен быть в PRACTICE") |
---|
| 34 | + | else [StringEntry(kassetId, contractFileName), StringEntry(keyMsg(), msg)] |
---|
37 | 35 | | } |
---|
38 | 36 | | |
---|
39 | 37 | | |
---|
40 | 38 | | @Verifier(tx) |
---|
41 | 39 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
42 | 40 | | |
---|