tx · DP2q2Dp5ZoibTj1xpNDzGNUkLhRNuNCgGrhZNKkYA37U

3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph:  -0.01400000 Waves

2021.09.20 14:58 [1711347] smart account 3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph > SELF 0.00000000 Waves

{ "type": 13, "id": "DP2q2Dp5ZoibTj1xpNDzGNUkLhRNuNCgGrhZNKkYA37U", "fee": 1400000, "feeAssetId": null, "timestamp": 1632139151871, "version": 2, "chainId": 84, "sender": "3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph", "senderPublicKey": "G7cNXePvAHUHmZfXa1eHnvFeH6DuykPC5wm9v9djTKgD", "proofs": [ "66a1iVqhQhWoFy8GSxHM8ZYBdsfq6PrbiR3y7TMzapEzkn5GLMn8oLUiEC7JUtXhDSWvCtMLB444aTRUZRdiCVHh" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgASAwoBCBIDCgEIAAAAAgAAAAAJdXNlckFzc2V0AgAAACxHcmZncGN6Y2NybjVBYnJ1TGN0WHdDOTQxZGd3aXBCeTZIWllEYVFYSGJ1awAAAAAJZEFwcEFzc2V0AgAAACw3YXBTSnhMbnhES3VuYjdhQkdhdWc1cWZUWDg4anBjM1IyMjQ5cGJ1SlUyeAAAAAQAAAACYTgBAAAABGluaXQAAAAACQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAADEzUFBIN3g3aXFvYlc1eml5aVJDaWMxOXJRcUtyNm5QWWFLMV9hc3NldF9iYWxhbmNlAAAAAAAAAAAABQAAAANuaWwAAAACYTgBAAAABGNhbGwAAAAABAAAAAJhOQkABEMAAAAHAgAAAAZBc3NldDECAAAAD0Fzc2V0IGZyb20gZEFwcAAAAAAAAAGGoAAAAAAAAAAAAgYFAAAABHVuaXQAAAAAAAAAAAAEAAAAAmIxCQAEOAAAAAEFAAAAAmE5CQAETAAAAAIJAQAAAAtCaW5hcnlFbnRyeQAAAAICAAAAA2Jp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AAAAAQAAAANbmV3UG9vbEFtb3VudAkAAGUAAAACBQAAAApwb29sQW1vdW50BQAAAAZhbW91bnQDCQAAZwAAAAIFAAAACnVzZXJBbW91bnQFAAAABmFtb3VudAQAAAARbmV3VXNlclBvb2xBbW91bnQJAABlAAAAAgUAAAAKdXNlckFtb3VudAUAAAAGYW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50CQACWQAAAAEFAAAACXVzZXJBc3NldAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAANcG9vbEFtb3VudEtleQUAAAANbmV3UG9vbEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAARdXNlclBvb2xBbW91bnRLZXkFAAAAEW5ld1VzZXJQb29sQW1vdW50BQAAAANuaWwJAAACAAAAAQIAAAAmWW91IGhhdmUgbm90IHN1Y2ggYmFsYW5jZSBmb3Igd2l0aGRyYXcAAAABAAAAAmI2AQAAAAJiNwAAAAAJAAH0AAAAAwgFAAAAAmI2AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACYjYAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACYjYAAAAPc2VuZGVyUHVibGljS2V5HCzqgg==", "height": 1711347, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AAMzRFUci6bYeAQhu9enXQwQiHyaLCmfnT6p1mj16Uab Next: Hpceu4bwHHwaz1wedPk49Mz6om5k9uQP13v51UVpYAWt Diff:
OldNewDifferences
5555 0
5656 }
5757 let newPoolAmount = (poolAmount - amount)
58- if ((userAmount > amount))
58+ if ((userAmount >= amount))
5959 then {
6060 let newUserPoolAmount = (userAmount - amount)
6161 [ScriptTransfer(i.caller, amount, fromBase58String(userAsset)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount)]
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 () = [IntegerEntry("3PPH7x7iqobW5ziyiRCic19rQqKr6nPYaK1_asset_balance", 0)]
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")
2929 let poolAmount = getIntegerValue(this, poolAmountKey)
3030 let userAmount = match getInteger(userPoolAmountKey) {
3131 case int: Int =>
3232 int
3333 case nothing =>
3434 0
3535 }
3636 let newPoolAmount = (poolAmount + amount)
3737 let newUserPoolAmount = (userAmount + amount)
3838 [ScriptTransfer(i.caller, amount, fromBase58String(dAppAsset)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount)]
3939 }
4040
4141
4242
4343 @Callable(i)
4444 func withdraw (pool) = {
4545 let amount = i.payments[0].amount
4646 let assetId = i.payments[0].assetId
4747 let poolAmountKey = (pool + "_asset_balance")
4848 let userAddress = toString(i.caller)
4949 let userPoolAmountKey = (((pool + "_") + userAddress) + "_asset_balance")
5050 let poolAmount = getIntegerValue(this, poolAmountKey)
5151 let userAmount = match getInteger(userPoolAmountKey) {
5252 case int: Int =>
5353 int
5454 case nothing =>
5555 0
5656 }
5757 let newPoolAmount = (poolAmount - amount)
58- if ((userAmount > amount))
58+ if ((userAmount >= amount))
5959 then {
6060 let newUserPoolAmount = (userAmount - amount)
6161 [ScriptTransfer(i.caller, amount, fromBase58String(userAsset)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount)]
6262 }
6363 else throw("You have not such balance for withdraw")
6464 }
6565
6666
6767 @Verifier(b6)
6868 func b7 () = sigVerify(b6.bodyBytes, b6.proofs[0], b6.senderPublicKey)
6969

github/deemru/w8io/026f985 
25.10 ms