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:AAIDAAAAAAAAAA8IARIFCgMICAgSBAoCCAgAAAAHAAAAAAh2ZXJpZmllcgkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAAAAAEYmFuawIAAAAjM04xRTZ0WGRkUm9WYVJmUTlkUTN2ZzVMYVcyZnNkOEhLdWIBAAAACGlzQWRyZXNzAAAAAQAAAARhZGRyAwMJAAAAAAAAAgkAATEAAAABBQAAAARhZGRyAAAAAAAAAAAjCQAAAAAAAAIJAAEvAAAAAgUAAAAEYWRkcgAAAAAAAAAAAgIAAAACM04HBgkAAAAAAAACCQABLwAAAAIFAAAABGFkZHIAAAAAAAAAAAICAAAAAjNNAQAAAAxjb3VudFBhcnRpZXMAAAACAAAAC2FjY3VtdWxhdG9yAAAABGFkZHIDCQAAZgAAAAIJAAExAAAAAQUAAAAEYWRkcgAAAAAAAAAAAAkAAGQAAAACBQAAAAthY2N1bXVsYXRvcgAAAAAAAAAAAQkAAGQAAAACBQAAAAthY2N1bXVsY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YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAABnNpZ25lcgIAAAAEX01BXwkAAlgAAAABBQAAAAJpZAIAAAAGU0lHTkVEBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAZzaWduZXIAAAAAAAAHoSAFAAAABHVuaXQFAAAAA25pbAAAAADeUqsU", "chainId": 84, "height": 878354, "spentComplexity": 0 } View: original | compacted Prev: 6NZgQj1w47GjxNBB8NuCDG4XDCj6RqxHVDriZQavcGhT Next: F898v8TCrdgj48CH6ntwgGCjvcNitv47d9NMs2obVegQ Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
4+let verifier = extract(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
55
6-let currentPrice = 250000000
7-
8-let bank = "3MzYLkQ6qCwtbxaYQ2yk1kdUudzbNg4JiTG"
6+let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
97
108 func isAdress (addr) = if (if ((size(addr) == 35))
119 then (take(addr, 2) == "3N")
1715 func countParties (accumulator,addr) = if ((size(addr) > 0))
1816 then (accumulator + 1)
1917 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+}
2028
2129
2230 func getValueString (json) = take(drop(json, 1), value(indexOf(drop(json, 1), "\"")))
3543 let payment = extract(invoke.payment)
3644 let amount = extract(payment.amount)
3745 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")]
4547 let totalAddresses = {
46- let $list16111651 = addressesArray
47- let $size16111651 = size($list16111651)
48- let $acc016111651 = 0
49- if (($size16111651 == 0))
50- then $acc016111651
48+ let $list15021542 = addressesArray
49+ let $size15021542 = size($list15021542)
50+ let $acc015021542 = 0
51+ if (($size15021542 == 0))
52+ then $acc015021542
5153 else {
52- let $acc116111651 = countParties($acc016111651, $list16111651[0])
53- if (($size16111651 == 1))
54- then $acc116111651
54+ let $acc115021542 = countParties($acc015021542, $list15021542[0])
55+ if (($size15021542 == 1))
56+ then $acc115021542
5557 else {
56- let $acc216111651 = countParties($acc116111651, $list16111651[1])
57- if (($size16111651 == 2))
58- then $acc216111651
58+ let $acc215021542 = countParties($acc115021542, $list15021542[1])
59+ if (($size15021542 == 2))
60+ then $acc215021542
5961 else {
60- let $acc316111651 = countParties($acc216111651, $list16111651[2])
61- if (($size16111651 == 3))
62- then $acc316111651
62+ let $acc315021542 = countParties($acc215021542, $list15021542[2])
63+ if (($size15021542 == 3))
64+ then $acc315021542
6365 else {
64- let $acc416111651 = countParties($acc316111651, $list16111651[3])
65- if (($size16111651 == 4))
66- then $acc416111651
66+ let $acc415021542 = countParties($acc315021542, $list15021542[3])
67+ if (($size15021542 == 4))
68+ then $acc415021542
6769 else {
68- let $acc516111651 = countParties($acc416111651, $list16111651[4])
69- if (($size16111651 == 5))
70- then $acc516111651
70+ let $acc515021542 = countParties($acc415021542, $list15021542[4])
71+ if (($size15021542 == 5))
72+ then $acc515021542
7173 else {
72- let $acc616111651 = countParties($acc516111651, $list16111651[5])
73- if (($size16111651 == 6))
74- then $acc616111651
74+ let $acc615021542 = countParties($acc515021542, $list15021542[5])
75+ if (($size15021542 == 6))
76+ then $acc615021542
7577 else {
76- let $acc716111651 = countParties($acc616111651, $list16111651[6])
78+ let $acc715021542 = countParties($acc615021542, $list15021542[6])
7779 throw("List size exceed 6")
7880 }
7981 }
8385 }
8486 }
8587 }
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]) + "'}")
8788 let paymentAssetId = if (isDefined(payment.assetId))
8889 then extract(payment.assetId)
8990 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"))
9199 then throw("Only payments in SIGN are allowed at the moment")
92100 else if (((currentPrice * totalAddresses) > amount))
93101 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)))
105111 }
106112
107113
112118 let amount = extract(payment.amount)
113119 let id = extract(invoke.transactionId)
114120 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)]))
129125 }
130126
131127
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
4+let verifier = extract(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
55
6-let currentPrice = 250000000
7-
8-let bank = "3MzYLkQ6qCwtbxaYQ2yk1kdUudzbNg4JiTG"
6+let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
97
108 func isAdress (addr) = if (if ((size(addr) == 35))
119 then (take(addr, 2) == "3N")
1210 else false)
1311 then true
1412 else (take(addr, 2) == "3M")
1513
1614
1715 func countParties (accumulator,addr) = if ((size(addr) > 0))
1816 then (accumulator + 1)
1917 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+}
2028
2129
2230 func getValueString (json) = take(drop(json, 1), value(indexOf(drop(json, 1), "\"")))
2331
2432
2533 func getValue (json,key) = {
2634 let keyIndex = value(indexOf(json, (("\"" + key) + "\":")))
2735 let data = drop(json, ((keyIndex + size(key)) + 3))
2836 let jsonValue = getValueString(data)
2937 jsonValue
3038 }
3139
3240
3341 @Callable(invoke)
3442 func createAgreement (hash,title,addresses) = {
3543 let payment = extract(invoke.payment)
3644 let amount = extract(payment.amount)
3745 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")]
4547 let totalAddresses = {
46- let $list16111651 = addressesArray
47- let $size16111651 = size($list16111651)
48- let $acc016111651 = 0
49- if (($size16111651 == 0))
50- then $acc016111651
48+ let $list15021542 = addressesArray
49+ let $size15021542 = size($list15021542)
50+ let $acc015021542 = 0
51+ if (($size15021542 == 0))
52+ then $acc015021542
5153 else {
52- let $acc116111651 = countParties($acc016111651, $list16111651[0])
53- if (($size16111651 == 1))
54- then $acc116111651
54+ let $acc115021542 = countParties($acc015021542, $list15021542[0])
55+ if (($size15021542 == 1))
56+ then $acc115021542
5557 else {
56- let $acc216111651 = countParties($acc116111651, $list16111651[1])
57- if (($size16111651 == 2))
58- then $acc216111651
58+ let $acc215021542 = countParties($acc115021542, $list15021542[1])
59+ if (($size15021542 == 2))
60+ then $acc215021542
5961 else {
60- let $acc316111651 = countParties($acc216111651, $list16111651[2])
61- if (($size16111651 == 3))
62- then $acc316111651
62+ let $acc315021542 = countParties($acc215021542, $list15021542[2])
63+ if (($size15021542 == 3))
64+ then $acc315021542
6365 else {
64- let $acc416111651 = countParties($acc316111651, $list16111651[3])
65- if (($size16111651 == 4))
66- then $acc416111651
66+ let $acc415021542 = countParties($acc315021542, $list15021542[3])
67+ if (($size15021542 == 4))
68+ then $acc415021542
6769 else {
68- let $acc516111651 = countParties($acc416111651, $list16111651[4])
69- if (($size16111651 == 5))
70- then $acc516111651
70+ let $acc515021542 = countParties($acc415021542, $list15021542[4])
71+ if (($size15021542 == 5))
72+ then $acc515021542
7173 else {
72- let $acc616111651 = countParties($acc516111651, $list16111651[5])
73- if (($size16111651 == 6))
74- then $acc616111651
74+ let $acc615021542 = countParties($acc515021542, $list15021542[5])
75+ if (($size15021542 == 6))
76+ then $acc615021542
7577 else {
76- let $acc716111651 = countParties($acc616111651, $list16111651[6])
78+ let $acc715021542 = countParties($acc615021542, $list15021542[6])
7779 throw("List size exceed 6")
7880 }
7981 }
8082 }
8183 }
8284 }
8385 }
8486 }
8587 }
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]) + "'}")
8788 let paymentAssetId = if (isDefined(payment.assetId))
8889 then extract(payment.assetId)
8990 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"))
9199 then throw("Only payments in SIGN are allowed at the moment")
92100 else if (((currentPrice * totalAddresses) > amount))
93101 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)))
105111 }
106112
107113
108114
109115 @Callable(invoke)
110116 func signAgreement (hash,agreementId) = {
111117 let payment = extract(invoke.payment)
112118 let amount = extract(payment.amount)
113119 let id = extract(invoke.transactionId)
114120 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)]))
129125 }
130126
131127

github/deemru/w8io/169f3d6 
58.35 ms