tx · 5Hby5paWZK9a5daJyVhbjTCzEaTBCxP2nb4h9L9ZGFf2 3Mtko7KtZDyt532TGHjRUoVahuviQKwbBFt: -0.01400000 Waves 2021.10.07 13:30 [1735693] smart account 3Mtko7KtZDyt532TGHjRUoVahuviQKwbBFt > SELF 0.00000000 Waves
{ "type": 13, "id": "5Hby5paWZK9a5daJyVhbjTCzEaTBCxP2nb4h9L9ZGFf2", "fee": 1400000, "feeAssetId": null, "timestamp": 1633602688031, "version": 1, "sender": "3Mtko7KtZDyt532TGHjRUoVahuviQKwbBFt", "senderPublicKey": "GptvgtKyc2q5oyNw5gDtNYbcX6wsDyRMVRaAuFUZmzfy", "proofs": [ "5otpJjmnvNwiAP2aYnRSDagotXwVZbZndq9YfmfTGfbqWQFJjZErUu2q6oTRbhys7NVJyQUu6MitvHzHUeyo4gzE" ], "script": "base64:AAIFAAAAAAAAACgIAhIKCggICAgICAgIARIICgYICAgICAESBAoCCAESAwoBARIDCgEBAAAAIQAAAAARZGVjaW1hbHNNdWx0UHJpY2UJAABoAAAAAgkAAGgAAAACAAAAAAAAAABkAAAAAAAAAAPoAAAAAAAAAAPoAAAAAANTRVACAAAAAl9fAAAAAApQb29sQWN0aXZlAAAAAAAAAAABAAAAAA9Qb29sUHV0RGlzYWJsZWQAAAAAAAAAAAIAAAAAE1Bvb2xNYXRjaGVyRGlzYWJsZWQAAAAAAAAAAAMAAAAADFBvb2xTaHV0ZG93bgAAAAAAAAAABAAAAAASaWR4SW50ZXJuYWxBc3NldElkAAAAAAAAAAABAAAAAA9pZHhSZXN1dEFjdGlvbnMAAAAAAAAAAAIAAAAAIGlkeElmQXNzZXRJZENhbGN1bGF0aW9uUGVyZm9ybWVkAAAAAAAAAAADAQAAABBrZXlGYWN0b3J5Q29uZmlnAAAAAAIAAAARJXNfX2ZhY3RvcnlDb25maWcBAAAAD2tleUxwVG9rZW5zTGlzdAAAAAACAAAAECVzX19scFRva2Vuc0xpc3QBAAAAEWtleVBvb2xTY3JpcHRI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YW1vdW50BAAAAA9pbkFtb3VudEFzc2V0SWQJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQgFAAAAB3BheW1lbnQAAAAHYXNzZXRJZAQAAAAabHBBc3NldFJlcXVlc3RlZEZvckJ1cm5pbmcJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABCIAAAABCQEAAAAea2V5TWFwcGluZ1Bvb2xDb250cmFjVG9MUEFzc2V0AAAAAQkABCUAAAABBQAAAAZjYWxsZXICAAAAHUludmFsaWQgTFAgYWRkcmVzcyBjYWxsZWQgbWUuAwkBAAAAAiE9AAAAAgUAAAAPaW5BbW91bnRBc3NldElkBQAAABpscEFzc2V0UmVxdWVzdGVkRm9yQnVybmluZwkAAAIAAAABAgAAABVJbnZhbGlkIGFzc2V0IHBhc3NlZC4DCQEAAAACIT0AAAACBQAAAAxhbW91bnRUb0J1cm4FAAAADXBheW1lbnRBbW91bnQJAAACAAAAAQIAAAAWSW52YWxpZCBhbW91bnQgcGFzc2VkLgQAAAAHbHBBc3NldAkAAlkAAAABBQAAABpscEFzc2V0UmVxdWVzdGVkRm9yQnVybmluZwkABRQAAAACCQAETAAAAAIJAQAAAARCdXJuAAAAAgUAAAAHbHBBc3NldAUAAAAMYW1vdW50VG9CdXJuBQAAAANuaWwCAAAAB3N1Y2Nlc3MAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebRz8+k=", "chainId": 84, "height": 1735693, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FbdNVGTqCJ2DbJG2rj3fqtPQtL8mmHcpkoqEyhrCi6oZ Next: none Diff:
Old | New | Differences | |
---|---|---|---|
20 | 20 | let idxIfAssetIdCalculationPerformed = 3 | |
21 | 21 | ||
22 | 22 | func keyFactoryConfig () = "%s__factoryConfig" | |
23 | + | ||
24 | + | ||
25 | + | func keyLpTokensList () = "%s__lpTokensList" | |
23 | 26 | ||
24 | 27 | ||
25 | 28 | func keyPoolScriptHash () = "%s%s__pool__scriptHash" | |
73 | 76 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
74 | 77 | ||
75 | 78 | ||
76 | - | func dataFactoryCfg (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract) = makeString(["%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract], SEP) | |
79 | + | func dataFactoryCfg (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract) = makeString(["%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract], SEP) | |
77 | 80 | ||
78 | 81 | ||
79 | - | func dataPoolCfg (poolAddress,poolStatus,lpAssetId,amountAssetStr,priceAssetStr,amountAssetDecimals,priceAssetDecimals,amountAssetInternalId,priceAssetInternalId,lpAssetDecimals | |
82 | + | func dataPoolCfg (poolAddress,poolStatus,lpAssetId,amountAssetStr,priceAssetStr,amountAssetDecimals,priceAssetDecimals,amountAssetInternalId,priceAssetInternalId,lpAssetDecimals) = makeString(["%s%d%s%s%s%d%d%d%d%d%s", poolAddress, poolStatus, lpAssetId, amountAssetStr, priceAssetStr, toString(amountAssetDecimals), toString(priceAssetDecimals), toString(amountAssetInternalId), toString(priceAssetInternalId), toString(lpAssetDecimals)], SEP) | |
80 | 83 | ||
81 | 84 | ||
82 | 85 | func dataMappingPoolAssets (internalAmountAssetStr,internalPriceAssetStr) = makeString(["%d%d", toString(internalAmountAssetStr), toString(internalPriceAssetStr)], SEP) | |
95 | 98 | } | |
96 | 99 | ||
97 | 100 | ||
101 | + | func createLpTokensListEntry (newLpToken) = { | |
102 | + | let lpTokens = getString(this, keyLpTokensList()) | |
103 | + | if (isDefined(lpTokens)) | |
104 | + | then ((value(lpTokens) + SEP) + newLpToken) | |
105 | + | else newLpToken | |
106 | + | } | |
107 | + | ||
108 | + | ||
98 | 109 | @Callable(i) | |
99 | - | func constructor (stakingContract,boostingContract,idoContract,teamContract,emissionContract,restContract,priceDecimals) = if ((i.caller != this)) | |
110 | + | func constructor (stakingContract,boostingContract,idoContract,teamContract,emissionContract,restContract,slpipageContract,priceDecimals) = if ((i.caller != this)) | |
100 | 111 | then throw("permissions denied") | |
101 | - | else [StringEntry(keyFactoryConfig(), dataFactoryCfg(stakingContract, boostingContract, idoContract, teamContract, emissionContract, restContract)), IntegerEntry(keyPriceDecimals(), priceDecimals)] | |
112 | + | else [StringEntry(keyFactoryConfig(), dataFactoryCfg(stakingContract, boostingContract, idoContract, teamContract, emissionContract, restContract, slpipageContract)), IntegerEntry(keyPriceDecimals(), priceDecimals)] | |
102 | 113 | ||
103 | 114 | ||
104 | 115 | ||
105 | 116 | @Callable(i) | |
106 | - | func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight | |
117 | + | func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight) = if ((i.caller != this)) | |
107 | 118 | then throw("permissions denied") | |
108 | 119 | else if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress)))) | |
109 | 120 | then throw((("Pool address " + poolAddress) + " already registered.")) | |
134 | 145 | if ((poolActivateInvokeResult == poolActivateInvokeResult)) | |
135 | 146 | then if ((poolActivateInvokeResult != "success")) | |
136 | 147 | then throw("Pool initialisation error happened.") | |
137 | - | else $Tuple2(((internalAmountAssetData._2 ++ internalPriceAssetData._2) ++ [lpAssetIssueAction, Burn(lpAssetId, 1), StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(PoolActive), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, decimalsMultPrice | |
148 | + | else $Tuple2(((internalAmountAssetData._2 ++ internalPriceAssetData._2) ++ [lpAssetIssueAction, Burn(lpAssetId, 1), StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(PoolActive), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, decimalsMultPrice)), StringEntry(keyMappingLpAssetToPoolAssets(lpAssetIdStr), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToLpasset(toString(internalAmountAssetId), toString(internalPriceAssetId)), ("%s__" + lpAssetIdStr)), StringEntry(keyMappingPoolContractAddressToPoolAssets(poolAddress), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToPoolContractAddress(internalAmountAssetId, internalPriceAssetId), poolAddress), StringEntry(keyMappingPoolLPAssetToPoolContractAddress(lpAssetIdStr), poolAddress), StringEntry(keyMappingPoolContracToLPAsset(poolAddress), lpAssetIdStr), IntegerEntry(keyPoolToWeight(poolAddress), poolWeight), StringEntry(keyLpTokensList(), createLpTokensListEntry(lpAssetIdStr))]), "success") | |
138 | 149 | else throw("Strict value is not equal to itself.") | |
139 | 150 | } | |
140 | 151 | } | |
154 | 165 | let originCaller = i.originCaller | |
155 | 166 | let lpAssetRequested = valueOrErrorMessage(getString(keyMappingPoolContracToLPAsset(toString(caller))), "Invalid LP address called me.") | |
156 | 167 | let lpAsset = fromBase58String(lpAssetRequested) | |
157 | - | $Tuple2([Reissue(lpAsset, amountToEmit, true), ScriptTransfer(i.caller, amountToEmit, lpAsset)], "success") | |
168 | + | if ((amountToEmit > 0)) | |
169 | + | then $Tuple2([Reissue(lpAsset, amountToEmit, true), ScriptTransfer(i.caller, amountToEmit, lpAsset)], "success") | |
170 | + | else nil | |
158 | 171 | } | |
159 | 172 | ||
160 | 173 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let decimalsMultPrice = ((100 * 1000) * 1000) | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let PoolActive = 1 | |
9 | 9 | ||
10 | 10 | let PoolPutDisabled = 2 | |
11 | 11 | ||
12 | 12 | let PoolMatcherDisabled = 3 | |
13 | 13 | ||
14 | 14 | let PoolShutdown = 4 | |
15 | 15 | ||
16 | 16 | let idxInternalAssetId = 1 | |
17 | 17 | ||
18 | 18 | let idxResutActions = 2 | |
19 | 19 | ||
20 | 20 | let idxIfAssetIdCalculationPerformed = 3 | |
21 | 21 | ||
22 | 22 | func keyFactoryConfig () = "%s__factoryConfig" | |
23 | + | ||
24 | + | ||
25 | + | func keyLpTokensList () = "%s__lpTokensList" | |
23 | 26 | ||
24 | 27 | ||
25 | 28 | func keyPoolScriptHash () = "%s%s__pool__scriptHash" | |
26 | 29 | ||
27 | 30 | ||
28 | 31 | func keyPriceDecimals () = "%s__priceDecimals" | |
29 | 32 | ||
30 | 33 | ||
31 | 34 | func keyAllPoolsShutdown () = "%s__shutdown" | |
32 | 35 | ||
33 | 36 | ||
34 | 37 | func keyNextInternalAssetId () = "%s__nextInternalAssetId" | |
35 | 38 | ||
36 | 39 | ||
37 | 40 | func keyPoolToWeight (poolAddress) = ("%s%s__poolWeight__" + poolAddress) | |
38 | 41 | ||
39 | 42 | ||
40 | 43 | func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset)) | |
41 | 44 | ||
42 | 45 | ||
43 | 46 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
44 | 47 | ||
45 | 48 | ||
46 | 49 | func keyPoolConfig (amountAssetInternal,priceAssetInternal) = (((("%d%d%s__" + amountAssetInternal) + "__") + priceAssetInternal) + "__config") | |
47 | 50 | ||
48 | 51 | ||
49 | 52 | func keyMappingLpAssetToPoolAssets (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2Pool") | |
50 | 53 | ||
51 | 54 | ||
52 | 55 | func keyMappingPoolAssetsToLpasset (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + internalAmountAssetIdStr) + "__") + internalPriceAssetIdStr) + "__mappings__PoolAssets2LpAsset") | |
53 | 56 | ||
54 | 57 | ||
55 | 58 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2PoolAssets") | |
56 | 59 | ||
57 | 60 | ||
58 | 61 | func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__poolAssets2PoolContract") | |
59 | 62 | ||
60 | 63 | ||
61 | 64 | func keyMappingPoolContracToLPAsset (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
62 | 65 | ||
63 | 66 | ||
64 | 67 | func keyMappingPoolLPAssetToPoolContractAddress (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2PoolContract") | |
65 | 68 | ||
66 | 69 | ||
67 | 70 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key)) | |
68 | 71 | ||
69 | 72 | ||
70 | 73 | func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key)) | |
71 | 74 | ||
72 | 75 | ||
73 | 76 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
74 | 77 | ||
75 | 78 | ||
76 | - | func dataFactoryCfg (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract) = makeString(["%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract], SEP) | |
79 | + | func dataFactoryCfg (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract) = makeString(["%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract], SEP) | |
77 | 80 | ||
78 | 81 | ||
79 | - | func dataPoolCfg (poolAddress,poolStatus,lpAssetId,amountAssetStr,priceAssetStr,amountAssetDecimals,priceAssetDecimals,amountAssetInternalId,priceAssetInternalId,lpAssetDecimals | |
82 | + | func dataPoolCfg (poolAddress,poolStatus,lpAssetId,amountAssetStr,priceAssetStr,amountAssetDecimals,priceAssetDecimals,amountAssetInternalId,priceAssetInternalId,lpAssetDecimals) = makeString(["%s%d%s%s%s%d%d%d%d%d%s", poolAddress, poolStatus, lpAssetId, amountAssetStr, priceAssetStr, toString(amountAssetDecimals), toString(priceAssetDecimals), toString(amountAssetInternalId), toString(priceAssetInternalId), toString(lpAssetDecimals)], SEP) | |
80 | 83 | ||
81 | 84 | ||
82 | 85 | func dataMappingPoolAssets (internalAmountAssetStr,internalPriceAssetStr) = makeString(["%d%d", toString(internalAmountAssetStr), toString(internalPriceAssetStr)], SEP) | |
83 | 86 | ||
84 | 87 | ||
85 | 88 | func getInternalAssetIdOrCreate (assetIdStr,incrementor) = { | |
86 | 89 | let internalAssetId = valueOrElse(getInteger(this, keyMappingsBaseAsset2internalId(assetIdStr)), 0) | |
87 | 90 | let currentIndexOfInternalId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0) | |
88 | 91 | let result = if ((internalAssetId == 0)) | |
89 | 92 | then { | |
90 | 93 | let newInternalAssetId = (currentIndexOfInternalId + incrementor) | |
91 | 94 | $Tuple3(newInternalAssetId, [IntegerEntry(keyNextInternalAssetId(), newInternalAssetId), IntegerEntry(keyMappingsBaseAsset2internalId(assetIdStr), newInternalAssetId), StringEntry(keyMappingsInternal2baseAssetId(newInternalAssetId), assetIdStr)], true) | |
92 | 95 | } | |
93 | 96 | else $Tuple3(internalAssetId, nil, false) | |
94 | 97 | result | |
95 | 98 | } | |
96 | 99 | ||
97 | 100 | ||
101 | + | func createLpTokensListEntry (newLpToken) = { | |
102 | + | let lpTokens = getString(this, keyLpTokensList()) | |
103 | + | if (isDefined(lpTokens)) | |
104 | + | then ((value(lpTokens) + SEP) + newLpToken) | |
105 | + | else newLpToken | |
106 | + | } | |
107 | + | ||
108 | + | ||
98 | 109 | @Callable(i) | |
99 | - | func constructor (stakingContract,boostingContract,idoContract,teamContract,emissionContract,restContract,priceDecimals) = if ((i.caller != this)) | |
110 | + | func constructor (stakingContract,boostingContract,idoContract,teamContract,emissionContract,restContract,slpipageContract,priceDecimals) = if ((i.caller != this)) | |
100 | 111 | then throw("permissions denied") | |
101 | - | else [StringEntry(keyFactoryConfig(), dataFactoryCfg(stakingContract, boostingContract, idoContract, teamContract, emissionContract, restContract)), IntegerEntry(keyPriceDecimals(), priceDecimals)] | |
112 | + | else [StringEntry(keyFactoryConfig(), dataFactoryCfg(stakingContract, boostingContract, idoContract, teamContract, emissionContract, restContract, slpipageContract)), IntegerEntry(keyPriceDecimals(), priceDecimals)] | |
102 | 113 | ||
103 | 114 | ||
104 | 115 | ||
105 | 116 | @Callable(i) | |
106 | - | func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight | |
117 | + | func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight) = if ((i.caller != this)) | |
107 | 118 | then throw("permissions denied") | |
108 | 119 | else if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress)))) | |
109 | 120 | then throw((("Pool address " + poolAddress) + " already registered.")) | |
110 | 121 | else { | |
111 | 122 | let internalAmountAssetData = getInternalAssetIdOrCreate(amountAssetStr, 1) | |
112 | 123 | let internalAmountAssetId = internalAmountAssetData._1 | |
113 | 124 | let internalPriceAssetData = getInternalAssetIdOrCreate(priceAssetStr, if (internalAmountAssetData._3) | |
114 | 125 | then 2 | |
115 | 126 | else 1) | |
116 | 127 | let internalPriceAssetId = internalPriceAssetData._1 | |
117 | 128 | let poolAccountScriptHash = valueOrErrorMessage(scriptHash(addressFromStringValue(poolAddress)), ("No script has been found on pool account " + poolAddress)) | |
118 | 129 | let ethalonPoolAccountScriptHash = getBinaryValue(keyPoolScriptHash()) | |
119 | 130 | let poolConfig = getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId))) | |
120 | 131 | if (isDefined(poolConfig)) | |
121 | 132 | then throw((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated.")) | |
122 | 133 | else { | |
123 | 134 | let poolConfigValue = value(getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)))) | |
124 | 135 | let amountAssetsDecimals = if ((amountAssetStr == "WAVES")) | |
125 | 136 | then decimalsMultPrice | |
126 | 137 | else pow(10, 0, value(assetInfo(fromBase58String(amountAssetStr))).decimals, 0, 0, DOWN) | |
127 | 138 | let priceAssetsDecimals = if ((priceAssetStr == "WAVES")) | |
128 | 139 | then decimalsMultPrice | |
129 | 140 | else pow(10, 0, value(assetInfo(fromBase58String(priceAssetStr))).decimals, 0, 0, DOWN) | |
130 | 141 | let lpAssetIssueAction = Issue(lpAssetName, lpAssetDescr, 1, 8, true) | |
131 | 142 | let lpAssetId = calculateAssetId(lpAssetIssueAction) | |
132 | 143 | let lpAssetIdStr = toBase58String(lpAssetId) | |
133 | 144 | let poolActivateInvokeResult = invoke(addressFromStringValue(poolAddress), "activate", [amountAssetStr, priceAssetStr], nil) | |
134 | 145 | if ((poolActivateInvokeResult == poolActivateInvokeResult)) | |
135 | 146 | then if ((poolActivateInvokeResult != "success")) | |
136 | 147 | then throw("Pool initialisation error happened.") | |
137 | - | else $Tuple2(((internalAmountAssetData._2 ++ internalPriceAssetData._2) ++ [lpAssetIssueAction, Burn(lpAssetId, 1), StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(PoolActive), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, decimalsMultPrice | |
148 | + | else $Tuple2(((internalAmountAssetData._2 ++ internalPriceAssetData._2) ++ [lpAssetIssueAction, Burn(lpAssetId, 1), StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(PoolActive), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, decimalsMultPrice)), StringEntry(keyMappingLpAssetToPoolAssets(lpAssetIdStr), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToLpasset(toString(internalAmountAssetId), toString(internalPriceAssetId)), ("%s__" + lpAssetIdStr)), StringEntry(keyMappingPoolContractAddressToPoolAssets(poolAddress), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToPoolContractAddress(internalAmountAssetId, internalPriceAssetId), poolAddress), StringEntry(keyMappingPoolLPAssetToPoolContractAddress(lpAssetIdStr), poolAddress), StringEntry(keyMappingPoolContracToLPAsset(poolAddress), lpAssetIdStr), IntegerEntry(keyPoolToWeight(poolAddress), poolWeight), StringEntry(keyLpTokensList(), createLpTokensListEntry(lpAssetIdStr))]), "success") | |
138 | 149 | else throw("Strict value is not equal to itself.") | |
139 | 150 | } | |
140 | 151 | } | |
141 | 152 | ||
142 | 153 | ||
143 | 154 | ||
144 | 155 | @Callable(i) | |
145 | 156 | func managePool (lpContractAddress,newStatus) = if ((i.caller != this)) | |
146 | 157 | then throw("permissions denied") | |
147 | 158 | else nil | |
148 | 159 | ||
149 | 160 | ||
150 | 161 | ||
151 | 162 | @Callable(i) | |
152 | 163 | func emit (amountToEmit) = { | |
153 | 164 | let caller = i.caller | |
154 | 165 | let originCaller = i.originCaller | |
155 | 166 | let lpAssetRequested = valueOrErrorMessage(getString(keyMappingPoolContracToLPAsset(toString(caller))), "Invalid LP address called me.") | |
156 | 167 | let lpAsset = fromBase58String(lpAssetRequested) | |
157 | - | $Tuple2([Reissue(lpAsset, amountToEmit, true), ScriptTransfer(i.caller, amountToEmit, lpAsset)], "success") | |
168 | + | if ((amountToEmit > 0)) | |
169 | + | then $Tuple2([Reissue(lpAsset, amountToEmit, true), ScriptTransfer(i.caller, amountToEmit, lpAsset)], "success") | |
170 | + | else nil | |
158 | 171 | } | |
159 | 172 | ||
160 | 173 | ||
161 | 174 | ||
162 | 175 | @Callable(i) | |
163 | 176 | func burn (amountToBurn) = { | |
164 | 177 | let caller = i.caller | |
165 | 178 | let originCaller = i.originCaller | |
166 | 179 | let payment = value(i.payments[0]) | |
167 | 180 | let paymentAmount = value(payment.amount) | |
168 | 181 | let inAmountAssetId = toBase58String(value(payment.assetId)) | |
169 | 182 | let lpAssetRequestedForBurning = valueOrErrorMessage(getString(keyMappingPoolContracToLPAsset(toString(caller))), "Invalid LP address called me.") | |
170 | 183 | if ((inAmountAssetId != lpAssetRequestedForBurning)) | |
171 | 184 | then throw("Invalid asset passed.") | |
172 | 185 | else if ((amountToBurn != paymentAmount)) | |
173 | 186 | then throw("Invalid amount passed.") | |
174 | 187 | else { | |
175 | 188 | let lpAsset = fromBase58String(lpAssetRequestedForBurning) | |
176 | 189 | $Tuple2([Burn(lpAsset, amountToBurn)], "success") | |
177 | 190 | } | |
178 | 191 | } | |
179 | 192 | ||
180 | 193 | ||
181 | 194 | @Verifier(tx) | |
182 | 195 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
183 | 196 |
github/deemru/w8io/026f985 45.27 ms ◑