tx · FQ6hkEt3dQ2Y4TgAUvv9d9ogU2PVsLT93nNPv12VjSZP 3MxiJLrY6Qa5bSYxxSFHSG5bVV2n59x1MGn: -0.01400000 Waves 2022.05.17 12:50 [2055506] smart account 3MxiJLrY6Qa5bSYxxSFHSG5bVV2n59x1MGn > SELF 0.00000000 Waves
{ "type": 13, "id": "FQ6hkEt3dQ2Y4TgAUvv9d9ogU2PVsLT93nNPv12VjSZP", "fee": 1400000, "feeAssetId": null, "timestamp": 1652781100484, "version": 2, "chainId": 84, "sender": "3MxiJLrY6Qa5bSYxxSFHSG5bVV2n59x1MGn", "senderPublicKey": "9M1hAsbWkVP73NKHvZezCkamwZfSdkejc3b8sejqT98D", "proofs": [ "5WxNLfDWQafN2uSxnbjG1CuDPURqcF3EuzmQGGVaQaVUpF7qgMkRZFSiuhri9AcEHoqPg751gaEFqbhjdL1Ri96e" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAwAAAAACXNlcGFyYXRvcgIAAAABXwAAAAAOa2V5Q3VycmVudExhbmQCAAAADGN1cnJlbnRfbGFuZAAAAAARa2V5U3RhcnRpbmdIZWlnaHQCAAAAD3N0YXJ0aW5nX2hlaWdodAAAAAAca2V5U3RhcnRpbmdHZW5lcmF0ZWRTdXBwbGllcwIAAAAbc3RhcnRpbmdfZ2VuZXJhdGVkX3N1cHBsaWVzAAAAAAdnb3ZBZGRyCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABAgAAACMzTXl4Znd2YnVlVUJ5bllIZlFzdXROWFpOcU5vekdpTW5zRwAAAAAVa2V5RWNvc3lzdGVtQWRkcmVzc2VzAgAAABNlY29zeXN0ZW1fYWRkcmVzc2VzAAAAAA1rZXlUb3RhbExhbmRzAgAAAAt0b3RhbF9sYW5kcwAAAAAJY2hhcnNBZGRyCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABAgAAACMzTkEzTFJTaWdrNmtuTFoxNnVUemNkTE5vdzJFUVp0WFRhSgAAAAAHa2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5kZXJQdWJsaWNLZXkBgnLT", "height": 2055506, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 3LapG6R7tHyCvhzxeDJreDFqL3uefc2BH2XJNEQK39pa Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let separator = "_" | |
5 | + | ||
6 | + | let keyCurrentLand = "current_land" | |
7 | + | ||
8 | + | let keyStartingHeight = "starting_height" | |
9 | + | ||
10 | + | let keyStartingGeneratedSupplies = "starting_generated_supplies" | |
11 | + | ||
12 | + | let govAddr = addressFromStringValue("3MyxfwvbueUBynYHfQsutNXZNqNozGiMnsG") | |
13 | + | ||
14 | + | let keyEcosystemAddresses = "ecosystem_addresses" | |
15 | + | ||
16 | + | let keyTotalLands = "total_lands" | |
17 | + | ||
18 | + | let charsAddr = addressFromStringValue("3NA3LRSigk6knLZ16uTzcdLNow2EQZtXTaJ") | |
19 | + | ||
20 | + | let keyChar = "char" | |
21 | + | ||
22 | + | let keyOwner = "owner" | |
23 | + | ||
24 | + | func invokChecks (callerAddr) = if ((isDataStorageUntouched(govAddr) != false)) | |
25 | + | then throw("Governing app not ready") | |
26 | + | else { | |
27 | + | let ecosystemAddresses = getStringValue(govAddr, keyEcosystemAddresses) | |
28 | + | if ((contains(ecosystemAddresses, toString(callerAddr)) != false)) | |
29 | + | then throw("Access denied") | |
30 | + | else unit | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func with (a,b) = ((toString(b) + separator) + a) | |
35 | + | ||
36 | + | ||
37 | + | @Callable(i) | |
38 | + | func bindCharToLand (charId,landId) = valueOrElse(invokChecks(i.caller), if ((getStringValue(charsAddr, with(keyOwner, charId)) != toBase58String(i.caller.bytes))) | |
39 | + | then throw("Caller doesn't own this char") | |
40 | + | else if (if ((1 > landId)) | |
41 | + | then true | |
42 | + | else (landId > getIntegerValue(govAddr, keyTotalLands))) | |
43 | + | then throw("Unknown land") | |
44 | + | else { | |
45 | + | let currentGeneratedTokensResult = invoke(govAddr, "getGeneratedSupplies", nil, nil) | |
46 | + | if ((currentGeneratedTokensResult == currentGeneratedTokensResult)) | |
47 | + | then { | |
48 | + | let currentGeneratedTokens = match currentGeneratedTokensResult { | |
49 | + | case isInt: Int => | |
50 | + | isInt | |
51 | + | case _ => | |
52 | + | throw("Invok result") | |
53 | + | } | |
54 | + | [IntegerEntry(with(keyCurrentLand, charId), landId), IntegerEntry(with(keyStartingHeight, charId), height), IntegerEntry(with(keyStartingGeneratedSupplies, charId), currentGeneratedTokens)] | |
55 | + | } | |
56 | + | else throw("Strict value is not equal to itself.") | |
57 | + | }) | |
58 | + | ||
59 | + | ||
60 | + | @Verifier(tx) | |
61 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
62 | + |
github/deemru/w8io/169f3d6 24.23 ms ◑