tx · 2T759xNkMH95AGDbZq9w8NR44c4J1NGwxkdF45tuxvSz 3MsAdR9GzaBRgjCNPXtPtGGMz7mKffHFSd8: -0.04000000 Waves 2021.09.06 16:12 [1691237] smart account 3MsAdR9GzaBRgjCNPXtPtGGMz7mKffHFSd8 > SELF 0.00000000 Waves
{ "type": 13, "id": "2T759xNkMH95AGDbZq9w8NR44c4J1NGwxkdF45tuxvSz", "fee": 4000000, "feeAssetId": null, "timestamp": 1630934046765, "version": 2, "chainId": 84, "sender": "3MsAdR9GzaBRgjCNPXtPtGGMz7mKffHFSd8", "senderPublicKey": "EUGSRsTjwWnuaJunshvtppK95VtPd811FAgEzJraTzXC", "proofs": [ "4rLLvaC8d2wXKhUJUdRNEEw725orahzVziDMJPmJxjD8Dj82KZTh17hPxxniiTUcDJ5C3x7QTbr9y8rSBwM2Leyc" ], "script": "base64:AAIFAAAAAAAAACkIAhIGCgQICAgBEgwKCggBAQEBAQEBAQESBAoCCAgSBAoCCAESAwoBCAAAAAQAAAAADGFkbWluQWRkcmVzcwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAAVhZG1pbgIAAAAAAQAAAAt3cml0ZVN0cmluZwAAAAIAAAADa2V5AAAAC3N0cmluZ1ZhbHVlCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAANrZXkFAAAAC3N0cmluZ1ZhbHVlAQAAAAx3cml0ZUludGVnZXIAAAACAAAAA2tleQAAAAxpbnRlZ2VyVmFsdWUJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAANrZXkFAAAADGludGVnZXJWYWx1ZQEAAAAHaXNBZG1pbgAAAAEAAAANY2FsbGVyQWRkcmVzcwMJAAAAAAAAAgUAAAANY2FsbGVyQWRkcmVzcwkAAlkAAAABBQAAAAxhZG1pbkFkZHJlc3MGBwAAAAUAAAABaQEAAAAQc2V0dXBEQXBwQWRkcmVzcwAAAAQAAAAFYWRtaW4AAAALd2F2ZXRyb2xsZXIAA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YWx1ZQMJAQAAAAdpc0FkbWluAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkABEwAAAACCQEAAAAMd3JpdGVJbnRlZ2VyAAAAAgUAAAADa2V5BQAAAAxpbnRlZ2VyVmFsdWUFAAAAA25pbAkAAAIAAAABAgAAACpBZGRyZXNzIGRvZXMgbm90IG1hdGNoIHdpdGggYWRtaW4gYWRkcmVzcyEAAAABaQEAAAASZGVsZXRlU3RvcmFnZUVudHJ5AAAAAQAAAANrZXkDCQEAAAAHaXNBZG1pbgAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAADa2V5BQAAAANuaWwJAAACAAAAAQIAAAAqQWRkcmVzcyBkb2VzIG5vdCBtYXRjaCB3aXRoIGFkbWluIGFkZHJlc3MhAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnuKSfB", "height": 1691237, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GdKYjqyrrM5VTPh8yg7Uvt2VVCoxZXznGKZtqDpnZg6Y Next: none Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | ||
16 | 16 | ||
17 | 17 | @Callable(i) | |
18 | - | func setupDAppAddress (admin,wavetroller, | |
19 | - | then [writeString("admin", admin), writeString("wavetroller", wavetroller), writeString(" | |
18 | + | func setupDAppAddress (admin,wavetroller,oracle,closeFactor) = if (!(isDefined(getString(this, "admin")))) | |
19 | + | then [writeString("admin", admin), writeString("wavetroller", wavetroller), writeString("oracle", oracle), writeInteger("closeFactor", closeFactor)] | |
20 | 20 | else throw("Dapp already setup!") | |
21 | 21 | ||
22 | 22 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminAddress = valueOrElse(getString(this, "admin"), "") | |
5 | 5 | ||
6 | 6 | func writeString (key,stringValue) = StringEntry(key, stringValue) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func writeInteger (key,integerValue) = IntegerEntry(key, integerValue) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func isAdmin (callerAddress) = if ((callerAddress == fromBase58String(adminAddress))) | |
13 | 13 | then true | |
14 | 14 | else false | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | @Callable(i) | |
18 | - | func setupDAppAddress (admin,wavetroller, | |
19 | - | then [writeString("admin", admin), writeString("wavetroller", wavetroller), writeString(" | |
18 | + | func setupDAppAddress (admin,wavetroller,oracle,closeFactor) = if (!(isDefined(getString(this, "admin")))) | |
19 | + | then [writeString("admin", admin), writeString("wavetroller", wavetroller), writeString("oracle", oracle), writeInteger("closeFactor", closeFactor)] | |
20 | 20 | else throw("Dapp already setup!") | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func setupAssetParameter (assetId,decimals,collateralFactor,threshold,penalty,reserveFactor,multiplier,kink,jumpMultiplier,baseRate) = if (isAdmin(i.caller.bytes)) | |
26 | 26 | then [writeInteger((assetId + "_Decimals"), decimals), writeInteger((assetId + "_CollateralFactor"), collateralFactor), writeInteger((assetId + "_Threshold"), threshold), writeInteger((assetId + "_Penalty"), penalty), writeInteger((assetId + "_ReserveFactor"), reserveFactor), writeInteger((assetId + "_Multiplier"), multiplier), writeInteger((assetId + "_Kink"), kink), writeInteger((assetId + "_JumpMultiplier"), jumpMultiplier), writeInteger((assetId + "_BaseRate"), baseRate)] | |
27 | 27 | else throw("Address does not match with admin address!") | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | 32 | func updateStringEntry (key,stringValue) = if (isAdmin(i.caller.bytes)) | |
33 | 33 | then [writeString(key, stringValue)] | |
34 | 34 | else throw("Address does not match with admin address!") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Callable(i) | |
39 | 39 | func updateIntegerEntry (key,integerValue) = if (isAdmin(i.caller.bytes)) | |
40 | 40 | then [writeInteger(key, integerValue)] | |
41 | 41 | else throw("Address does not match with admin address!") | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(i) | |
46 | 46 | func deleteStorageEntry (key) = if (isAdmin(i.caller.bytes)) | |
47 | 47 | then [DeleteEntry(key)] | |
48 | 48 | else throw("Address does not match with admin address!") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Verifier(tx) | |
52 | 52 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
53 | 53 |
github/deemru/w8io/169f3d6 31.85 ms ◑