tx · ADtAH7WeiUBvWZKApwzgc6BvosAMN8AhHqhVA6BuFNzc 3MxQPEhyQMQL5C4JN29toSkF9amf8iQSCPc: -0.01400000 Waves 2020.01.22 15:12 [865449] smart account 3MxQPEhyQMQL5C4JN29toSkF9amf8iQSCPc > SELF 0.00000000 Waves
{ "type": 13, "id": "ADtAH7WeiUBvWZKApwzgc6BvosAMN8AhHqhVA6BuFNzc", "fee": 1400000, "feeAssetId": null, "timestamp": 1579695163248, "version": 1, "sender": "3MxQPEhyQMQL5C4JN29toSkF9amf8iQSCPc", "senderPublicKey": "3n7vYRqT664Gwk9F1i5yM11opnuaH4yABXXnsxP6kxUQ", "proofs": [ "4vyLtreNUdTNoQFnXkE26hoL3EZbEmPYQKeV1BP2BjBKAsBZs3df1QoG8YKo7Q9S7vQEMtYtMe6UvxJTMYqS6Fsg" ], "script": "base64:AAIDAAAAAAAAABYIARIAEgQKAgEIEgQKAggBEgQKAggBAAAAGQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAAAxnZXRCb29sQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBsAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAB0Jvb2xlYW4EAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEHAQAAABhnZXROdW1iZXJCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc3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0YUVudHJ5AAAAAgkBAAAAFGdldEV4cGlyZVByb3Bvc2FsS2V5AAAAAQUAAAAEaGFzaAUAAAAMZXhwYWlySGVpZ2h0CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAATZ2V0T3duZXJQcm9wb3NhbEtleQAAAAEFAAAABGhhc2gJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAXZ2V0QXJndW1lbnRzUHJvcG9zYWxLZXkAAAABBQAAAARoYXNoBQAAAAlhcmd1bWVudHMFAAAAA25pbAAAAADevje9", "chainId": 84, "height": 865449, "spentComplexity": 0 } View: original | compacted Prev: 9afy8uNjLNcJRQ7FvapHdLsSkF9a99tsfAo1ctEVaiCt Next: HA3ycgx84Pc3o6HhH924uAFc8abfC89Vp9PxnF5CD4a2 Diff:
Old | New | Differences | |
---|---|---|---|
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | - | let NeutrinoAssetIdKey = " | |
44 | + | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
45 | 45 | ||
46 | - | let NeutrinoContractKey = " | |
46 | + | let NeutrinoContractKey = "neutrino_contract" | |
47 | 47 | ||
48 | 48 | let BalanceKey = "rpd_balance" | |
49 | 49 | ||
74 | 74 | ||
75 | 75 | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
76 | 76 | ||
77 | - | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
78 | - | ||
79 | 77 | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
80 | 78 | ||
81 | 79 | func getContractBalance (assetId) = getNumberByKey(getContractBalanceKey(assetId)) | |
103 | 101 | then throw("can use neutrino") | |
104 | 102 | else { | |
105 | 103 | let account = toString(i.caller) | |
106 | - | let assetIdString = toBase58String( | |
104 | + | let assetIdString = toBase58String(valueOrErrorMessage(pmt.assetId, "parse value error")) | |
107 | 105 | WriteSet([DataEntry(getContractBalanceKey(assetIdString), (getContractBalance(assetIdString) + pmt.amount)), DataEntry(getUserBalanceKey(account, assetIdString), (getUserBalance(account, assetIdString) + pmt.amount))]) | |
108 | 106 | } | |
109 | 107 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | 5 | case a: Int => | |
6 | 6 | a | |
7 | 7 | case _ => | |
8 | 8 | 0 | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getStringByKey (key) = match getString(this, key) { | |
13 | 13 | case a: String => | |
14 | 14 | a | |
15 | 15 | case _ => | |
16 | 16 | "" | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getBoolByKey (key) = match getBoolean(this, key) { | |
21 | 21 | case a: Boolean => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | false | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) { | |
29 | 29 | case a: Int => | |
30 | 30 | a | |
31 | 31 | case _ => | |
32 | 32 | 0 | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
37 | 37 | case a: String => | |
38 | 38 | a | |
39 | 39 | case _ => | |
40 | 40 | "" | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | - | let NeutrinoAssetIdKey = " | |
44 | + | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
45 | 45 | ||
46 | - | let NeutrinoContractKey = " | |
46 | + | let NeutrinoContractKey = "neutrino_contract" | |
47 | 47 | ||
48 | 48 | let BalanceKey = "rpd_balance" | |
49 | 49 | ||
50 | 50 | let ControlContractKey = "control_contract" | |
51 | 51 | ||
52 | 52 | let AdminsKey = "admins" | |
53 | 53 | ||
54 | 54 | func getUserBalanceKey (owner,assetId) = ((((BalanceKey + "_") + assetId) + "_") + owner) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getContractBalanceKey (assetId) = ((BalanceKey + "_") + assetId) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getExpireProposalKey (hash) = (("proposal_expire" + "_") + hash) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getOwnerProposalKey (hash) = (("proposal_owner" + "_") + hash) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getArgumentsProposalKey (hash) = (("proposal_arguments" + "_") + hash) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getVoteKey (owner,hash) = (((("proposal_vote" + "_") + owner) + "_") + hash) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
76 | 76 | ||
77 | - | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
78 | - | ||
79 | 77 | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
80 | 78 | ||
81 | 79 | func getContractBalance (assetId) = getNumberByKey(getContractBalanceKey(assetId)) | |
82 | 80 | ||
83 | 81 | ||
84 | 82 | func getUserBalance (owner,assetId) = getNumberByKey(getUserBalanceKey(owner, assetId)) | |
85 | 83 | ||
86 | 84 | ||
87 | 85 | func getExpireProposal (hash) = getNumberByKey(getExpireProposalKey(hash)) | |
88 | 86 | ||
89 | 87 | ||
90 | 88 | func getOwnerProposal (hash) = getStringByKey(getOwnerProposalKey(hash)) | |
91 | 89 | ||
92 | 90 | ||
93 | 91 | func getArgumentsProposal (hash) = getStringByKey(getArgumentsProposalKey(hash)) | |
94 | 92 | ||
95 | 93 | ||
96 | 94 | func getVote (owner,hash) = getStringByKey(getVoteKey(owner, hash)) | |
97 | 95 | ||
98 | 96 | ||
99 | 97 | @Callable(i) | |
100 | 98 | func lockNeutrino () = { | |
101 | 99 | let pmt = extract(i.payment) | |
102 | 100 | if ((pmt.assetId != neutrinoAssetId)) | |
103 | 101 | then throw("can use neutrino") | |
104 | 102 | else { | |
105 | 103 | let account = toString(i.caller) | |
106 | - | let assetIdString = toBase58String( | |
104 | + | let assetIdString = toBase58String(valueOrErrorMessage(pmt.assetId, "parse value error")) | |
107 | 105 | WriteSet([DataEntry(getContractBalanceKey(assetIdString), (getContractBalance(assetIdString) + pmt.amount)), DataEntry(getUserBalanceKey(account, assetIdString), (getUserBalance(account, assetIdString) + pmt.amount))]) | |
108 | 106 | } | |
109 | 107 | } | |
110 | 108 | ||
111 | 109 | ||
112 | 110 | ||
113 | 111 | @Callable(i) | |
114 | 112 | func unlockNeutrino (unlockAmount,assetIdString) = { | |
115 | 113 | let account = toString(i.caller) | |
116 | 114 | let assetId = fromBase58String(assetIdString) | |
117 | 115 | let balance = (getUserBalance(account, assetIdString) - unlockAmount) | |
118 | 116 | if ((0 > balance)) | |
119 | 117 | then throw("invalid amount") | |
120 | 118 | else if ((assetId != neutrinoAssetId)) | |
121 | 119 | then throw("can use neutrino") | |
122 | 120 | else ScriptResult(WriteSet([DataEntry(getContractBalanceKey(assetIdString), (getContractBalance(assetIdString) - unlockAmount)), DataEntry(getUserBalanceKey(account, assetIdString), balance)]), TransferSet([ScriptTransfer(addressFromStringValue(account), unlockAmount, neutrinoAssetId)])) | |
123 | 121 | } | |
124 | 122 | ||
125 | 123 | ||
126 | 124 | ||
127 | 125 | @Callable(i) | |
128 | 126 | func vote (hash,indexArgument) = { | |
129 | 127 | let arguments = split(getArgumentsProposal(hash), ",") | |
130 | 128 | let argument = arguments[indexArgument] | |
131 | 129 | if ((height > getExpireProposal(hash))) | |
132 | 130 | then throw("proposal is expired") | |
133 | 131 | else WriteSet([DataEntry(getVoteKey(toString(i.caller), hash), argument)]) | |
134 | 132 | } | |
135 | 133 | ||
136 | 134 | ||
137 | 135 | ||
138 | 136 | @Callable(i) | |
139 | 137 | func createProposal (arguments,expairHeight) = { | |
140 | 138 | let hash = toBase58String(keccak256(((toBytes(arguments) + toBytes(expairHeight)) + i.callerPublicKey))) | |
141 | 139 | if ((getOwnerProposal(hash) != "")) | |
142 | 140 | then throw("proposal is exist") | |
143 | 141 | else WriteSet([DataEntry(getExpireProposalKey(hash), expairHeight), DataEntry(getOwnerProposalKey(hash), toString(i.caller)), DataEntry(getArgumentsProposalKey(hash), arguments)]) | |
144 | 142 | } | |
145 | 143 | ||
146 | 144 |
github/deemru/w8io/026f985 26.75 ms ◑