tx · VN92H8FxCeL4t7P6B3pbQTfaQNAxUpsZ7Upk3QmsGpM

3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph:  -0.01400000 Waves

2021.10.05 12:17 [1732740] smart account 3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph > SELF 0.00000000 Waves

{ "type": 13, "id": "VN92H8FxCeL4t7P6B3pbQTfaQNAxUpsZ7Upk3QmsGpM", "fee": 1400000, "feeAssetId": null, "timestamp": 1633425529607, "version": 2, "chainId": 84, "sender": "3N61Cvq5XcnPk9rxpy2Rnp3bSr4syNGUJph", "senderPublicKey": "G7cNXePvAHUHmZfXa1eHnvFeH6DuykPC5wm9v9djTKgD", "proofs": [ "35ty16KD98mRwKRNVKuQS196PyoK9kuqrErsova896HVMd8s1BN8pprjEwS2q4QqBQwjbA6RhU9hkgnyVdSEUzNT" ], "script": "base64:AAIFAAAAAAAAABEIAhIAEgASAwoBCBIECgIIAQAAAAIAAAAACXVzZXJBc3NldAIAAAAsR3JmZ3BjemNjcm41QWJydUxjdFh3Qzk0MWRnd2lwQnk2SFpZRGFRWEhidWsAAAAACWRBcHBBc3NldAIAAAAsN2FwU0p4TG54REt1bmI3YUJHYXVnNXFmVFg4OGpwYzNSMjI0OXBidUpVMngAAAAEAAAAAmE4AQAAAARpbml0AAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAxM1BQSDd4N2lxb2JXNXppeWlSQ2ljMTlyUXFLcjZuUFlhSzFfYXNzZXRfYmFsYW5jZQAAAAAAAAAAAAUAAAADbmlsAAAAAmE4AQAAAARjYWxsAAAAAAQAAAACYTkJAARDAAAABwIAAAAOZGVmaV9VU0RUX1VTRE4CAAAAH0FuYWxvZ3VlIG9mIFNXT1AuRkkgc19VU0RUX1VTRE4AAAAAAAX14QAAAAAAAAAAAAYGBQAAAAR1bml0AAAAAAAAAAAABAAAAAJiMQkABDgAAAABBQAAAAJhOQkABEwAAAACCQEAAAAMQm9vbGVhbk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lZEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAANpbnQFAAAAByRtYXRjaDAFAAAAA2ludAQAAAAHbm90aGluZwUAAAAHJG1hdGNoMAAAAAAAAAAAAAQAAAANbmV3VXNlckVhcm5lZAkAAGQAAAACBQAAAAp1c2VyRWFybmVkCQAAaAAAAAIFAAAABmFtb3VudAUAAAAOc2hhcmVUb2tlbkNvc3QEAAAADW5ld1Bvb2xBbW91bnQJAABlAAAAAgUAAAAKcG9vbEFtb3VudAUAAAAGYW1vdW50AwkAAGcAAAACBQAAAAp1c2VyQW1vdW50BQAAAAZhbW91bnQEAAAAEW5ld1VzZXJQb29sQW1vdW50CQAAZQAAAAIFAAAACnVzZXJBbW91bnQFAAAABmFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAkAAlkAAAABBQAAAAl1c2VyQXNzZXQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAADXBvb2xBbW91bnRLZXkFAAAADW5ld1Bvb2xBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAEXVzZXJQb29sQW1vdW50S2V5BQAAABFuZXdVc2VyUG9vbEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAARdXNlclBvb2xFYXJuZWRLZXkFAAAADW5ld1VzZXJFYXJuZWQFAAAAA25pbAkAAAIAAAABAgAAACZZb3UgaGF2ZSBub3Qgc3VjaCBiYWxhbmNlIGZvciB3aXRoZHJhdwAAAAEAAAACYjYBAAAAAmI3AAAAAAkAAfQAAAADCAUAAAACYjYAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJiNgAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJiNgAAAA9zZW5kZXJQdWJsaWNLZXmp8cHs", "height": 1732740, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HXSZ3S9Yped4i87qkztRrZXsmCqpBmuwrXCGnKpKkAtj Next: 7TDwWp4cj9xTA5aLjV8pqeswb3EPt6G5WvZ52f8kPB9T Diff:
OldNewDifferences
1212
1313 @Callable(a8)
1414 func call () = {
15- let a9 = Issue("Asset1", "Asset from dApp", 100000, 2, true, unit, 0)
15+ let a9 = Issue("defi_USDT_USDN", "Analogue of SWOP.FI s_USDT_USDN", 100000000, 6, true, unit, 0)
1616 let b1 = calculateAssetId(a9)
1717 [BooleanEntry("bool", true), a9]
1818 }
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 () = {
15- let a9 = Issue("Asset1", "Asset from dApp", 100000, 2, true, unit, 0)
15+ let a9 = Issue("defi_USDT_USDN", "Analogue of SWOP.FI s_USDT_USDN", 100000000, 6, true, unit, 0)
1616 let b1 = calculateAssetId(a9)
1717 [BooleanEntry("bool", true), 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,shareTokenCost) = {
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 userPoolEarnedKey = (((pool + "_") + userAddress) + "_earned")
5151 let poolAmount = getIntegerValue(this, poolAmountKey)
5252 let userAmount = match getInteger(userPoolAmountKey) {
5353 case int: Int =>
5454 int
5555 case nothing =>
5656 0
5757 }
5858 let userEarned = match getInteger(userPoolEarnedKey) {
5959 case int: Int =>
6060 int
6161 case nothing =>
6262 0
6363 }
6464 let newUserEarned = (userEarned + (amount * shareTokenCost))
6565 let newPoolAmount = (poolAmount - amount)
6666 if ((userAmount >= amount))
6767 then {
6868 let newUserPoolAmount = (userAmount - amount)
6969 [ScriptTransfer(i.caller, amount, fromBase58String(userAsset)), IntegerEntry(poolAmountKey, newPoolAmount), IntegerEntry(userPoolAmountKey, newUserPoolAmount), IntegerEntry(userPoolEarnedKey, newUserEarned)]
7070 }
7171 else throw("You have not such balance for withdraw")
7272 }
7373
7474
7575 @Verifier(b6)
7676 func b7 () = sigVerify(b6.bodyBytes, b6.proofs[0], b6.senderPublicKey)
7777

github/deemru/w8io/026f985 
39.00 ms