tx · Feh4WjZbmCp6FrtH9iwsessVLaGkL1pTz6LjXAK4xFwx

3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph:  -0.01400000 Waves

2021.10.25 13:35 [1761726] smart account 3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph > SELF 0.00000000 Waves

{ "type": 13, "id": "Feh4WjZbmCp6FrtH9iwsessVLaGkL1pTz6LjXAK4xFwx", "fee": 1400000, "feeAssetId": null, "timestamp": 1635158111024, "version": 2, "chainId": 84, "sender": "3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph", "senderPublicKey": "G7cNXePvAHUHmZfXa1eHnvFeH6DuykPC5wm9v9djTKgD", "proofs": [ "5CoTAgqGZ4t6AVvUoHizVTE3wVrbWPoAz52BwP6uAePw3pL9Kg32vL2CAssR2xKSdk7RMuELrsGGZmDoKcBsoRkV" ], "script": "base64:AAIFAAAAAAAAABEIAhIAEgASAwoBCBIECgIIAQAAAAIAAAAACXVzZXJBc3NldAIAAAAsR3JmZ3BjemNjcm41QWJydUxjdFh3Qzk0MWRnd2lwQnk2SFpZRGFRWEhidWsAAAAACWRBcHBBc3NldAIAAAAsN2FwU0p4TG54REt1bmI3YUJHYXVnNXFmVFg4OGpwYzNSMjI0OXBidUpVMngAAAAEAAAAAmE4AQAAAARpbml0AAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAADMzUFBIN3g3aXFvYlc1eml5aVJDaWMxOXJRcUtyNm5QWWFLMV9saXF1aWRpdHlfdG9rZW4CAAAALENIZWpCVFNybXMxZDRwS3dhVlZUdE44WnRKQzk0dzU3eEZOYloxd0dBU1ZQCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAMTNQUEg3eDdpcW9iVzV6aXlpUkNpYzE5clFxS3I2blBZYUsxX3NlcnZpY2VfdG9rZW4CAAAALDdvY1JYVXNVcnR5ajlHQWN4Ukp0OHRjcHNnZ0ZadDdjNDY3cUZleXBQYTF5BQ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NzZXQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAADXBvb2xBbW91bnRLZXkFAAAADW5ld1Bvb2xBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAEXVzZXJQb29sQW1vdW50S2V5BQAAABFuZXdVc2VyUG9vbEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAARdXNlclBvb2xFYXJuZWRLZXkFAAAADW5ld1VzZXJFYXJuZWQFAAAAA25pbAkAAAIAAAABAgAAACZZb3UgaGF2ZSBub3Qgc3VjaCBiYWxhbmNlIGZvciB3aXRoZHJhdwAAAAEAAAACYjYBAAAAAmI3AAAAAAkAAfQAAAADCAUAAAACYjYAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJiNgAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJiNgAAAA9zZW5kZXJQdWJsaWNLZXm3h/uN", "height": 1761726, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DhBLBNfaAfvzuRjs9BTco3CEFsZrb3ws6uLyn1V6nTzG Next: 8BGdtMf5VdTzV7WYPB7Xu69Nccnx1a7HVccmPW6HvYqL Diff:
OldNewDifferences
2626 let poolAmountKey = (pool + "_asset_balance")
2727 let userAddress = toString(i.caller)
2828 let userPoolAmountKey = (((pool + "_") + userAddress) + "_asset_balance")
29+ let dAppAssetAddress = getStringValue(this, (pool + "_service_token"))
2930 let poolAmount = getIntegerValue(this, poolAmountKey)
3031 let userAmount = match getInteger(userPoolAmountKey) {
3132 case int: Int =>
3536 }
3637 let newPoolAmount = (poolAmount + amount)
3738 let newUserPoolAmount = (userAmount + amount)
38-[ScriptTransfer(i.caller, amount, fromBase58String(dAppAsset)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount)]
39+[ScriptTransfer(i.caller, amount, fromBase58String(dAppAssetAddress)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount)]
3940 }
4041
4142
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let userAsset = "Grfgpczccrn5AbruLctXwC941dgwipBy6HZYDaQXHbuk"
55
66 let dAppAsset = "7apSJxLnxDKunb7aBGaug5qfTX88jpc3R2249pbuJU2x"
77
88 @Callable(a8)
99 func init () = [StringEntry("3PPH7x7iqobW5ziyiRCic19rQqKr6nPYaK1_liquidity_token", "CHejBTSrms1d4pKwaVVTtN8ZtJC94w57xFNbZ1wGASVP"), StringEntry("3PPH7x7iqobW5ziyiRCic19rQqKr6nPYaK1_service_token", "7ocRXUsUrtyj9GAcxRJt8tcpsggFZt7c467qFeypPa1y")]
1010
1111
1212
1313 @Callable(a8)
1414 func call () = {
1515 let a9 = Issue("Asset1", "Asset from dApp", 100000, 2, true, unit, 0)
1616 let b1 = calculateAssetId(a9)
1717 [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), a9]
1818 }
1919
2020
2121
2222 @Callable(i)
2323 func deposit (pool) = {
2424 let amount = i.payments[0].amount
2525 let assetId = i.payments[0].assetId
2626 let poolAmountKey = (pool + "_asset_balance")
2727 let userAddress = toString(i.caller)
2828 let userPoolAmountKey = (((pool + "_") + userAddress) + "_asset_balance")
29+ let dAppAssetAddress = getStringValue(this, (pool + "_service_token"))
2930 let poolAmount = getIntegerValue(this, poolAmountKey)
3031 let userAmount = match getInteger(userPoolAmountKey) {
3132 case int: Int =>
3233 int
3334 case nothing =>
3435 0
3536 }
3637 let newPoolAmount = (poolAmount + amount)
3738 let newUserPoolAmount = (userAmount + amount)
38-[ScriptTransfer(i.caller, amount, fromBase58String(dAppAsset)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount)]
39+[ScriptTransfer(i.caller, amount, fromBase58String(dAppAssetAddress)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount)]
3940 }
4041
4142
4243
4344 @Callable(i)
4445 func withdraw (pool,shareTokenCost) = {
4546 let amount = i.payments[0].amount
4647 let assetId = i.payments[0].assetId
4748 let poolAmountKey = (pool + "_asset_balance")
4849 let userAddress = toString(i.caller)
4950 let userPoolAmountKey = (((pool + "_") + userAddress) + "_asset_balance")
5051 let userPoolEarnedKey = (((pool + "_") + userAddress) + "_earned")
5152 let poolAmount = getIntegerValue(this, poolAmountKey)
5253 let userAmount = match getInteger(userPoolAmountKey) {
5354 case int: Int =>
5455 int
5556 case nothing =>
5657 0
5758 }
5859 let userEarned = match getInteger(userPoolAmountKey) {
5960 case int: Int =>
6061 int
6162 case nothing =>
6263 0
6364 }
6465 let newUserEarned = (userEarned + (amount * shareTokenCost))
6566 let newPoolAmount = (poolAmount - amount)
6667 if ((userAmount >= amount))
6768 then {
6869 let newUserPoolAmount = (userAmount - amount)
6970 [ScriptTransfer(i.caller, amount, fromBase58String(userAsset)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount), IntegerEntry(userPoolEarnedKey, newUserEarned)]
7071 }
7172 else throw("You have not such balance for withdraw")
7273 }
7374
7475
7576 @Verifier(b6)
7677 func b7 () = sigVerify(b6.bodyBytes, b6.proofs[0], b6.senderPublicKey)
7778

github/deemru/w8io/169f3d6 
32.69 ms