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:AAIDAAAAAAAAABYIARIAEgQKAgEIEgQKAggBEgQKAggBAAAAGQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAAAxnZXRCb29sQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBsAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAB0Jvb2xlYW4EAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEHAQAAABhnZXROdW1iZXJCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc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F0YUVudHJ5AAAAAgkBAAAAFGdldEV4cGlyZVByb3Bvc2FsS2V5AAAAAQUAAAAEaGFzaAUAAAAMZXhwYWlySGVpZ2h0CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAATZ2V0T3duZXJQcm9wb3NhbEtleQAAAAEFAAAABGhhc2gJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAXZ2V0QXJndW1lbnRzUHJvcG9zYWxLZXkAAAABBQAAAARoYXNoBQAAAAlhcmd1bWVudHMFAAAAA25pbAAAAADevje9", "chainId": 84, "height": 865449, "spentComplexity": 0 } View: original | compacted Prev: 9afy8uNjLNcJRQ7FvapHdLsSkF9a99tsfAo1ctEVaiCt Next: HA3ycgx84Pc3o6HhH924uAFc8abfC89Vp9PxnF5CD4a2 Diff:
OldNewDifferences
4141 }
4242
4343
44-let NeutrinoAssetIdKey = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC"
44+let NeutrinoAssetIdKey = "neutrino_asset_id"
4545
46-let NeutrinoContractKey = "3MujEudRyS2JzmpKhyosnj7fU4rYS2dFnxX"
46+let NeutrinoContractKey = "neutrino_contract"
4747
4848 let BalanceKey = "rpd_balance"
4949
7474
7575 let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey))
7676
77-let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey))
78-
7977 let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey))
8078
8179 func getContractBalance (assetId) = getNumberByKey(getContractBalanceKey(assetId))
103101 then throw("can use neutrino")
104102 else {
105103 let account = toString(i.caller)
106- let assetIdString = toBase58String(value(pmt.assetId))
104+ let assetIdString = toBase58String(valueOrErrorMessage(pmt.assetId, "parse value error"))
107105 WriteSet([DataEntry(getContractBalanceKey(assetIdString), (getContractBalance(assetIdString) + pmt.amount)), DataEntry(getUserBalanceKey(account, assetIdString), (getUserBalance(account, assetIdString) + pmt.amount))])
108106 }
109107 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = match getInteger(this, key) {
55 case a: Int =>
66 a
77 case _ =>
88 0
99 }
1010
1111
1212 func getStringByKey (key) = match getString(this, key) {
1313 case a: String =>
1414 a
1515 case _ =>
1616 ""
1717 }
1818
1919
2020 func getBoolByKey (key) = match getBoolean(this, key) {
2121 case a: Boolean =>
2222 a
2323 case _ =>
2424 false
2525 }
2626
2727
2828 func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) {
2929 case a: Int =>
3030 a
3131 case _ =>
3232 0
3333 }
3434
3535
3636 func getStringByAddressAndKey (address,key) = match getString(address, key) {
3737 case a: String =>
3838 a
3939 case _ =>
4040 ""
4141 }
4242
4343
44-let NeutrinoAssetIdKey = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC"
44+let NeutrinoAssetIdKey = "neutrino_asset_id"
4545
46-let NeutrinoContractKey = "3MujEudRyS2JzmpKhyosnj7fU4rYS2dFnxX"
46+let NeutrinoContractKey = "neutrino_contract"
4747
4848 let BalanceKey = "rpd_balance"
4949
5050 let ControlContractKey = "control_contract"
5151
5252 let AdminsKey = "admins"
5353
5454 func getUserBalanceKey (owner,assetId) = ((((BalanceKey + "_") + assetId) + "_") + owner)
5555
5656
5757 func getContractBalanceKey (assetId) = ((BalanceKey + "_") + assetId)
5858
5959
6060 func getExpireProposalKey (hash) = (("proposal_expire" + "_") + hash)
6161
6262
6363 func getOwnerProposalKey (hash) = (("proposal_owner" + "_") + hash)
6464
6565
6666 func getArgumentsProposalKey (hash) = (("proposal_arguments" + "_") + hash)
6767
6868
6969 func getVoteKey (owner,hash) = (((("proposal_vote" + "_") + owner) + "_") + hash)
7070
7171
7272 func convertJsonArrayToList (jsonArray) = split(jsonArray, ",")
7373
7474
7575 let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey))
7676
77-let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey))
78-
7977 let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey))
8078
8179 func getContractBalance (assetId) = getNumberByKey(getContractBalanceKey(assetId))
8280
8381
8482 func getUserBalance (owner,assetId) = getNumberByKey(getUserBalanceKey(owner, assetId))
8583
8684
8785 func getExpireProposal (hash) = getNumberByKey(getExpireProposalKey(hash))
8886
8987
9088 func getOwnerProposal (hash) = getStringByKey(getOwnerProposalKey(hash))
9189
9290
9391 func getArgumentsProposal (hash) = getStringByKey(getArgumentsProposalKey(hash))
9492
9593
9694 func getVote (owner,hash) = getStringByKey(getVoteKey(owner, hash))
9795
9896
9997 @Callable(i)
10098 func lockNeutrino () = {
10199 let pmt = extract(i.payment)
102100 if ((pmt.assetId != neutrinoAssetId))
103101 then throw("can use neutrino")
104102 else {
105103 let account = toString(i.caller)
106- let assetIdString = toBase58String(value(pmt.assetId))
104+ let assetIdString = toBase58String(valueOrErrorMessage(pmt.assetId, "parse value error"))
107105 WriteSet([DataEntry(getContractBalanceKey(assetIdString), (getContractBalance(assetIdString) + pmt.amount)), DataEntry(getUserBalanceKey(account, assetIdString), (getUserBalance(account, assetIdString) + pmt.amount))])
108106 }
109107 }
110108
111109
112110
113111 @Callable(i)
114112 func unlockNeutrino (unlockAmount,assetIdString) = {
115113 let account = toString(i.caller)
116114 let assetId = fromBase58String(assetIdString)
117115 let balance = (getUserBalance(account, assetIdString) - unlockAmount)
118116 if ((0 > balance))
119117 then throw("invalid amount")
120118 else if ((assetId != neutrinoAssetId))
121119 then throw("can use neutrino")
122120 else ScriptResult(WriteSet([DataEntry(getContractBalanceKey(assetIdString), (getContractBalance(assetIdString) - unlockAmount)), DataEntry(getUserBalanceKey(account, assetIdString), balance)]), TransferSet([ScriptTransfer(addressFromStringValue(account), unlockAmount, neutrinoAssetId)]))
123121 }
124122
125123
126124
127125 @Callable(i)
128126 func vote (hash,indexArgument) = {
129127 let arguments = split(getArgumentsProposal(hash), ",")
130128 let argument = arguments[indexArgument]
131129 if ((height > getExpireProposal(hash)))
132130 then throw("proposal is expired")
133131 else WriteSet([DataEntry(getVoteKey(toString(i.caller), hash), argument)])
134132 }
135133
136134
137135
138136 @Callable(i)
139137 func createProposal (arguments,expairHeight) = {
140138 let hash = toBase58String(keccak256(((toBytes(arguments) + toBytes(expairHeight)) + i.callerPublicKey)))
141139 if ((getOwnerProposal(hash) != ""))
142140 then throw("proposal is exist")
143141 else WriteSet([DataEntry(getExpireProposalKey(hash), expairHeight), DataEntry(getOwnerProposalKey(hash), toString(i.caller)), DataEntry(getArgumentsProposalKey(hash), arguments)])
144142 }
145143
146144

github/deemru/w8io/026f985 
26.75 ms