tx · 7x9UKojSHUNaCMr7ogYLG8RaMfVCsfaAyaaPtfpr11qd 3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL: -0.01400000 Waves 2020.01.31 11:45 [878294] smart account 3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL > SELF 0.00000000 Waves
{ "type": 13, "id": "7x9UKojSHUNaCMr7ogYLG8RaMfVCsfaAyaaPtfpr11qd", "fee": 1400000, "feeAssetId": null, "timestamp": 1580460331967, "version": 1, "sender": "3MrYoV4W5mu5ZP8rPspCXveMXusGstSPTjL", "senderPublicKey": "f1NbgbpkRpbigsrHaDkWZAkPgcqd8GM5G5eNmqnTD6z", "proofs": [ "2vfoszAFRihmEt7wF6ZonPpXkGAkRRoC4774mnaMayXdcA8KW49hiKdipXCGs1z98b4MsTuCLAfj7hoq8hRPXGdo" ], "script": "base64:AAIDAAAAAAAAAA8IARIFCgMICAgSBAoCCAgAAAAHAAAAAA1hY2NlcHRlZFRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wAAAAAMY3VycmVudFByaWNlAAAAAAAO5rKAAAAAAARiYW5rAgAAACMzTXpZTGtRNnFDd3RieGFZUTJ5azFrZFV1ZHpiTmc0SmlURwEAAAAIaXNBZHJlc3MAAAABAAAABGFkZHIDCQAAAAAAAAIJAAExAAAAAQUAAAAEYWRkcgAAAAAAAAAAIwkAAAAAAAACCQABLwAAAAIFAAAABGFkZHIAAAAAAAAAAAICAAAAAjNOBwEAAAAMY291bnRQYXJ0aWVzAAAAAgAAAAthY2N1bXVsYXRvcgAAAARhZGRyAwkBAAAACGlzQWRyZXNzAAAAAQUAAAAEYWRkcgkAAGQAAAACBQAAAAthY2N1bXVsYXRvcgAAAAAAAAAAAQkAAGQAAAACBQAAAAthY2N1bXVsYXRvcgAAAAAAAAAAAAEAAAAOZ2V0VmFsdWVTdHJpbmcAAAABAAAABGpzb24JAAEvAAAAAgkAATAAAAACBQAAAARqc29uAAAAAAAAAA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AAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAARiYW5rBQAAAAZhbW91bnQFAAAADWFjY2VwdGVkVG9rZW4FAAAAA25pbAAAAAAkmHUx", "chainId": 84, "height": 878294, "spentComplexity": 0 } View: original | compacted Prev: 3X9EQJNFVy1EM1QVv4JjLL4pBRBSVckkknU5HyYs5DL1 Next: 91ZxfUu29HHB8svjmzJZkRsWrEqRvzuMTTEUSFERjZeS Diff:
Old | New | Differences | |
---|---|---|---|
34 | 34 | let amount = extract(payment.amount) | |
35 | 35 | let id = extract(invoke.transactionId) | |
36 | 36 | let addressesArray = [getValue(addresses, "address1"), getValue(addresses, "address2"), getValue(addresses, "address3"), getValue(addresses, "address4"), getValue(addresses, "address5"), getValue(addresses, "address6")] | |
37 | - | let | |
38 | - | | |
39 | - | | |
40 | - | | |
41 | - | | |
42 | - | | |
43 | - | | |
44 | - | let $ | |
45 | - | if (($ | |
46 | - | then $ | |
37 | + | let totalAddresses = { | |
38 | + | let $list14171457 = addressesArray | |
39 | + | let $size14171457 = size($list14171457) | |
40 | + | let $acc014171457 = 0 | |
41 | + | if (($size14171457 == 0)) | |
42 | + | then $acc014171457 | |
43 | + | else { | |
44 | + | let $acc114171457 = countParties($acc014171457, $list14171457[0]) | |
45 | + | if (($size14171457 == 1)) | |
46 | + | then $acc114171457 | |
47 | 47 | else { | |
48 | - | let $ | |
49 | - | if (($ | |
50 | - | then $ | |
48 | + | let $acc214171457 = countParties($acc114171457, $list14171457[1]) | |
49 | + | if (($size14171457 == 2)) | |
50 | + | then $acc214171457 | |
51 | 51 | else { | |
52 | - | let $ | |
53 | - | if (($ | |
54 | - | then $ | |
52 | + | let $acc314171457 = countParties($acc214171457, $list14171457[2]) | |
53 | + | if (($size14171457 == 3)) | |
54 | + | then $acc314171457 | |
55 | 55 | else { | |
56 | - | let $ | |
57 | - | if (($ | |
58 | - | then $ | |
56 | + | let $acc414171457 = countParties($acc314171457, $list14171457[3]) | |
57 | + | if (($size14171457 == 4)) | |
58 | + | then $acc414171457 | |
59 | 59 | else { | |
60 | - | let $ | |
61 | - | if (($ | |
62 | - | then $ | |
60 | + | let $acc514171457 = countParties($acc414171457, $list14171457[4]) | |
61 | + | if (($size14171457 == 5)) | |
62 | + | then $acc514171457 | |
63 | 63 | else { | |
64 | - | let $ | |
65 | - | if (($ | |
66 | - | then $ | |
64 | + | let $acc614171457 = countParties($acc514171457, $list14171457[5]) | |
65 | + | if (($size14171457 == 6)) | |
66 | + | then $acc614171457 | |
67 | 67 | else { | |
68 | - | let $acc614131453 = countParties($acc514131453, $list14131453[5]) | |
69 | - | if (($size14131453 == 6)) | |
70 | - | then $acc614131453 | |
71 | - | else { | |
72 | - | let $acc714131453 = countParties($acc614131453, $list14131453[6]) | |
73 | - | throw("List size exceed 6") | |
74 | - | } | |
68 | + | let $acc714171457 = countParties($acc614171457, $list14171457[6]) | |
69 | + | throw("List size exceed 6") | |
75 | 70 | } | |
76 | 71 | } | |
77 | 72 | } | |
79 | 74 | } | |
80 | 75 | } | |
81 | 76 | } | |
82 | - | | |
83 | - | ||
84 | - | | |
85 | - | | |
86 | - | | |
87 | - | | |
88 | - | | |
89 | - | | |
90 | - | | |
91 | - | | |
92 | - | | |
93 | - | | |
94 | - | | |
95 | - | | |
96 | - | | |
97 | - | | |
98 | - | | |
99 | - | | |
100 | - | | |
101 | - | | |
77 | + | } | |
78 | + | 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]) + "'}") | |
79 | + | let paymentAssetId = if (isDefined(payment.assetId)) | |
80 | + | then extract(payment.assetId) | |
81 | + | else throw("Waves is not accepted as payment") | |
82 | + | if ((paymentAssetId != acceptedToken)) | |
83 | + | then throw("Only payments in SIGN are allowed at the moment") | |
84 | + | else if (((currentPrice * totalAddresses) > amount)) | |
85 | + | then throw(("The price is wrong, it should be " + toString((currentPrice * totalAddresses)))) | |
86 | + | else if ((totalAddresses == 6)) | |
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"), 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)])) | |
88 | + | else if ((totalAddresses == 5)) | |
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"), 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)])) | |
90 | + | else if ((totalAddresses == 4)) | |
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"), 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)])) | |
92 | + | else if ((totalAddresses == 3)) | |
93 | + | 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)])) | |
94 | + | else if ((totalAddresses == 2)) | |
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")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
96 | + | else throw("Needs 2 to 6 parties addresses") | |
102 | 97 | } | |
103 | 98 | ||
104 | 99 |
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 | 20 | func getValueString (json) = take(drop(json, 1), value(indexOf(drop(json, 1), "\""))) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getValue (json,key) = { | |
24 | 24 | let keyIndex = value(indexOf(json, (("\"" + key) + "\":"))) | |
25 | 25 | let data = drop(json, ((keyIndex + size(key)) + 3)) | |
26 | 26 | let jsonValue = getValueString(data) | |
27 | 27 | jsonValue | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(invoke) | |
32 | 32 | func createAgreement (hash,title,addresses) = { | |
33 | 33 | let payment = extract(invoke.payment) | |
34 | 34 | let amount = extract(payment.amount) | |
35 | 35 | let id = extract(invoke.transactionId) | |
36 | 36 | let addressesArray = [getValue(addresses, "address1"), getValue(addresses, "address2"), getValue(addresses, "address3"), getValue(addresses, "address4"), getValue(addresses, "address5"), getValue(addresses, "address6")] | |
37 | - | let | |
38 | - | | |
39 | - | | |
40 | - | | |
41 | - | | |
42 | - | | |
43 | - | | |
44 | - | let $ | |
45 | - | if (($ | |
46 | - | then $ | |
37 | + | let totalAddresses = { | |
38 | + | let $list14171457 = addressesArray | |
39 | + | let $size14171457 = size($list14171457) | |
40 | + | let $acc014171457 = 0 | |
41 | + | if (($size14171457 == 0)) | |
42 | + | then $acc014171457 | |
43 | + | else { | |
44 | + | let $acc114171457 = countParties($acc014171457, $list14171457[0]) | |
45 | + | if (($size14171457 == 1)) | |
46 | + | then $acc114171457 | |
47 | 47 | else { | |
48 | - | let $ | |
49 | - | if (($ | |
50 | - | then $ | |
48 | + | let $acc214171457 = countParties($acc114171457, $list14171457[1]) | |
49 | + | if (($size14171457 == 2)) | |
50 | + | then $acc214171457 | |
51 | 51 | else { | |
52 | - | let $ | |
53 | - | if (($ | |
54 | - | then $ | |
52 | + | let $acc314171457 = countParties($acc214171457, $list14171457[2]) | |
53 | + | if (($size14171457 == 3)) | |
54 | + | then $acc314171457 | |
55 | 55 | else { | |
56 | - | let $ | |
57 | - | if (($ | |
58 | - | then $ | |
56 | + | let $acc414171457 = countParties($acc314171457, $list14171457[3]) | |
57 | + | if (($size14171457 == 4)) | |
58 | + | then $acc414171457 | |
59 | 59 | else { | |
60 | - | let $ | |
61 | - | if (($ | |
62 | - | then $ | |
60 | + | let $acc514171457 = countParties($acc414171457, $list14171457[4]) | |
61 | + | if (($size14171457 == 5)) | |
62 | + | then $acc514171457 | |
63 | 63 | else { | |
64 | - | let $ | |
65 | - | if (($ | |
66 | - | then $ | |
64 | + | let $acc614171457 = countParties($acc514171457, $list14171457[5]) | |
65 | + | if (($size14171457 == 6)) | |
66 | + | then $acc614171457 | |
67 | 67 | else { | |
68 | - | let $acc614131453 = countParties($acc514131453, $list14131453[5]) | |
69 | - | if (($size14131453 == 6)) | |
70 | - | then $acc614131453 | |
71 | - | else { | |
72 | - | let $acc714131453 = countParties($acc614131453, $list14131453[6]) | |
73 | - | throw("List size exceed 6") | |
74 | - | } | |
68 | + | let $acc714171457 = countParties($acc614171457, $list14171457[6]) | |
69 | + | throw("List size exceed 6") | |
75 | 70 | } | |
76 | 71 | } | |
77 | 72 | } | |
78 | 73 | } | |
79 | 74 | } | |
80 | 75 | } | |
81 | 76 | } | |
82 | - | | |
83 | - | ||
84 | - | | |
85 | - | | |
86 | - | | |
87 | - | | |
88 | - | | |
89 | - | | |
90 | - | | |
91 | - | | |
92 | - | | |
93 | - | | |
94 | - | | |
95 | - | | |
96 | - | | |
97 | - | | |
98 | - | | |
99 | - | | |
100 | - | | |
101 | - | | |
77 | + | } | |
78 | + | 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]) + "'}") | |
79 | + | let paymentAssetId = if (isDefined(payment.assetId)) | |
80 | + | then extract(payment.assetId) | |
81 | + | else throw("Waves is not accepted as payment") | |
82 | + | if ((paymentAssetId != acceptedToken)) | |
83 | + | then throw("Only payments in SIGN are allowed at the moment") | |
84 | + | else if (((currentPrice * totalAddresses) > amount)) | |
85 | + | then throw(("The price is wrong, it should be " + toString((currentPrice * totalAddresses)))) | |
86 | + | else if ((totalAddresses == 6)) | |
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"), 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)])) | |
88 | + | else if ((totalAddresses == 5)) | |
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"), 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)])) | |
90 | + | else if ((totalAddresses == 4)) | |
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"), 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)])) | |
92 | + | else if ((totalAddresses == 3)) | |
93 | + | 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)])) | |
94 | + | else if ((totalAddresses == 2)) | |
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")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
96 | + | else throw("Needs 2 to 6 parties addresses") | |
102 | 97 | } | |
103 | 98 | ||
104 | 99 | ||
105 | 100 | ||
106 | 101 | @Callable(invoke) | |
107 | 102 | func signAgreement (hash,agreementId) = { | |
108 | 103 | let payment = extract(invoke.payment) | |
109 | 104 | let amount = extract(payment.amount) | |
110 | 105 | let id = extract(invoke.transactionId) | |
111 | 106 | let signer = toBase58String(invoke.caller.bytes) | |
112 | 107 | let signingRequestExist = match getString(this, ((signer + "_MA_") + toBase58String(id))) { | |
113 | 108 | case s: String => | |
114 | 109 | s | |
115 | 110 | case _ => | |
116 | 111 | throw("There is no corresponding signing request") | |
117 | 112 | } | |
118 | 113 | let paymentAssetId = if (isDefined(payment.assetId)) | |
119 | 114 | then extract(payment.assetId) | |
120 | 115 | else throw("Waves is not accepted as payment") | |
121 | 116 | if ((paymentAssetId != acceptedToken)) | |
122 | 117 | then throw("Only payments in SIGN are allowed at the moment") | |
123 | 118 | else if ((amount != currentPrice)) | |
124 | 119 | then throw("The price is wrong") | |
125 | 120 | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + toBase58String(id)), "SIGNED")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken)])) | |
126 | 121 | } | |
127 | 122 | ||
128 | 123 |
github/deemru/w8io/026f985 87.44 ms ◑