tx · jLPSmhQzuS5vMgazM2xAB4tS2yWqbsFZp6xvVkVoXie 3N7Q1A85UJYsFkKs7gTNykVtJUP8rShHxzQ: -0.05000000 Waves 2021.08.26 09:58 [1674979] smart account 3N7Q1A85UJYsFkKs7gTNykVtJUP8rShHxzQ > SELF 0.00000000 Waves
{ "type": 13, "id": "jLPSmhQzuS5vMgazM2xAB4tS2yWqbsFZp6xvVkVoXie", "fee": 5000000, "feeAssetId": null, "timestamp": 1629961180406, "version": 2, "chainId": 84, "sender": "3N7Q1A85UJYsFkKs7gTNykVtJUP8rShHxzQ", "senderPublicKey": "DhWQjtpNVFzp4EWBSS2akyL4uLUjThi5jFbLe28U7gcP", "proofs": [ "4K25RQ6BtyQgesVmGmPhSCF7MyTcFdw7aF3CPjuefduXNAr11wZBFz1UG2jtiTmFhFyy8eTJLPnouJyNs7Avj5Zw" ], "script": "base64:AAIFAAAAAAAAAB0IAhIJCgcICAgICAEIEgQKAggBEgMKAQESAwoBAQAAABsAAAAAA1NFUAIAAAACX18AAAAAClBvb2xBY3RpdmUAAAAAAAAAAAEAAAAAD1Bvb2xQdXREaXNhYmxlZAAAAAAAAAAAAgAAAAATUG9vbE1hdGNoZXJEaXNhYmxlZAAAAAAAAAAAAwAAAAAMUG9vbFNodXRkb3duAAAAAAAAAAAEAAAAABJpZHhJbnRlcm5hbEFzc2V0SWQAAAAAAAAAAAEAAAAAD2lkeFJlc3V0QWN0aW9ucwAAAAAAAAAAAgAAAAAgaWR4SWZBc3NldElkQ2FsY3VsYXRpb25QZXJmb3JtZWQAAAAAAAAAAAMBAAAAE2tleU1hdGNoZXJQdWJsaWNLZXkAAAAAAgAAABQlc19fbWF0Y2hlclB1YmxpY0tleQEAAAARa2V5UG9vbFNjcmlwdEhhc2gAAAAAAgAAABYlcyVzX19wb29sX19zY3JpcHRIYXNoAQAAABBrZXlQcmljZURlY2ltYWxzAAAAAAIAAAARJXNfX3ByaWNlRGVjaW1hbHMBAAAAE2tleUFsbFBvb2xzU2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ZGF0YU1hcHBpbmdQb29sQXNzZXRzAAAAAgUAAAAVaW50ZXJuYWxBbW91bnRBc3NldElkBQAAABRpbnRlcm5hbFByaWNlQXNzZXRJZAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAD2tleVBvb2xUb1dlaWdodAAAAAEFAAAAC3Bvb2xBZGRyZXNzBQAAAApwb29sV2VpZ2h0BQAAAANuaWwCAAAAB3N1Y2Nlc3MJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAWkBAAAACm1hbmFnZVBvb2wAAAACAAAAEWxwQ29udHJhY3RBZGRyZXNzAAAACW5ld1N0YXR1cwMJAQAAAAIhPQAAAAIIBQAAAAFpAAAABmNhbGxlcgUAAAAEdGhpcwkAAAIAAAABAgAAABJwZXJtaXNzaW9ucyBkZW5pZWQFAAAAA25pbAAAAAFpAQAAAARlbWl0AAAAAQAAAAxhbW91bnRUb0VtaXQFAAAAA25pbAAAAAFpAQAAAARidXJuAAAAAQAAAAxhbW91bnRUb0VtaXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5j4ZwQA==", "height": 1674979, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BHz5ynEzztrUg3WgqRt7pRSuw7MCB4FNc3ib6vZfyCwV Next: 5AeL12EMjgtRaoPKU4CjTwaogdMUK3sXxUx3G56JiEUc Diff:
Old | New | Differences | |
---|---|---|---|
110 | 110 | if ((lpAssetIdStr == "")) | |
111 | 111 | then throw("Failure during dapp2dapp call activate on Pool.") | |
112 | 112 | else { | |
113 | - | let amountAssetsDecimals = if ((amountAssetStr == "")) | |
113 | + | let amountAssetsDecimals = if ((amountAssetStr == "WAVES")) | |
114 | 114 | then 8 | |
115 | 115 | else value(assetInfo(fromBase58String(amountAssetStr))).decimals | |
116 | 116 | let priceAssetsDecimals = value(assetInfo(fromBase58String(priceAssetStr))).decimals |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let PoolActive = 1 | |
7 | 7 | ||
8 | 8 | let PoolPutDisabled = 2 | |
9 | 9 | ||
10 | 10 | let PoolMatcherDisabled = 3 | |
11 | 11 | ||
12 | 12 | let PoolShutdown = 4 | |
13 | 13 | ||
14 | 14 | let idxInternalAssetId = 1 | |
15 | 15 | ||
16 | 16 | let idxResutActions = 2 | |
17 | 17 | ||
18 | 18 | let idxIfAssetIdCalculationPerformed = 3 | |
19 | 19 | ||
20 | 20 | func keyMatcherPublicKey () = "%s__matcherPublicKey" | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func keyPoolScriptHash () = "%s%s__pool__scriptHash" | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func keyPriceDecimals () = "%s__priceDecimals" | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func keyAllPoolsShutdown () = "%s__shutdown" | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func keyNextInternalAssetId () = "%s__nextInternalAssetId" | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func keyPoolToWeight (poolAddress) = ("%s%d__poolWeight__" + poolAddress) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset)) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func keyPoolConfig (amountAssetInternal,priceAssetInternal) = (((("%d%d%s__" + amountAssetInternal) + "__") + priceAssetInternal) + "__config") | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func keyMappingLpAssetToPoolAssets (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2Pool") | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyMappingPoolAssetsToLpasset (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + internalAmountAssetIdStr) + "__") + internalPriceAssetIdStr) + "__mappings__PoolAssets2LpAsset") | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__lpAsset2PoolContract") | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key)) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key)) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func dataPoolCfg (poolAddress,poolStatus,lpAssetId,amountAssetStr,priceAssetStr,amountAssetDecimals,priceAssetDecimals,amountAssetInternalId,priceAssetInternalId,poolWeight,lpAssetDecimals,matcherPublicKey) = makeString(["%s%d%s%s%s%d%d%d%d%d%d%s", poolAddress, poolStatus, lpAssetId, amountAssetStr, priceAssetStr, toString(amountAssetDecimals), toString(priceAssetDecimals), toString(amountAssetInternalId), toString(priceAssetInternalId), toString(poolWeight), toString(lpAssetDecimals), matcherPublicKey], SEP) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func dataMappingPoolAssets (internalAmountAssetStr,internalPriceAssetStr) = makeString(["%d%d", toString(internalAmountAssetStr), toString(internalPriceAssetStr)], SEP) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func getInternalAssetIdOrCreate (assetIdStr,incrementor) = { | |
75 | 75 | let internalAssetId = valueOrElse(getInteger(this, keyMappingsBaseAsset2internalId(assetIdStr)), 0) | |
76 | 76 | let currentIndexOfInternalId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0) | |
77 | 77 | let result = if ((internalAssetId == 0)) | |
78 | 78 | then { | |
79 | 79 | let newInternalAssetId = (currentIndexOfInternalId + incrementor) | |
80 | 80 | $Tuple3(newInternalAssetId, [IntegerEntry(keyNextInternalAssetId(), newInternalAssetId), IntegerEntry(keyMappingsBaseAsset2internalId(assetIdStr), newInternalAssetId), StringEntry(keyMappingsInternal2baseAssetId(newInternalAssetId), assetIdStr)], true) | |
81 | 81 | } | |
82 | 82 | else $Tuple3(internalAssetId, nil, false) | |
83 | 83 | result | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | @Callable(i) | |
88 | 88 | func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight,matcherPublicKey) = if ((i.caller != this)) | |
89 | 89 | then throw("permissions denied") | |
90 | 90 | else if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress)))) | |
91 | 91 | then throw((("Pool address " + poolAddress) + " already registered.")) | |
92 | 92 | else { | |
93 | 93 | let internalAmountAssetData = getInternalAssetIdOrCreate(amountAssetStr, 1) | |
94 | 94 | let internalAmountAssetId = internalAmountAssetData._1 | |
95 | 95 | let internalPriceAssetData = getInternalAssetIdOrCreate(priceAssetStr, if (internalAmountAssetData._3) | |
96 | 96 | then 2 | |
97 | 97 | else 1) | |
98 | 98 | let internalPriceAssetId = internalPriceAssetData._1 | |
99 | 99 | let poolAccountScriptHash = valueOrErrorMessage(scriptHash(addressFromStringValue(poolAddress)), ("No script has been found on pool account " + poolAddress)) | |
100 | 100 | let ethalonPoolAccountScriptHash = getBinaryValue(keyPoolScriptHash()) | |
101 | 101 | let poolConfig = getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId))) | |
102 | 102 | if (isDefined(poolConfig)) | |
103 | 103 | then throw((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated.")) | |
104 | 104 | else { | |
105 | 105 | let poolConfigValue = value(getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)))) | |
106 | 106 | let poolActivateInvokeResult = invoke(addressFromStringValue(poolAddress), "activate", [amountAssetStr, priceAssetStr, lpAssetName, lpAssetDescr, poolWeight], nil) | |
107 | 107 | if ((poolActivateInvokeResult == poolActivateInvokeResult)) | |
108 | 108 | then { | |
109 | 109 | let lpAssetIdStr = valueOrElse(poolActivateInvokeResult, "") | |
110 | 110 | if ((lpAssetIdStr == "")) | |
111 | 111 | then throw("Failure during dapp2dapp call activate on Pool.") | |
112 | 112 | else { | |
113 | - | let amountAssetsDecimals = if ((amountAssetStr == "")) | |
113 | + | let amountAssetsDecimals = if ((amountAssetStr == "WAVES")) | |
114 | 114 | then 8 | |
115 | 115 | else value(assetInfo(fromBase58String(amountAssetStr))).decimals | |
116 | 116 | let priceAssetsDecimals = value(assetInfo(fromBase58String(priceAssetStr))).decimals | |
117 | 117 | $Tuple2(((internalAmountAssetData._2 ++ internalPriceAssetData._2) ++ [StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(PoolActive), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, poolWeight, 8, matcherPublicKey)), StringEntry(keyMappingLpAssetToPoolAssets(lpAssetIdStr), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToLpasset(toString(internalAmountAssetId), toString(internalPriceAssetId)), ("%s__" + lpAssetIdStr)), StringEntry(keyMappingPoolContractAddressToPoolAssets(poolAddress), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), IntegerEntry(keyPoolToWeight(poolAddress), poolWeight)]), "success") | |
118 | 118 | } | |
119 | 119 | } | |
120 | 120 | else throw("Strict value is not equal to itself.") | |
121 | 121 | } | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | ||
126 | 126 | @Callable(i) | |
127 | 127 | func managePool (lpContractAddress,newStatus) = if ((i.caller != this)) | |
128 | 128 | then throw("permissions denied") | |
129 | 129 | else nil | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | ||
133 | 133 | @Callable(i) | |
134 | 134 | func emit (amountToEmit) = nil | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(i) | |
139 | 139 | func burn (amountToEmit) = nil | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Verifier(tx) | |
143 | 143 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
144 | 144 |
github/deemru/w8io/fabc49c 37.33 ms ◑