tx · FDGGLedXrXhD2SQ8hjBPjX3d4jSPDG36cniShg2ErdyD
3N65E1rYWAxQMCLg27pRxBFtAt3bPcH3pys: -0.01400000 Waves
2022.02.11 15:39 [1918959] smart account 3N65E1rYWAxQMCLg27pRxBFtAt3bPcH3pys > SELF 0.00000000 Waves
{
"type": 13,
"id": "FDGGLedXrXhD2SQ8hjBPjX3d4jSPDG36cniShg2ErdyD",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1644583190918,
"version": 2,
"chainId": 84,
"sender": "3N65E1rYWAxQMCLg27pRxBFtAt3bPcH3pys",
"senderPublicKey": "HUBVsBcuExqVSbV3mSVhpdKfgihF2nwdtpGmpVLRwxEN",
"proofs": [
"52gUe1qwNNqLbmK84eDQb582EjKrMfbjpRpg6JPbm7frNjC6x4wJ9bpxp7GdnZgyNbRZzgiPraNQZQtM7HTEkgpR"
],
"script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQgAAAABAAAAAAd0b2tlbklkAgAAACw2bjdMazYyQVpVSlRkVFlIeFNnTllUN29wYTJoQVlKQWtudEJDbnlrYzNDRgAAAAIAAAABaQEAAAALYWNjZXB0VG9rZW4AAAAABAAAAAJvaQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAADcG10AwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAFUF0dGFjaCBwYXltZW50IHBsZWFzZQMJAABnAAAAAgAAAAAAAAAAAAgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAdUGF5bWVudCBhbW91bnQgc2hvdWxkIGJlID4gMCAEAAAABWFzc2lkBAAAAAckbWF0Y2gwCAUAAAADcG10AAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEJAAGbAAAAAQIAAAADZmRzAwkAAAAAAAACCQACWAAAAAEFAAAABWFzc2lkBQAAAAd0b2tlbklkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQACWAAAAAEFAAAABWFzc2lkBQAAAANuaWwJAAACAAAAAQIAAAANSW52YWxpZCBhc3NldAAAAAFpAQAAAAh0cmFuc2ZlcgAAAAEAAAAJcmVjaXBpZW50BAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAPQXR0YWNoIHBheW1lbnRzBAAAAAdhc3NldElkCAUAAAADcG10AAAAB2Fzc2V0SWQEAAAABmFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQEAAAAA3JlYwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAJcmVjaXBpZW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAA3JlYwUAAAAGYW1vdW50BQAAAAdhc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleR8sUjg=",
"height": 1918959,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: J9xqF6HbBMgRmBiBSEaPXGgBQA1RBVd2kpu4RLSDiajK
Next: 6QypPrkWmbfXXuKxmhJckxu4NWzeTthXU86nzPKkZ8Ls
Diff:
Old | New | | Differences |
---|
18 | 18 | | case _ => |
---|
19 | 19 | | toBytes("fds") |
---|
20 | 20 | | } |
---|
21 | | - | [StringEntry(toString(i.caller), toBase58String(assid))] |
---|
| 21 | + | if ((toBase58String(assid) == tokenId)) |
---|
| 22 | + | then [StringEntry(toString(i.caller), toBase58String(assid))] |
---|
| 23 | + | else throw("Invalid asset") |
---|
22 | 24 | | } |
---|
23 | 25 | | } |
---|
24 | 26 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let tokenId = "6n7Lk62AZUJTdTYHxSgNYT7opa2hAYJAkntBCnykc3CF" |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func acceptToken () = { |
---|
8 | 8 | | let oi = i.payments[0] |
---|
9 | 9 | | let pmt = if ((size(i.payments) == 1)) |
---|
10 | 10 | | then i.payments[0] |
---|
11 | 11 | | else throw("Attach payment please") |
---|
12 | 12 | | if ((0 >= pmt.amount)) |
---|
13 | 13 | | then throw("Payment amount should be > 0 ") |
---|
14 | 14 | | else { |
---|
15 | 15 | | let assid = match pmt.assetId { |
---|
16 | 16 | | case a: ByteVector => |
---|
17 | 17 | | a |
---|
18 | 18 | | case _ => |
---|
19 | 19 | | toBytes("fds") |
---|
20 | 20 | | } |
---|
21 | | - | [StringEntry(toString(i.caller), toBase58String(assid))] |
---|
| 21 | + | if ((toBase58String(assid) == tokenId)) |
---|
| 22 | + | then [StringEntry(toString(i.caller), toBase58String(assid))] |
---|
| 23 | + | else throw("Invalid asset") |
---|
22 | 24 | | } |
---|
23 | 25 | | } |
---|
24 | 26 | | |
---|
25 | 27 | | |
---|
26 | 28 | | |
---|
27 | 29 | | @Callable(i) |
---|
28 | 30 | | func transfer (recipient) = { |
---|
29 | 31 | | let pmt = if ((size(i.payments) == 1)) |
---|
30 | 32 | | then i.payments[0] |
---|
31 | 33 | | else throw("Attach payments") |
---|
32 | 34 | | let assetId = pmt.assetId |
---|
33 | 35 | | let amount = pmt.amount |
---|
34 | 36 | | let rec = addressFromStringValue(recipient) |
---|
35 | 37 | | [ScriptTransfer(rec, amount, assetId)] |
---|
36 | 38 | | } |
---|
37 | 39 | | |
---|
38 | 40 | | |
---|
39 | 41 | | @Verifier(tx) |
---|
40 | 42 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
41 | 43 | | |
---|