tx · BZKPs751HudaDGvm2tDsQk8KGgQnZrpGCySvm4C9dizE 3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL: -0.01400000 Waves 2020.01.31 11:34 [878283] smart account 3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL > SELF 0.00000000 Waves
{ "type": 13, "id": "BZKPs751HudaDGvm2tDsQk8KGgQnZrpGCySvm4C9dizE", "fee": 1400000, "feeAssetId": null, "timestamp": 1580459711377, "version": 1, "sender": "3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL", "senderPublicKey": "f1NbgbpkRpbigsrHaDkWZAkPgcqd8GM5G5eNmqnTD6z", "proofs": [ "3MkXBZ42S4GNnSMPwPqjoK2sStFHLNLMcaGQc2Lj6yQVwUaUXAH2R4M9V1FBNosHBNb9Yg68rqnsbqw7fTgWudPp" ], "script": "base64:AAIDAAAAAAAAAA8IARIFCgMICAgSBAoCCAgAAAAGAAAAAA1hY2NlcHRlZFRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wAAAAAMY3VycmVudFByaWNlAAAAAAAO5rKAAAAAAARiYW5rAgAAACMzTXpZTGtRNnFDd3RieGFZUTJ5azFrZFV1ZHpiTmc0SmlURwEAAAAIaXNBZHJlc3MAAAABAAAABGFkZHIDCQAAAAAAAAIJAAExAAAAAQUAAAAEYWRkcgAAAAAAAAAAIwkAAAAAAAACCQABLwAAAAIFAAAABGFkZHIAAAAAAAAAAAICAAAAAjNOBwEAAAAMY291bnRQYXJ0aWVzAAAAAgAAAAthY2N1bXVsYXRvcgAAAARhZGRyAwkBAAAACGlzQWRyZXNzAAAAAQUAAAAEYWRkcgkAAGQAAAACBQAAAAthY2N1bXVsYXRvcgAAAAAAAAAAAQkAAGQAAAACBQAAAAthY2N1bXVsYXRvcgAAAAAAAAAAAAEAAAAIZ2V0VmFsdWUAAAACAAAABGpzb24AAAADa2V5BAAAAAhrZXlJbmRleAkBAAAABXZhbHVlAAAAAQkABLM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ICAAAABF9NQV8JAAJYAAAAAQUAAAACaWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwkAAAIAAAABAgAAAClUaGVyZSBpcyBubyBjb3JyZXNwb25kaW5nIHNpZ25pbmcgcmVxdWVzdAQAAAAOcGF5bWVudEFzc2V0SWQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAB3BheW1lbnQAAAAHYXNzZXRJZAkBAAAAB2V4dHJhY3QAAAABCAUAAAAHcGF5bWVudAAAAAdhc3NldElkCQAAAgAAAAECAAAAIFdhdmVzIGlzIG5vdCBhY2NlcHRlZCBhcyBwYXltZW50AwkBAAAAAiE9AAAAAgUAAAAOcGF5bWVudEFzc2V0SWQFAAAADWFjY2VwdGVkVG9rZW4JAAACAAAAAQIAAAAvT25seSBwYXltZW50cyBpbiBTSUdOIGFyZSBhbGxvd2VkIGF0IHRoZSBtb21lbnQDCQEAAAACIT0AAAACBQAAAAZhbW91bnQFAAAADGN1cnJlbnRQcmljZQkAAAIAAAABAgAAABJUaGUgcHJpY2UgaXMgd3JvbmcJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAGc2lnbmVyAgAAAARfTUFfCQACWAAAAAEFAAAAAmlkAgAAAAZTSUdORUQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAABGJhbmsFAAAABmFtb3VudAUAAAANYWNjZXB0ZWRUb2tlbgUAAAADbmlsAAAAACccqTE=", "chainId": 84, "height": 878283, "spentComplexity": 0 } View: original | compacted Prev: Ev6hgabguv79trndXe9YP7vkRTqLjc6NWUSPXFLfxub7 Next: 8bj9Kt8uaZYTmSgJyosjUVqsSmxSC2LSUc2TVDiEBn7A Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | else (accumulator + 0) | |
18 | 18 | ||
19 | 19 | ||
20 | + | func getValue (json,key) = { | |
21 | + | let keyIndex = value(indexOf(json, (("\"" + key) + "\":"))) | |
22 | + | let data = drop(json, ((keyIndex + size(key)) + 3)) | |
23 | + | data | |
24 | + | } | |
25 | + | ||
26 | + | ||
20 | 27 | @Callable(invoke) | |
21 | 28 | func createAgreement (hash,title,addresses) = { | |
22 | 29 | let payment = extract(invoke.payment) | |
23 | 30 | let amount = extract(payment.amount) | |
24 | 31 | let id = extract(invoke.transactionId) | |
25 | - | let addressesArray = | |
32 | + | let addressesArray = [getValue(addresses, "address1"), getValue(addresses, "address2"), getValue(addresses, "address3"), getValue(addresses, "address4"), getValue(addresses, "address5"), getValue(addresses, "address6")] | |
26 | 33 | let totalAddresses = { | |
27 | - | let $ | |
28 | - | let $ | |
29 | - | let $ | |
30 | - | if (($ | |
31 | - | then $ | |
34 | + | let $list11491189 = addressesArray | |
35 | + | let $size11491189 = size($list11491189) | |
36 | + | let $acc011491189 = 0 | |
37 | + | if (($size11491189 == 0)) | |
38 | + | then $acc011491189 | |
32 | 39 | else { | |
33 | - | let $ | |
34 | - | if (($ | |
35 | - | then $ | |
40 | + | let $acc111491189 = countParties($acc011491189, $list11491189[0]) | |
41 | + | if (($size11491189 == 1)) | |
42 | + | then $acc111491189 | |
36 | 43 | else { | |
37 | - | let $ | |
38 | - | if (($ | |
39 | - | then $ | |
44 | + | let $acc211491189 = countParties($acc111491189, $list11491189[1]) | |
45 | + | if (($size11491189 == 2)) | |
46 | + | then $acc211491189 | |
40 | 47 | else { | |
41 | - | let $ | |
42 | - | if (($ | |
43 | - | then $ | |
48 | + | let $acc311491189 = countParties($acc211491189, $list11491189[2]) | |
49 | + | if (($size11491189 == 3)) | |
50 | + | then $acc311491189 | |
44 | 51 | else { | |
45 | - | let $ | |
46 | - | if (($ | |
47 | - | then $ | |
52 | + | let $acc411491189 = countParties($acc311491189, $list11491189[3]) | |
53 | + | if (($size11491189 == 4)) | |
54 | + | then $acc411491189 | |
48 | 55 | else { | |
49 | - | let $ | |
50 | - | if (($ | |
51 | - | then $ | |
56 | + | let $acc511491189 = countParties($acc411491189, $list11491189[4]) | |
57 | + | if (($size11491189 == 5)) | |
58 | + | then $acc511491189 | |
52 | 59 | else { | |
53 | - | let $ | |
54 | - | if (($ | |
55 | - | then $ | |
60 | + | let $acc611491189 = countParties($acc511491189, $list11491189[5]) | |
61 | + | if (($size11491189 == 6)) | |
62 | + | then $acc611491189 | |
56 | 63 | else { | |
57 | - | let $ | |
64 | + | let $acc711491189 = countParties($acc611491189, $list11491189[6]) | |
58 | 65 | throw("List size exceed 6") | |
59 | 66 | } | |
60 | 67 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
5 | 5 | ||
6 | 6 | let currentPrice = 250000000 | |
7 | 7 | ||
8 | 8 | let bank = "3MzYLkQ6qCwtbxaYQ2yk1kdUudzbNg4JiTG" | |
9 | 9 | ||
10 | 10 | func isAdress (addr) = if ((size(addr) == 35)) | |
11 | 11 | then (take(addr, 2) == "3N") | |
12 | 12 | else false | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func countParties (accumulator,addr) = if (isAdress(addr)) | |
16 | 16 | then (accumulator + 1) | |
17 | 17 | else (accumulator + 0) | |
18 | 18 | ||
19 | 19 | ||
20 | + | func getValue (json,key) = { | |
21 | + | let keyIndex = value(indexOf(json, (("\"" + key) + "\":"))) | |
22 | + | let data = drop(json, ((keyIndex + size(key)) + 3)) | |
23 | + | data | |
24 | + | } | |
25 | + | ||
26 | + | ||
20 | 27 | @Callable(invoke) | |
21 | 28 | func createAgreement (hash,title,addresses) = { | |
22 | 29 | let payment = extract(invoke.payment) | |
23 | 30 | let amount = extract(payment.amount) | |
24 | 31 | let id = extract(invoke.transactionId) | |
25 | - | let addressesArray = | |
32 | + | let addressesArray = [getValue(addresses, "address1"), getValue(addresses, "address2"), getValue(addresses, "address3"), getValue(addresses, "address4"), getValue(addresses, "address5"), getValue(addresses, "address6")] | |
26 | 33 | let totalAddresses = { | |
27 | - | let $ | |
28 | - | let $ | |
29 | - | let $ | |
30 | - | if (($ | |
31 | - | then $ | |
34 | + | let $list11491189 = addressesArray | |
35 | + | let $size11491189 = size($list11491189) | |
36 | + | let $acc011491189 = 0 | |
37 | + | if (($size11491189 == 0)) | |
38 | + | then $acc011491189 | |
32 | 39 | else { | |
33 | - | let $ | |
34 | - | if (($ | |
35 | - | then $ | |
40 | + | let $acc111491189 = countParties($acc011491189, $list11491189[0]) | |
41 | + | if (($size11491189 == 1)) | |
42 | + | then $acc111491189 | |
36 | 43 | else { | |
37 | - | let $ | |
38 | - | if (($ | |
39 | - | then $ | |
44 | + | let $acc211491189 = countParties($acc111491189, $list11491189[1]) | |
45 | + | if (($size11491189 == 2)) | |
46 | + | then $acc211491189 | |
40 | 47 | else { | |
41 | - | let $ | |
42 | - | if (($ | |
43 | - | then $ | |
48 | + | let $acc311491189 = countParties($acc211491189, $list11491189[2]) | |
49 | + | if (($size11491189 == 3)) | |
50 | + | then $acc311491189 | |
44 | 51 | else { | |
45 | - | let $ | |
46 | - | if (($ | |
47 | - | then $ | |
52 | + | let $acc411491189 = countParties($acc311491189, $list11491189[3]) | |
53 | + | if (($size11491189 == 4)) | |
54 | + | then $acc411491189 | |
48 | 55 | else { | |
49 | - | let $ | |
50 | - | if (($ | |
51 | - | then $ | |
56 | + | let $acc511491189 = countParties($acc411491189, $list11491189[4]) | |
57 | + | if (($size11491189 == 5)) | |
58 | + | then $acc511491189 | |
52 | 59 | else { | |
53 | - | let $ | |
54 | - | if (($ | |
55 | - | then $ | |
60 | + | let $acc611491189 = countParties($acc511491189, $list11491189[5]) | |
61 | + | if (($size11491189 == 6)) | |
62 | + | then $acc611491189 | |
56 | 63 | else { | |
57 | - | let $ | |
64 | + | let $acc711491189 = countParties($acc611491189, $list11491189[6]) | |
58 | 65 | throw("List size exceed 6") | |
59 | 66 | } | |
60 | 67 | } | |
61 | 68 | } | |
62 | 69 | } | |
63 | 70 | } | |
64 | 71 | } | |
65 | 72 | } | |
66 | 73 | } | |
67 | 74 | let agreementDataObject = (((((((((((((((((("{id: '" + toBase58String(id)) + "', title: '") + title) + "' hash: '") + hash) + "', address1: '") + addressesArray[0]) + "', address2: '") + addressesArray[1]) + "', address3: '") + addressesArray[2]) + "', address4: '") + addressesArray[3]) + "', address5: '") + addressesArray[4]) + "', address6: '") + addressesArray[5]) + "'}") | |
68 | 75 | let paymentAssetId = if (isDefined(payment.assetId)) | |
69 | 76 | then extract(payment.assetId) | |
70 | 77 | else throw("Waves is not accepted as payment") | |
71 | 78 | if ((paymentAssetId != acceptedToken)) | |
72 | 79 | then throw("Only payments in SIGN are allowed at the moment") | |
73 | 80 | else if (((currentPrice * totalAddresses) > amount)) | |
74 | 81 | then throw(("The price is wrong, it should be " + toString((currentPrice * totalAddresses)))) | |
75 | 82 | else if ((totalAddresses == 6)) | |
76 | 83 | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), agreementDataObject), DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
77 | 84 | else if ((totalAddresses == 5)) | |
78 | 85 | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), agreementDataObject), DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
79 | 86 | else if ((totalAddresses == 4)) | |
80 | 87 | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), agreementDataObject), DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
81 | 88 | else if ((totalAddresses == 3)) | |
82 | 89 | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), agreementDataObject), DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
83 | 90 | else if ((totalAddresses == 2)) | |
84 | 91 | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), agreementDataObject), DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
85 | 92 | else throw("Needs 2 to 6 parties addresses") | |
86 | 93 | } | |
87 | 94 | ||
88 | 95 | ||
89 | 96 | ||
90 | 97 | @Callable(invoke) | |
91 | 98 | func signAgreement (hash,agreementId) = { | |
92 | 99 | let payment = extract(invoke.payment) | |
93 | 100 | let amount = extract(payment.amount) | |
94 | 101 | let id = extract(invoke.transactionId) | |
95 | 102 | let signer = toBase58String(invoke.caller.bytes) | |
96 | 103 | let signingRequestExist = match getString(this, ((signer + "_MA_") + toBase58String(id))) { | |
97 | 104 | case s: String => | |
98 | 105 | s | |
99 | 106 | case _ => | |
100 | 107 | throw("There is no corresponding signing request") | |
101 | 108 | } | |
102 | 109 | let paymentAssetId = if (isDefined(payment.assetId)) | |
103 | 110 | then extract(payment.assetId) | |
104 | 111 | else throw("Waves is not accepted as payment") | |
105 | 112 | if ((paymentAssetId != acceptedToken)) | |
106 | 113 | then throw("Only payments in SIGN are allowed at the moment") | |
107 | 114 | else if ((amount != currentPrice)) | |
108 | 115 | then throw("The price is wrong") | |
109 | 116 | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + toBase58String(id)), "SIGNED")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken)])) | |
110 | 117 | } | |
111 | 118 | ||
112 | 119 |
github/deemru/w8io/169f3d6 113.09 ms ◑