tx · 4QQS8K1rJGtzaZbHznVwyV5redYku5y5mLbW722jpScC

3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw:  -0.01000000 Waves

2023.02.06 13:26 [2437629] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves

{ "type": 13, "id": "4QQS8K1rJGtzaZbHznVwyV5redYku5y5mLbW722jpScC", "fee": 1000000, "feeAssetId": null, "timestamp": 1675679296797, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "2FWJXGBwGTZ1b14GvKDYgC89s9uqpWpCo8493hEtP7qmPVd56SX2BxMhYj2XtUju18mE88ZkHch2TC8U1Auvf2Qh" ], "script": "base64:BgIMCAISAwoBCBIDCgEIBwENdHJ5R2V0SW50ZWdlcgEDa2V5BAN2YWwEByRtYXRjaDAJAJoIAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQBYgUHJG1hdGNoMAUBYgAABQN2YWwBDHRyeUdldFN0cmluZwEDa2V5BAN2YWwEByRtYXRjaDAJAJ0IAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACBlN0cmluZwQBYgUHJG1hdGNoMAUBYgIABQN2YWwBB2lzT3duZXIBB2FkZHJlc3MJAAACBQdhZGRyZXNzBQR0aGlzAQhnZXRHcm91cAAEA3ZhbAQHJG1hdGNoMAkAnQgCBQR0aGlzAhV3b3JraW5nX2dyb3VwX21lbWJlcnMDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFiBQckbWF0Y2gwBQFiAgAFA3ZhbAEKZ2V0TWVtYmVycwAEA3ZhbAQHJG1hdGNoMAkAnQgCBQR0aGlzAgtkYW9fbWVtYmVycwMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAWIFByRtYXRjaDAFAWICAAUDdmFsAQ1pc0dyb3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JvdXBfbWVtYmVyXwUNbWVtYmVyQWRkcmVzcwIHX3dlaWdodAABCQACAQIYVGhpcyB1c2VyIGFscmVhZHkgZXhpc3RzBAVncm91cAkBCGdldEdyb3VwAAQIbmV3R3JvdXAJAKwCAgkArAICBQVncm91cAIBOwUNbWVtYmVyQWRkcmVzcwQJZ3JvdXBTaXplCQENdHJ5R2V0SW50ZWdlcgECEndvcmtpbmdfZ3JvdXBfc2l6ZQQMbmV3R3JvdXBTaXplCQBkAgUJZ3JvdXBTaXplAAEJAMwIAgkBC1N0cmluZ0VudHJ5AgIVd29ya2luZ19ncm91cF9tZW1iZXJzBQhuZXdHcm91cAkAzAgCCQEMSW50ZWdlckVudHJ5AgISd29ya2luZ19ncm91cF9zaXplBQxuZXdHcm91cFNpemUJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICAhV3b3JraW5nX2dyb3VwX21lbWJlcl8FDW1lbWJlckFkZHJlc3MCB193ZWlnaHQAAQUDbmlsAQJ0eAEQc3RhbmRhcmRWZXJpZmllcgAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlQDT6M", "height": 2437629, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ne76Q2ub7mqDpCsRtGSt5s5xfxhkc4bghXmdyN7Jtar Next: 4qw8tjoqJaegrwwqaA516zMpnay7MycZwN4ABMFvt6wv Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+func tryGetInteger (key) = {
5+ let val = match getInteger(this, key) {
6+ case b: Int =>
7+ b
8+ case _ =>
9+ 0
10+ }
11+ val
12+ }
13+
14+
15+func tryGetString (key) = {
16+ let val = match getString(this, key) {
17+ case b: String =>
18+ b
19+ case _ =>
20+ ""
21+ }
22+ val
23+ }
24+
25+
26+func isOwner (address) = (address == this)
27+
28+
29+func getGroup () = {
30+ let val = match getString(this, "working_group_members") {
31+ case b: String =>
32+ b
33+ case _ =>
34+ ""
35+ }
36+ val
37+ }
38+
39+
40+func getMembers () = {
41+ let val = match getString(this, "dao_members") {
42+ case b: String =>
43+ b
44+ case _ =>
45+ ""
46+ }
47+ val
48+ }
49+
50+
51+func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
52+
53+
54+func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0)
455
556
657 @Callable(i)
7-func mintNft (ipfsImageHash) = {
8- let recipient = i.caller
9- let asset1 = Issue("aaaaba", "swsdsds", 1, 0, false)
10- let assetId1 = calculateAssetId(asset1)
11- let asset2 = Issue("bbbcbb", "sdfdsfdsfdsfd", 1, 0, false)
12- let assetId2 = calculateAssetId(asset2)
13-[asset1, asset2, StringEntry((toBase58String(assetId1) + "_ipfs"), ipfsImageHash), StringEntry((toBase58String(assetId2) + "_ipfs"), ipfsImageHash), ScriptTransfer(recipient, 1, assetId1), ScriptTransfer(recipient, 1, assetId2)]
14- }
58+func addDAOMember (memberAddress) = if (!(isOwner(i.caller)))
59+ then throw("access only to the DAO owner")
60+ else if ((tryGetInteger((("dao_member_" + memberAddress) + "_weight")) == 1))
61+ then throw("This user already exists")
62+ else {
63+ let group = getMembers()
64+ let newGroup = ((group + ";") + memberAddress)
65+ let groupSize = tryGetInteger("dao_size")
66+ let newGroupSize = (groupSize + 1)
67+[StringEntry("dao_members", newGroup), IntegerEntry("dao_size", newGroupSize), IntegerEntry((("dao_member_" + memberAddress) + "_weight"), 1)]
68+ }
1569
70+
71+
72+@Callable(i)
73+func addGroupMember (memberAddress) = if (!(isOwner(i.caller)))
74+ then throw("access only to the DAO owner")
75+ else if ((tryGetInteger((("working_group_member_" + memberAddress) + "_weight")) == 1))
76+ then throw("This user already exists")
77+ else {
78+ let group = getGroup()
79+ let newGroup = ((group + ";") + memberAddress)
80+ let groupSize = tryGetInteger("working_group_size")
81+ let newGroupSize = (groupSize + 1)
82+[StringEntry("working_group_members", newGroup), IntegerEntry("working_group_size", newGroupSize), IntegerEntry((("working_group_member_" + memberAddress) + "_weight"), 1)]
83+ }
84+
85+
86+@Verifier(tx)
87+func standardVerifier () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
1688

github/deemru/w8io/026f985 
19.54 ms