tx · HdmBb4jvHbRBJ7L8348ggN49ZDn98SfuHv5qjFTqWUEz 3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL: -0.01400000 Waves 2020.01.31 12:44 [878354] smart account 3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL > SELF 0.00000000 Waves
{ "type": 13, "id": "HdmBb4jvHbRBJ7L8348ggN49ZDn98SfuHv5qjFTqWUEz", "fee": 1400000, "feeAssetId": null, "timestamp": 1580463886574, "version": 1, "sender": "3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL", "senderPublicKey": "f1NbgbpkRpbigsrHaDkWZAkPgcqd8GM5G5eNmqnTD6z", "proofs": [ "3wX1cyNCeeAQK6dbLbw3JhFy34Q9bL7tVunZTRFB5LvYuWQ2a53vQmGmuHxjPHpeKA8D7YudZQCiwofzC48Df2oh" ], "script": "base64:AAIDAAAAAAAAAA8IARIFCgMICAgSBAoCCAgAAAAHAAAAAAh2ZXJpZmllcgkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAAAAAEYmFuawIAAAAjM04xRTZ0WGRkUm9WYVJmUTlkUTN2ZzVMYVcyZnNkOEhLdWIBAAAACGlzQWRyZXNzAAAAAQAAAARhZGRyAwMJAAAAAAAAAgkAATEAAAABBQAAAARhZGRyAAAAAAAAAAAjCQAAAAAAAAIJAAEvAAAAAgUAAAAEYWRkcgAAAAAAAAAAAgIAAAACM04HBgkAAAAAAAACCQABLwAAAAIFAAAABGFkZHIAAAAAAAAAAAICAAAAAjNNAQAAAAxjb3VudFBhcnRpZXMAAAACAAAAC2FjY3VtdWxhdG9yAAAABGFkZHIDCQAAZgAAAAIJAAExAAAAAQUAAAAEYWRkcgAAAAAAAAAAAAkAAGQAAAACBQAAAAthY2N1bXVsYXRvcgAAAAAAAAAAAQkAAGQAAAACBQAAAAthY2N1bXVsYX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UVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAABnNpZ25lcgIAAAAEX01BXwkAAlgAAAABBQAAAAJpZAIAAAAGU0lHTkVEBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAZzaWduZXIAAAAAAAAHoSAFAAAABHVuaXQFAAAAA25pbAAAAADeUqsU", "chainId": 84, "height": 878354, "spentComplexity": 0 } View: original | compacted Prev: 6NZgQj1w47GjxNBB8NuCDG4XDCj6RqxHVDriZQavcGhT Next: F898v8TCrdgj48CH6ntwgGCjvcNitv47d9NMs2obVegQ Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let verifier = extract(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | - | let currentPrice = 250000000 | |
7 | - | ||
8 | - | let bank = "3MzYLkQ6qCwtbxaYQ2yk1kdUudzbNg4JiTG" | |
6 | + | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
9 | 7 | ||
10 | 8 | func isAdress (addr) = if (if ((size(addr) == 35)) | |
11 | 9 | then (take(addr, 2) == "3N") | |
17 | 15 | func countParties (accumulator,addr) = if ((size(addr) > 0)) | |
18 | 16 | then (accumulator + 1) | |
19 | 17 | else (accumulator + 0) | |
18 | + | ||
19 | + | ||
20 | + | func checkIfPendingToSign (key) = match getString(this, key) { | |
21 | + | case a: String => | |
22 | + | if ((a == "PENDING")) | |
23 | + | then true | |
24 | + | else false | |
25 | + | case _ => | |
26 | + | false | |
27 | + | } | |
20 | 28 | ||
21 | 29 | ||
22 | 30 | func getValueString (json) = take(drop(json, 1), value(indexOf(drop(json, 1), "\""))) | |
35 | 43 | let payment = extract(invoke.payment) | |
36 | 44 | let amount = extract(payment.amount) | |
37 | 45 | let id = extract(invoke.transactionId) | |
38 | - | let address1 = getValue(addresses, "address1") | |
39 | - | let address2 = getValue(addresses, "address2") | |
40 | - | let address3 = getValue(addresses, "address3") | |
41 | - | let address4 = getValue(addresses, "address4") | |
42 | - | let address5 = getValue(addresses, "address5") | |
43 | - | let address6 = getValue(addresses, "address6") | |
44 | - | let addressesArray = [address1, address2, address3, address4, address5, address6] | |
46 | + | let addressesArray = [getValue(addresses, "address1"), getValue(addresses, "address2"), getValue(addresses, "address3"), getValue(addresses, "address4"), getValue(addresses, "address5"), getValue(addresses, "address6")] | |
45 | 47 | let totalAddresses = { | |
46 | - | let $ | |
47 | - | let $ | |
48 | - | let $ | |
49 | - | if (($ | |
50 | - | then $ | |
48 | + | let $list15021542 = addressesArray | |
49 | + | let $size15021542 = size($list15021542) | |
50 | + | let $acc015021542 = 0 | |
51 | + | if (($size15021542 == 0)) | |
52 | + | then $acc015021542 | |
51 | 53 | else { | |
52 | - | let $ | |
53 | - | if (($ | |
54 | - | then $ | |
54 | + | let $acc115021542 = countParties($acc015021542, $list15021542[0]) | |
55 | + | if (($size15021542 == 1)) | |
56 | + | then $acc115021542 | |
55 | 57 | else { | |
56 | - | let $ | |
57 | - | if (($ | |
58 | - | then $ | |
58 | + | let $acc215021542 = countParties($acc115021542, $list15021542[1]) | |
59 | + | if (($size15021542 == 2)) | |
60 | + | then $acc215021542 | |
59 | 61 | else { | |
60 | - | let $ | |
61 | - | if (($ | |
62 | - | then $ | |
62 | + | let $acc315021542 = countParties($acc215021542, $list15021542[2]) | |
63 | + | if (($size15021542 == 3)) | |
64 | + | then $acc315021542 | |
63 | 65 | else { | |
64 | - | let $ | |
65 | - | if (($ | |
66 | - | then $ | |
66 | + | let $acc415021542 = countParties($acc315021542, $list15021542[3]) | |
67 | + | if (($size15021542 == 4)) | |
68 | + | then $acc415021542 | |
67 | 69 | else { | |
68 | - | let $ | |
69 | - | if (($ | |
70 | - | then $ | |
70 | + | let $acc515021542 = countParties($acc415021542, $list15021542[4]) | |
71 | + | if (($size15021542 == 5)) | |
72 | + | then $acc515021542 | |
71 | 73 | else { | |
72 | - | let $ | |
73 | - | if (($ | |
74 | - | then $ | |
74 | + | let $acc615021542 = countParties($acc515021542, $list15021542[5]) | |
75 | + | if (($size15021542 == 6)) | |
76 | + | then $acc615021542 | |
75 | 77 | else { | |
76 | - | let $ | |
78 | + | let $acc715021542 = countParties($acc615021542, $list15021542[6]) | |
77 | 79 | throw("List size exceed 6") | |
78 | 80 | } | |
79 | 81 | } | |
83 | 85 | } | |
84 | 86 | } | |
85 | 87 | } | |
86 | - | 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]) + "'}") | |
87 | 88 | let paymentAssetId = if (isDefined(payment.assetId)) | |
88 | 89 | then extract(payment.assetId) | |
89 | 90 | else throw("Waves is not accepted as payment") | |
90 | - | if ((paymentAssetId != acceptedToken)) | |
91 | + | let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) { | |
92 | + | case a: String => | |
93 | + | a | |
94 | + | case _ => | |
95 | + | throw("This token is not accepted at the moment") | |
96 | + | } | |
97 | + | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
98 | + | if ((acceptedToken != "WHITELISTED")) | |
91 | 99 | then throw("Only payments in SIGN are allowed at the moment") | |
92 | 100 | else if (((currentPrice * totalAddresses) > amount)) | |
93 | 101 | then throw(("The price is wrong, it should be " + toString((currentPrice * totalAddresses)))) | |
94 | - | else if ((totalAddresses == 6)) | |
95 | - | 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)])) | |
96 | - | else if ((totalAddresses == 5)) | |
97 | - | 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)])) | |
98 | - | else if ((totalAddresses == 4)) | |
99 | - | 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)])) | |
100 | - | else if ((totalAddresses == 3)) | |
101 | - | 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)])) | |
102 | - | else if ((totalAddresses == 2)) | |
103 | - | 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)])) | |
104 | - | else throw(("Needs 2 to 6 parties addresses" + toString(totalAddresses))) | |
102 | + | else if ((totalAddresses == 5)) | |
103 | + | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), addresses), 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, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, paymentAssetId)])) | |
104 | + | else if ((totalAddresses == 4)) | |
105 | + | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), addresses), 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, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, paymentAssetId)])) | |
106 | + | else if ((totalAddresses == 3)) | |
107 | + | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), addresses), 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, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, paymentAssetId)])) | |
108 | + | else if ((totalAddresses == 2)) | |
109 | + | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), addresses), DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, paymentAssetId)])) | |
110 | + | else throw(("Needs 2 to 6 parties addresses" + toString(totalAddresses))) | |
105 | 111 | } | |
106 | 112 | ||
107 | 113 | ||
112 | 118 | let amount = extract(payment.amount) | |
113 | 119 | let id = extract(invoke.transactionId) | |
114 | 120 | let signer = toBase58String(invoke.caller.bytes) | |
115 | - | let signingRequestExist = match getString(this, ((signer + "_MA_") + toBase58String(id))) { | |
116 | - | case s: String => | |
117 | - | s | |
118 | - | case _ => | |
119 | - | throw("There is no corresponding signing request") | |
120 | - | } | |
121 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
122 | - | then extract(payment.assetId) | |
123 | - | else throw("Waves is not accepted as payment") | |
124 | - | if ((paymentAssetId != acceptedToken)) | |
125 | - | then throw("Only payments in SIGN are allowed at the moment") | |
126 | - | else if ((amount != currentPrice)) | |
127 | - | then throw("The price is wrong") | |
128 | - | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + toBase58String(id)), "SIGNED")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken)])) | |
121 | + | let signingRequestExist = checkIfPendingToSign(((signer + "_MA_") + toBase58String(id))) | |
122 | + | if (signingRequestExist) | |
123 | + | then throw("Sorry there is no pending signature") | |
124 | + | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + toBase58String(id)), "SIGNED")]), TransferSet([ScriptTransfer(addressFromStringValue(signer), 500000, unit)])) | |
129 | 125 | } | |
130 | 126 | ||
131 | 127 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let verifier = extract(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | - | let currentPrice = 250000000 | |
7 | - | ||
8 | - | let bank = "3MzYLkQ6qCwtbxaYQ2yk1kdUudzbNg4JiTG" | |
6 | + | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
9 | 7 | ||
10 | 8 | func isAdress (addr) = if (if ((size(addr) == 35)) | |
11 | 9 | then (take(addr, 2) == "3N") | |
12 | 10 | else false) | |
13 | 11 | then true | |
14 | 12 | else (take(addr, 2) == "3M") | |
15 | 13 | ||
16 | 14 | ||
17 | 15 | func countParties (accumulator,addr) = if ((size(addr) > 0)) | |
18 | 16 | then (accumulator + 1) | |
19 | 17 | else (accumulator + 0) | |
18 | + | ||
19 | + | ||
20 | + | func checkIfPendingToSign (key) = match getString(this, key) { | |
21 | + | case a: String => | |
22 | + | if ((a == "PENDING")) | |
23 | + | then true | |
24 | + | else false | |
25 | + | case _ => | |
26 | + | false | |
27 | + | } | |
20 | 28 | ||
21 | 29 | ||
22 | 30 | func getValueString (json) = take(drop(json, 1), value(indexOf(drop(json, 1), "\""))) | |
23 | 31 | ||
24 | 32 | ||
25 | 33 | func getValue (json,key) = { | |
26 | 34 | let keyIndex = value(indexOf(json, (("\"" + key) + "\":"))) | |
27 | 35 | let data = drop(json, ((keyIndex + size(key)) + 3)) | |
28 | 36 | let jsonValue = getValueString(data) | |
29 | 37 | jsonValue | |
30 | 38 | } | |
31 | 39 | ||
32 | 40 | ||
33 | 41 | @Callable(invoke) | |
34 | 42 | func createAgreement (hash,title,addresses) = { | |
35 | 43 | let payment = extract(invoke.payment) | |
36 | 44 | let amount = extract(payment.amount) | |
37 | 45 | let id = extract(invoke.transactionId) | |
38 | - | let address1 = getValue(addresses, "address1") | |
39 | - | let address2 = getValue(addresses, "address2") | |
40 | - | let address3 = getValue(addresses, "address3") | |
41 | - | let address4 = getValue(addresses, "address4") | |
42 | - | let address5 = getValue(addresses, "address5") | |
43 | - | let address6 = getValue(addresses, "address6") | |
44 | - | let addressesArray = [address1, address2, address3, address4, address5, address6] | |
46 | + | let addressesArray = [getValue(addresses, "address1"), getValue(addresses, "address2"), getValue(addresses, "address3"), getValue(addresses, "address4"), getValue(addresses, "address5"), getValue(addresses, "address6")] | |
45 | 47 | let totalAddresses = { | |
46 | - | let $ | |
47 | - | let $ | |
48 | - | let $ | |
49 | - | if (($ | |
50 | - | then $ | |
48 | + | let $list15021542 = addressesArray | |
49 | + | let $size15021542 = size($list15021542) | |
50 | + | let $acc015021542 = 0 | |
51 | + | if (($size15021542 == 0)) | |
52 | + | then $acc015021542 | |
51 | 53 | else { | |
52 | - | let $ | |
53 | - | if (($ | |
54 | - | then $ | |
54 | + | let $acc115021542 = countParties($acc015021542, $list15021542[0]) | |
55 | + | if (($size15021542 == 1)) | |
56 | + | then $acc115021542 | |
55 | 57 | else { | |
56 | - | let $ | |
57 | - | if (($ | |
58 | - | then $ | |
58 | + | let $acc215021542 = countParties($acc115021542, $list15021542[1]) | |
59 | + | if (($size15021542 == 2)) | |
60 | + | then $acc215021542 | |
59 | 61 | else { | |
60 | - | let $ | |
61 | - | if (($ | |
62 | - | then $ | |
62 | + | let $acc315021542 = countParties($acc215021542, $list15021542[2]) | |
63 | + | if (($size15021542 == 3)) | |
64 | + | then $acc315021542 | |
63 | 65 | else { | |
64 | - | let $ | |
65 | - | if (($ | |
66 | - | then $ | |
66 | + | let $acc415021542 = countParties($acc315021542, $list15021542[3]) | |
67 | + | if (($size15021542 == 4)) | |
68 | + | then $acc415021542 | |
67 | 69 | else { | |
68 | - | let $ | |
69 | - | if (($ | |
70 | - | then $ | |
70 | + | let $acc515021542 = countParties($acc415021542, $list15021542[4]) | |
71 | + | if (($size15021542 == 5)) | |
72 | + | then $acc515021542 | |
71 | 73 | else { | |
72 | - | let $ | |
73 | - | if (($ | |
74 | - | then $ | |
74 | + | let $acc615021542 = countParties($acc515021542, $list15021542[5]) | |
75 | + | if (($size15021542 == 6)) | |
76 | + | then $acc615021542 | |
75 | 77 | else { | |
76 | - | let $ | |
78 | + | let $acc715021542 = countParties($acc615021542, $list15021542[6]) | |
77 | 79 | throw("List size exceed 6") | |
78 | 80 | } | |
79 | 81 | } | |
80 | 82 | } | |
81 | 83 | } | |
82 | 84 | } | |
83 | 85 | } | |
84 | 86 | } | |
85 | 87 | } | |
86 | - | 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]) + "'}") | |
87 | 88 | let paymentAssetId = if (isDefined(payment.assetId)) | |
88 | 89 | then extract(payment.assetId) | |
89 | 90 | else throw("Waves is not accepted as payment") | |
90 | - | if ((paymentAssetId != acceptedToken)) | |
91 | + | let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) { | |
92 | + | case a: String => | |
93 | + | a | |
94 | + | case _ => | |
95 | + | throw("This token is not accepted at the moment") | |
96 | + | } | |
97 | + | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
98 | + | if ((acceptedToken != "WHITELISTED")) | |
91 | 99 | then throw("Only payments in SIGN are allowed at the moment") | |
92 | 100 | else if (((currentPrice * totalAddresses) > amount)) | |
93 | 101 | then throw(("The price is wrong, it should be " + toString((currentPrice * totalAddresses)))) | |
94 | - | else if ((totalAddresses == 6)) | |
95 | - | 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)])) | |
96 | - | else if ((totalAddresses == 5)) | |
97 | - | 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)])) | |
98 | - | else if ((totalAddresses == 4)) | |
99 | - | 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)])) | |
100 | - | else if ((totalAddresses == 3)) | |
101 | - | 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)])) | |
102 | - | else if ((totalAddresses == 2)) | |
103 | - | 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)])) | |
104 | - | else throw(("Needs 2 to 6 parties addresses" + toString(totalAddresses))) | |
102 | + | else if ((totalAddresses == 5)) | |
103 | + | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), addresses), 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, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, paymentAssetId)])) | |
104 | + | else if ((totalAddresses == 4)) | |
105 | + | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), addresses), 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, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, paymentAssetId)])) | |
106 | + | else if ((totalAddresses == 3)) | |
107 | + | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), addresses), 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, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, paymentAssetId)])) | |
108 | + | else if ((totalAddresses == 2)) | |
109 | + | then ScriptResult(WriteSet([DataEntry(("title_MA_" + toBase58String(id)), title), DataEntry(("hash_MA_" + toBase58String(id)), hash), DataEntry(("data_MA_" + toBase58String(id)), addresses), DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, paymentAssetId), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, paymentAssetId)])) | |
110 | + | else throw(("Needs 2 to 6 parties addresses" + toString(totalAddresses))) | |
105 | 111 | } | |
106 | 112 | ||
107 | 113 | ||
108 | 114 | ||
109 | 115 | @Callable(invoke) | |
110 | 116 | func signAgreement (hash,agreementId) = { | |
111 | 117 | let payment = extract(invoke.payment) | |
112 | 118 | let amount = extract(payment.amount) | |
113 | 119 | let id = extract(invoke.transactionId) | |
114 | 120 | let signer = toBase58String(invoke.caller.bytes) | |
115 | - | let signingRequestExist = match getString(this, ((signer + "_MA_") + toBase58String(id))) { | |
116 | - | case s: String => | |
117 | - | s | |
118 | - | case _ => | |
119 | - | throw("There is no corresponding signing request") | |
120 | - | } | |
121 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
122 | - | then extract(payment.assetId) | |
123 | - | else throw("Waves is not accepted as payment") | |
124 | - | if ((paymentAssetId != acceptedToken)) | |
125 | - | then throw("Only payments in SIGN are allowed at the moment") | |
126 | - | else if ((amount != currentPrice)) | |
127 | - | then throw("The price is wrong") | |
128 | - | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + toBase58String(id)), "SIGNED")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken)])) | |
121 | + | let signingRequestExist = checkIfPendingToSign(((signer + "_MA_") + toBase58String(id))) | |
122 | + | if (signingRequestExist) | |
123 | + | then throw("Sorry there is no pending signature") | |
124 | + | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + toBase58String(id)), "SIGNED")]), TransferSet([ScriptTransfer(addressFromStringValue(signer), 500000, unit)])) | |
129 | 125 | } | |
130 | 126 | ||
131 | 127 |
github/deemru/w8io/169f3d6 58.35 ms ◑