tx · 6fefZLiPHpWLS8x1Q8epL6WFoW7Bv1DKzBf8E7zJZTyv

3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu:  -0.01400000 Waves

2020.09.06 21:26 [1165897] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves

{ "type": 13, "id": "6fefZLiPHpWLS8x1Q8epL6WFoW7Bv1DKzBf8E7zJZTyv", "fee": 1400000, "feeAssetId": null, "timestamp": 1599416823262, "version": 1, "sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu", "senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun", "proofs": [ "4gvMU5ZQH7GFdLsA3pPs828dGmXTM35ZjHF4oYa5jW5SjpKYWueWHHyFW7XC4pGbxNBopfi6onfRojByYb1ZYDTb" ], "script": "base64:AAIDAAAAAAAAABsIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgAAAAMAAAAAAZ1cFZvdGUCAAAABnVwdm90ZQAAAAAMYWRtaW5BZGRyZXNzAQAAABoBVDi2IViANlgIPSCUAVQpoGSXhJ2Tw/Y0iwAAAAAFZHl6SWQBAAAAIH6rQdnOUsq3YY00nk9jVDL2OOQ/e846gXAImq8xTxZrAQAAAA1nZXRQcm9maWxlS2V5AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAUX2VudHJlcHJlbmV1clByb2ZpbGUBAAAADGdldFN0YXR1c0tleQAAAAEAAAACaWQJAAEsAAAAAgUAAAACaWQCAAAAB19zdGF0dXMBAAAACmdldFZvdGVLZXkAAAACAAAAAmlkAAAABHR5cGUDCQAAAAAAAAIFAAAABHR5cGUCAAAABnVwdm90ZQkAASwAAAACBQAAAAJpZAIAAAAHX3Vwdm90ZQkAAAIAAAABAgAAABFJbnZhbGlkIHZvdGUgdHlwZQEAAAAMcHJvZmlsZUV4aXN0AAAAAQAAAAJpZAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzCQEAAA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CBhIHZhbGlkIHZvdGUgdmFsdWUJAAACAAAAAQIAAAAjVGhpcyBwcm9maWxlIGlzIG5vdCBvcGVuIGZvciB2b3RpbmcJAAACAAAAAQIAAAAPSW52YWxpZCBQcm9maWxlCQAAAgAAAAECAAAAFFlvdSBjYW4ndCB2b3RlIHR3aWNlAAAAAWkBAAAACG9wZW5Wb3RlAAAAAQAAAAZ2b3RlSWQDCQEAAAACIT0AAAACCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBQAAAAxhZG1pbkFkZHJlc3MJAAACAAAAAQIAAAAuT25seSBEeXpydXB0IEFkbWluIGNhbiBjYWxsIHRoaXMgZEFwcCBmdW5jdGlvbgMJAQAAAAxwcm9maWxlRXhpc3QAAAABBQAAAAZ2b3RlSWQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAAxnZXRTdGF0dXNLZXkAAAABBQAAAAZ2b3RlSWQCAAAABG9wZW4FAAAAA25pbAkAAAIAAAABAgAAAApJbnZhbGlkIElEAAAAAWkBAAAACWNsb3NlVm90ZQAAAAEAAAAGdm90ZUlkAwkBAAAAAiE9AAAAAggIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwUAAAAMYWRtaW5BZGRyZXNzCQAAAgAAAAECAAAALk9ubHkgRHl6cnVwdCBBZG1pbiBjYW4gY2FsbCB0aGlzIGRBcHAgZnVuY3Rpb24DCQEAAAAMcHJvZmlsZUV4aXN0AAAAAQUAAAAGdm90ZUlkCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAMZ2V0U3RhdHVzS2V5AAAAAQUAAAAGdm90ZUlkAgAAAAZjbG9zZWQFAAAAA25pbAkAAAIAAAABAgAAAApJbnZhbGlkIElEAAAAAJ57AOM=", "chainId": 84, "height": 1165897, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hee47hqHSerHkFYv38TzHviUUTXnxR8pze5pfAZz4927 Next: Eu4ZUxXSzux8gxzQ5NgSd9Q2fsroLQcUNT2UPQ8QUbG4 Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let upVote = "upvote"
5-
6-let downVote = "downvote"
75
86 let adminAddress = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
97
1715
1816 func getVoteKey (id,type) = if ((type == "upvote"))
1917 then (id + "_upvote")
20- else if ((type == "downvote"))
21- then (id + "_downvote")
22- else throw("Invalid vote type")
18+ else throw("Invalid vote type")
2319
2420
2521 func profileExist (id) = match getString(this, getProfileKey(id)) {
7066 then throw("Only Dyzrupt Admin can call this dApp function")
7167 else {
7268 let transactionId = toBase58String(i.transactionId)
73- WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open"), DataEntry(getVoteKey(transactionId, "downvote"), 0)])
69+ WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open")])
7470 }
7571
7672
8581 else if (canVote(toBase58String(i.caller.bytes), voteId))
8682 then if (profileExist(voteId))
8783 then if ((getVoteStatus(voteId) == "open"))
88- then if (if ((vote == upVote))
89- then true
90- else (vote == downVote))
84+ then if ((vote == upVote))
9185 then {
9286 let voteCount = getVoteCount(voteId, vote)
9387 let newVoteCount = (voteCount + 1)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let upVote = "upvote"
5-
6-let downVote = "downvote"
75
86 let adminAddress = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
97
108 let dyzId = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'
119
1210 func getProfileKey (id) = (id + "_entrepreneurProfile")
1311
1412
1513 func getStatusKey (id) = (id + "_status")
1614
1715
1816 func getVoteKey (id,type) = if ((type == "upvote"))
1917 then (id + "_upvote")
20- else if ((type == "downvote"))
21- then (id + "_downvote")
22- else throw("Invalid vote type")
18+ else throw("Invalid vote type")
2319
2420
2521 func profileExist (id) = match getString(this, getProfileKey(id)) {
2622 case a: String =>
2723 true
2824 case _ =>
2925 false
3026 }
3127
3228
3329 func getVoteStatus (voteId) = match getString(this, getStatusKey(voteId)) {
3430 case a: String =>
3531 a
3632 case _ =>
3733 false
3834 }
3935
4036
4137 func getVoteCount (voteId,vote) = match getInteger(this, getVoteKey(voteId, vote)) {
4238 case a: Int =>
4339 a
4440 case _ =>
4541 throw("Not a valid vote ID")
4642 }
4743
4844
4945 func getVoterKey (address,voteId) = ((((address + "_") + voteId) + "_") + "vote")
5046
5147
5248 func getVoter (address,voteId) = match getString(this, getVoterKey(address, voteId)) {
5349 case a: String =>
5450 a
5551 case _ =>
5652 ""
5753 }
5854
5955
6056 func canVote (address,voteId) = {
6157 let voter = getVoter(address, voteId)
6258 if ((voter == ""))
6359 then true
6460 else false
6561 }
6662
6763
6864 @Callable(i)
6965 func addEntrepreneurProfile (name,avatar,bio,gender,location) = if ((i.caller.bytes != adminAddress))
7066 then throw("Only Dyzrupt Admin can call this dApp function")
7167 else {
7268 let transactionId = toBase58String(i.transactionId)
73- WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open"), DataEntry(getVoteKey(transactionId, "downvote"), 0)])
69+ WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open")])
7470 }
7571
7672
7773
7874 @Callable(i)
7975 func vote (voteId,vote) = {
8076 let pmt = extract(i.payment)
8177 if ((pmt.amount == 0))
8278 then throw("You cannot vote without paying voting fee")
8379 else if ((pmt.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'))
8480 then throw("You can only vote with DYZRUPT token")
8581 else if (canVote(toBase58String(i.caller.bytes), voteId))
8682 then if (profileExist(voteId))
8783 then if ((getVoteStatus(voteId) == "open"))
88- then if (if ((vote == upVote))
89- then true
90- else (vote == downVote))
84+ then if ((vote == upVote))
9185 then {
9286 let voteCount = getVoteCount(voteId, vote)
9387 let newVoteCount = (voteCount + 1)
9488 ScriptResult(WriteSet([DataEntry(getVoteKey(voteId, vote), newVoteCount), DataEntry(getVoterKey(toBase58String(i.caller.bytes), voteId), voteId)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
9589 }
9690 else throw("Not a valid vote value")
9791 else throw("This profile is not open for voting")
9892 else throw("Invalid Profile")
9993 else throw("You can't vote twice")
10094 }
10195
10296
10397
10498 @Callable(i)
10599 func openVote (voteId) = if ((i.caller.bytes != adminAddress))
106100 then throw("Only Dyzrupt Admin can call this dApp function")
107101 else if (profileExist(voteId))
108102 then WriteSet([DataEntry(getStatusKey(voteId), "open")])
109103 else throw("Invalid ID")
110104
111105
112106
113107 @Callable(i)
114108 func closeVote (voteId) = if ((i.caller.bytes != adminAddress))
115109 then throw("Only Dyzrupt Admin can call this dApp function")
116110 else if (profileExist(voteId))
117111 then WriteSet([DataEntry(getStatusKey(voteId), "closed")])
118112 else throw("Invalid ID")
119113
120114

github/deemru/w8io/026f985 
41.40 ms