tx · 89y9eg7Kx7BUP1VBgSA6bqcC6wEaVwPpbKGkeYCG7jkp 3My9gyZE1qYKsCtVCWWawEKmYTozn25fe7A: -0.01400000 Waves 2020.12.13 14:40 [1306868] smart account 3My9gyZE1qYKsCtVCWWawEKmYTozn25fe7A > SELF 0.00000000 Waves
{ "type": 13, "id": "89y9eg7Kx7BUP1VBgSA6bqcC6wEaVwPpbKGkeYCG7jkp", "fee": 1400000, "feeAssetId": null, "timestamp": 1607859622954, "version": 2, "chainId": 84, "sender": "3My9gyZE1qYKsCtVCWWawEKmYTozn25fe7A", "senderPublicKey": "3ugY6FcewrehbRyn2AHQdV4kxmZsXKpx7W2u6ZzVF7Vx", "proofs": [ "2iKWH9DEGrcMjbHYMLRYawHp5apt3pLpgXXxEn4QRZZQxK5wjoaAsei2TzDWaSvDCwmUJHcquHkbcHLYBCMBds9v" ], "script": "base64:AAIEAAAAAAAAAAoIAhIGCgQIAQEBAAAADQAAAAALYWRtaW5QdWJLZXkCAAAAIzNNeTlneVpFMXFZS3NDdFZDV1dhd0VLbVlUb3puMjVmZTdBAQAAABhnZXROdW1iZXJCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAAB2FkZHJlc3MFAAAAA2tleQAAAAAAAAAAAAEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAdhZGRyZXNzBQAAAANrZXkCAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgkBAAAAEUBleHRyTm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dAkABLUAAAACBQAAAAlhZGRyZXNzZXMCAAAAASwDCQEAAAAPY29udGFpbnNFbGVtZW50AAAAAgUAAAANYWRkcmVzc2VzTGlzdAUAAAAJY2FsbGVyU3RyCQAAAgAAAAECAAAAKkVycm9yISBDYWxsZXIgY2FuIG5vdCBiZSBpbiBhZGRyZXNzZXMgbGlzdAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAAPZ2V0S2V5QWRkcmVzc2VzAAAAAQUAAAAJY2FsbGVyU3RyBQAAAAlhZGRyZXNzZXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAQAAAA5nZXRLZXlEaXNjb3VudAAAAAEFAAAACWNhbGxlclN0cgUAAAAIZGlzY291bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAQAAAAxnZXRLZXlBbW91bnQAAAABBQAAAAljYWxsZXJTdHIFAAAABmFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAEmdldEtleUVuZFRpbWVzdGFtcAAAAAEFAAAACWNhbGxlclN0cgUAAAAMZW5kVGltZXN0YW1wBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleX9Wv5U=", "height": 1306868, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8jMkibRQgDpNix6MaZctJv2fjSCvRVCSvzQ11NT81Tgg Next: J9ZUch8L3mCACuMFiWxifFGjutgBnMo4K3GcBw4fG89T Diff:
Old | New | Differences | |
---|---|---|---|
30 | 30 | func getKeyAddresses (key) = (key + "_addressesList") | |
31 | 31 | ||
32 | 32 | ||
33 | + | func getKeyDiscount (key) = (key + "_discount") | |
34 | + | ||
35 | + | ||
36 | + | func getKeyAmount (key) = (key + "_amount") | |
37 | + | ||
38 | + | ||
39 | + | func getKeyEndTimestamp (key) = (key + "_endTimestamp") | |
40 | + | ||
41 | + | ||
33 | 42 | @Callable(i) | |
34 | - | func addAuction (addresses) = { | |
43 | + | func addAuction (addresses,discount,amount,endTimestamp) = { | |
35 | 44 | let callerStr = toBase58String(i.caller.bytes) | |
36 | - | let addressesStr = makeString(addresses, ",") | |
37 | - | [StringEntry(getKeyAddresses(callerStr), addressesStr)] | |
45 | + | let addressesList = split(addresses, ",") | |
46 | + | if (containsElement(addressesList, callerStr)) | |
47 | + | then throw("Error! Caller can not be in addresses list") | |
48 | + | else [StringEntry(getKeyAddresses(callerStr), addresses), IntegerEntry(getKeyDiscount(callerStr), discount), IntegerEntry(getKeyAmount(callerStr), amount), IntegerEntry(getKeyEndTimestamp(callerStr), endTimestamp)] | |
38 | 49 | } | |
39 | 50 | ||
40 | 51 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey = "3My9gyZE1qYKsCtVCWWawEKmYTozn25fe7A" | |
5 | 5 | ||
6 | 6 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(addressFromStringValue(address), key), "") | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(addressFromStringValue(address), key), false) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func getBoolByKey (key) = valueOrElse(getBoolean(this, key), false) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func getKeyCustomerName (key) = (key + "_customerName") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getKeyCustomerRequisits (key) = (key + "_customerReq") | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func getKeyAddresses (key) = (key + "_addressesList") | |
31 | 31 | ||
32 | 32 | ||
33 | + | func getKeyDiscount (key) = (key + "_discount") | |
34 | + | ||
35 | + | ||
36 | + | func getKeyAmount (key) = (key + "_amount") | |
37 | + | ||
38 | + | ||
39 | + | func getKeyEndTimestamp (key) = (key + "_endTimestamp") | |
40 | + | ||
41 | + | ||
33 | 42 | @Callable(i) | |
34 | - | func addAuction (addresses) = { | |
43 | + | func addAuction (addresses,discount,amount,endTimestamp) = { | |
35 | 44 | let callerStr = toBase58String(i.caller.bytes) | |
36 | - | let addressesStr = makeString(addresses, ",") | |
37 | - | [StringEntry(getKeyAddresses(callerStr), addressesStr)] | |
45 | + | let addressesList = split(addresses, ",") | |
46 | + | if (containsElement(addressesList, callerStr)) | |
47 | + | then throw("Error! Caller can not be in addresses list") | |
48 | + | else [StringEntry(getKeyAddresses(callerStr), addresses), IntegerEntry(getKeyDiscount(callerStr), discount), IntegerEntry(getKeyAmount(callerStr), amount), IntegerEntry(getKeyEndTimestamp(callerStr), endTimestamp)] | |
38 | 49 | } | |
39 | 50 | ||
40 | 51 | ||
41 | 52 | @Verifier(tx) | |
42 | 53 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
43 | 54 |
github/deemru/w8io/169f3d6 23.36 ms ◑