tx · BvVyzHw7eVDw3zbJ99HQvFS8DwX5DBVFpW84ECYtP4Xe

3N9Tq8RmGw456c1eYphzoMyvtwJGrY98jfr:  -0.01400000 Waves

2022.04.07 14:45 [1998096] smart account 3N9Tq8RmGw456c1eYphzoMyvtwJGrY98jfr > SELF 0.00000000 Waves

{ "type": 13, "id": "BvVyzHw7eVDw3zbJ99HQvFS8DwX5DBVFpW84ECYtP4Xe", "fee": 1400000, "feeAssetId": null, "timestamp": 1649331946458, "version": 2, "chainId": 84, "sender": "3N9Tq8RmGw456c1eYphzoMyvtwJGrY98jfr", "senderPublicKey": "He9ZSnjQZGhUkdUsMVVz4t6eAU1c2owedXGCfY1WZvnU", "proofs": [ "4foN6LzzCsLQLGfdYHdvQuuwEbTeMoowBqFw9AMuWpJ1eoNU7t2tbPinHDwZiMYiRzaxxE3HBeyq2xsmZSWDMFnV" ], "script": "base64:AAIEAAAAAAAAABIIAhIECgIIARIDCgEIEgMKAQgAAAAKAAAAABBrUHJvcG9zZWRBc3NldElkAgAAABNfcHJvcG9zZWRfYXNzZXQxX2lkAAAAABRrUHJvcG9zZWRBc3NldEFtb3VudAIAAAAXX3Byb3Bvc2VkX2Fzc2V0MV9hbW91bnQAAAAAD2tEZXNpcmVkQXNzZXRJZAIAAAASX2Rlc2lyZWRfYXNzZXQxX2lkAAAAAA5rRGVzaXJlZEFtb3VudAIAAAAWX2Rlc2lyZWRfYXNzZXQxX2Ftb3VudAAAAAAHa1N0YXR1cwIAAAAHX3N0YXR1cwAAAAAGa093bmVyAgAAAAZfb3duZXIAAAAACmtDbG9zZVR4SWQCAAAADF9jbG9zZV90eF9pZAAAAAAMc3RhdHVzQWN0aXZlAgAAAAZBY3RpdmUAAAAADnN0YXR1c0NhbmNlbGVkAgAAAAhDYW5jZWxlZAAAAAAKc3RhdHVzRG9uZQIAAAAERG9uZQAAAAMAAAABaQEAAAANcGxhY2VQcm9wb3NhbAAAAAIAAAASZGVzaXJlVG9HZXRBc3NldElkAAAAEWRl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AACaWQFAAAAEGtQcm9wb3NlZEFzc2V0SWQCAAAAGFByb3Bvc2VkIGFzc2V0IG5vdCBmb3VuZAIAAAAbSW5jb3JyZWN0IHByb3Bvc2VkIGFzc2V0IGlkBAAAABNwcm9wb3NlZEFzc2V0QW1vdW50CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAJpZAUAAAAUa1Byb3Bvc2VkQXNzZXRBbW91bnQCAAAAGVByb3Bvc2VkIGFtb3VudCBub3QgZm91bmQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJb3duZXJBZGRyBQAAABJkZXNpcmVkQXNzZXRBbW91bnQFAAAADmRlc2lyZWRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAATcHJvcG9zZWRBc3NldEFtb3VudAUAAAAPcHJvcG9zZWRBc3NldElkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgUAAAACaWQFAAAAB2tTdGF0dXMFAAAACnN0YXR1c0RvbmUJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACBQAAAAJpZAUAAAAKa0Nsb3NlVHhJZAkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tledodBCc=", "height": 1998096, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2BsPQLQqAwEqaZ4wnDVh4SKgEGXGiiv5Zsb5xSHq8z7S Next: mXUacmQ3Fgh34SaZy7GCHkgvRPy6VysbnSm5VUnRpsc Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let a = "_proposed_asset1_id"
5+
6+let b = "_proposed_asset1_amount"
7+
8+let c = "_desired_asset1_id"
9+
10+let d = "_desired_asset1_amount"
11+
12+let e = "_status"
13+
14+let f = "_owner"
15+
16+let g = "_close_tx_id"
17+
18+let h = "Active"
19+
20+let i = "Canceled"
21+
22+let j = "Done"
23+
24+@Callable(k)
25+func placeProposal (l,m) = if ((size(k.payments) != 1))
26+ then throw("One attached assets expected")
27+ else {
28+ let n = $Tuple2(k.payments[0].amount, toBase58String(value(k.payments[0].assetId)))
29+ let o = n._1
30+ let p = n._2
31+ let q = toBase58String(k.transactionId)
32+[StringEntry((q + f), toString(k.caller)), StringEntry((q + a), p), IntegerEntry((q + b), o), StringEntry((q + c), l), IntegerEntry((q + d), m), StringEntry((q + e), h)]
33+ }
434
535
6-@Callable(a)
7-func call () = [IntegerEntry("t", 4)]
36+
37+@Callable(k)
38+func cancelProposal (q) = {
39+ let r = valueOrErrorMessage(getString(this, (q + e)), (("Proposal with id '" + q) + "' not found"))
40+ if ((r != h))
41+ then throw(((("Proposal with id '" + q) + "' is not active. Status: ") + r))
42+ else {
43+ let s = addressFromStringValue(valueOrErrorMessage(getString(this, (q + f)), "owner not set"))
44+ let t = valueOrErrorMessage(getString(this, (q + a)), "Proposed asset not found")
45+ let u = valueOrErrorMessage(getInteger(this, (q + b)), "Proposed amount not found")
46+ if ((k.caller != s))
47+ then throw("Only owner can cancel")
48+ else [ScriptTransfer(s, u, fromBase58String(t)), StringEntry((q + e), i), StringEntry((q + g), toBase58String(k.transactionId))]
49+ }
50+ }
851
952
10-@Verifier(b)
11-func c () = sigVerify(b.bodyBytes, b.proofs[0], b.senderPublicKey)
53+
54+@Callable(k)
55+func acceptProposal (q) = {
56+ let v = $Tuple2(k.payments[0].amount, value(k.payments[0].assetId))
57+ let o = v._1
58+ let p = v._2
59+ let r = valueOrErrorMessage(getString(this, (q + e)), (("Proposal with id '" + q) + "' not found"))
60+ if ((r != h))
61+ then throw(((("Proposal with id '" + q) + "' is not active. Status: ") + r))
62+ else {
63+ let w = valueOrErrorMessage(fromBase58String(valueOrErrorMessage(getString(this, (q + c)), "Desired asset not found")), "Incorrect desired asset id")
64+ let x = valueOrErrorMessage(getInteger(this, (q + d)), "Desired amount not found")
65+ if ((w != p))
66+ then throw("Atatched asset doesn't match desired")
67+ else if ((x != o))
68+ then throw("Attached asset amount doesn't match")
69+ else {
70+ let s = addressFromStringValue(valueOrErrorMessage(getString(this, (q + f)), "owner not set"))
71+ let t = valueOrErrorMessage(fromBase58String(valueOrErrorMessage(getString(this, (q + a)), "Proposed asset not found")), "Incorrect proposed asset id")
72+ let u = valueOrErrorMessage(getInteger(this, (q + b)), "Proposed amount not found")
73+[ScriptTransfer(s, x, w), ScriptTransfer(k.caller, u, t), StringEntry((q + e), j), StringEntry((q + g), toBase58String(k.transactionId))]
74+ }
75+ }
76+ }
77+
78+
79+@Verifier(y)
80+func z () = sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey)
1281

github/deemru/w8io/026f985 
26.74 ms