tx · 85iKRZVSPmoyb4Z1JMrvgD8HC6xeHk3Bf1gkbiaiimtf

3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE:  -0.04000000 Waves

2022.05.04 22:28 [2037366] smart account 3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE > SELF 0.00000000 Waves

{ "type": 13, "id": "85iKRZVSPmoyb4Z1JMrvgD8HC6xeHk3Bf1gkbiaiimtf", "fee": 4000000, "feeAssetId": null, "timestamp": 1651692601627, "version": 2, "chainId": 84, "sender": "3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE", "senderPublicKey": "B3JNxLE1zmVDjs6MqSA1d3N7V6dS5Rq2wvxZqqVHo1fK", "proofs": [ "4FmfkXcMMs1AXSjFQsc5zxWjtJaTMwkusTvDp9S1T8gX3APTuzBSb6gBWySYf5s4mnFh7f2AJB9YNmWu4QjbugUf" ], "script": "base64:AAIFAAAAAAAAACQIAhIDCgEIEggKBggICAgICBIDCgEEEgcKBQgICAgIEgMKAQgAAAASAAAAAARtYWluAgAAAAptYWluX2Fzc2V0AAAAAAFsAgAAAAlscF9hc3NldF8AAAAAAmExAgAAAAxzd2FwX2Fzc2V0MV8AAAAAAnN0AgAAAA9hZGRyZXNzX3N0YWtlcl8AAAAAA3NzdAIAAAANYWRkcmVzc19wb29sXwAAAAADc3dwAgAAAA1hZGRyZXNzX3N3YXBfAAAAAAJhMgIAAAAMc3dhcF9hc3NldDJfAAAAAANhYTECAAAAB3Bvb2xfMV8AAAAAA2FhMgIAAAAHcG9vbF8yXwAAAAADc3QxAgAAAA5zdGFrZXJfYWRkcmVzcwAAAAAEdHlwZQIAAAAFdHlwZV8AAAAACWxlYXNlUG9vbAkBAAAAB0FkZHJlc3MAAAABCAUAAAAEdGhpcwAAAAVieXRlcwAAAAACc2ECAAAAD1NUQUtJTkdfQU1PVU5UXwAAAAACbGECAAAADUxFQVNFX0FNT1VOVF8AAAAAAml4AgAAAANJRF8AAAAADGV4Y2hhbmdlUmF0ZQAAAA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lbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAAJhMQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAAAmEyBQAAAAdhZGRyZXNzBQAAAANuaWwFAAAACWRlbGV0RW50eQQAAAAHYmJlbnRyeQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAdhZGRyZXNzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgIAAAAFUE9PTF8FAAAABFBNQUEJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACAgAAAAlscF9hc3NldF8FAAAABFBNQUEJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAANhYTEFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAANhYTIFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAAR0eXBlBQAAAAdhZGRyZXNzBQAAAANuaWwFAAAAB2JiZW50cnkJAAACAAAAAQIAAAAuT25seSB0aGUgQWRtaW4gaXRzZWxmIGNhbiBpbnZva2UgdGhpcyBmdW5jdGlvbgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRVVlK8=", "height": 2037366, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: eqbcHuimumrFQy33VSYmh2ENB5VF31jmJac5miPvo4Y Next: none Diff:
OldNewDifferences
5959 then throw("The pool has been previously added.")
6060 else if ((addres == staker))
6161 then throw("Pool address cannot be the same as staker")
62- else [StringEntry(address, pair), StringEntry(("POOL_" + pair), staker), StringEntry((l + pair), lp), StringEntry((aa1 + address), asset1), StringEntry((aa2 + address), asset2), StringEntry((type + address), "pools")]
62+ else if ((asset1 == asset2))
63+ then throw("Asset1 cannot be equal to Asset2 and vice versa")
64+ else [StringEntry(address, pair), StringEntry(("POOL_" + pair), staker), StringEntry((l + pair), lp), StringEntry((aa1 + address), asset1), StringEntry((aa2 + address), asset2), StringEntry((type + address), "pools")]
6365 else throw("Only the Admin itself can invoke this function")
6466 }
6567
7375
7476
7577 @Callable(i)
76-func addSwap (addres,stake,pair,asset1,asset2) = {
78+func addSwap (addres,stake,pair,asset11,asset22) = {
7779 let address = getAddressIfValid(addres)
7880 let staker = getAddressIfValid(stake)
7981 let PMAA = getString(this, address)
82+ let asset1 = getAssetIfValid(asset11)
83+ let asset2 = getAssetIfValid(asset22)
8084 if ((i.caller == this))
8185 then if (isDefined(PMAA))
8286 then throw("The address for this swap has been previously added.")
8387 else if ((addres == staker))
8488 then throw("Swap address cannot be the same as staker")
85- else [StringEntry(("swap_" + pair), staker), StringEntry(address, pair), StringEntry((a1 + address), asset1), StringEntry((a2 + address), asset2), StringEntry((type + address), "swap")]
89+ else if ((asset1 == asset2))
90+ then throw("Asset1 cannot be equal to Asset2 and vice versa")
91+ else [StringEntry(("swap_" + pair), staker), StringEntry(address, pair), StringEntry((a1 + address), asset1), StringEntry((a2 + address), asset2), StringEntry((type + address), "swap")]
8692 else throw("Only the Admin itself can invoke this function")
8793 }
8894
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let main = "main_asset"
55
66 let l = "lp_asset_"
77
88 let a1 = "swap_asset1_"
99
1010 let st = "address_staker_"
1111
1212 let sst = "address_pool_"
1313
1414 let swp = "address_swap_"
1515
1616 let a2 = "swap_asset2_"
1717
1818 let aa1 = "pool_1_"
1919
2020 let aa2 = "pool_2_"
2121
2222 let st1 = "staker_address"
2323
2424 let type = "type_"
2525
2626 let leasePool = Address(this.bytes)
2727
2828 let sa = "STAKING_AMOUNT_"
2929
3030 let la = "LEASE_AMOUNT_"
3131
3232 let ix = "ID_"
3333
3434 let exchangeRate = 5
3535
3636 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse " + address) + " as address")))
3737
3838
3939 func getAssetIfValid (assetId) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(assetId))).id, (("Asset Id: " + assetId) + " is invalid.")))
4040
4141
4242 @Callable(i)
4343 func addMainAsset (id) = if ((i.caller == this))
4444 then [StringEntry(main, id)]
4545 else throw("Only the Admin itself can invoke this function")
4646
4747
4848
4949 @Callable(i)
5050 func addPool (addres,pair,llp,stake,asset11,asset22) = {
5151 let address = getAddressIfValid(addres)
5252 let staker = getAddressIfValid(stake)
5353 let lp = getAssetIfValid(llp)
5454 let asset1 = getAssetIfValid(asset11)
5555 let asset2 = getAssetIfValid(asset22)
5656 let PMAA = getString(this, address)
5757 if ((i.caller == this))
5858 then if (isDefined(PMAA))
5959 then throw("The pool has been previously added.")
6060 else if ((addres == staker))
6161 then throw("Pool address cannot be the same as staker")
62- else [StringEntry(address, pair), StringEntry(("POOL_" + pair), staker), StringEntry((l + pair), lp), StringEntry((aa1 + address), asset1), StringEntry((aa2 + address), asset2), StringEntry((type + address), "pools")]
62+ else if ((asset1 == asset2))
63+ then throw("Asset1 cannot be equal to Asset2 and vice versa")
64+ else [StringEntry(address, pair), StringEntry(("POOL_" + pair), staker), StringEntry((l + pair), lp), StringEntry((aa1 + address), asset1), StringEntry((aa2 + address), asset2), StringEntry((type + address), "pools")]
6365 else throw("Only the Admin itself can invoke this function")
6466 }
6567
6668
6769
6870 @Callable(i)
6971 func activate (v) = if ((i.caller == this))
7072 then [BooleanEntry("activate", v)]
7173 else throw("Only the Admin itself can invoke this function")
7274
7375
7476
7577 @Callable(i)
76-func addSwap (addres,stake,pair,asset1,asset2) = {
78+func addSwap (addres,stake,pair,asset11,asset22) = {
7779 let address = getAddressIfValid(addres)
7880 let staker = getAddressIfValid(stake)
7981 let PMAA = getString(this, address)
82+ let asset1 = getAssetIfValid(asset11)
83+ let asset2 = getAssetIfValid(asset22)
8084 if ((i.caller == this))
8185 then if (isDefined(PMAA))
8286 then throw("The address for this swap has been previously added.")
8387 else if ((addres == staker))
8488 then throw("Swap address cannot be the same as staker")
85- else [StringEntry(("swap_" + pair), staker), StringEntry(address, pair), StringEntry((a1 + address), asset1), StringEntry((a2 + address), asset2), StringEntry((type + address), "swap")]
89+ else if ((asset1 == asset2))
90+ then throw("Asset1 cannot be equal to Asset2 and vice versa")
91+ else [StringEntry(("swap_" + pair), staker), StringEntry(address, pair), StringEntry((a1 + address), asset1), StringEntry((a2 + address), asset2), StringEntry((type + address), "swap")]
8692 else throw("Only the Admin itself can invoke this function")
8793 }
8894
8995
9096
9197 @Callable(i)
9298 func removeSwapOrPool (address) = {
9399 let PAA = getStringValue(this, (type + address))
94100 let PMAA = getStringValue(this, address)
95101 if ((i.caller == this))
96102 then if ((PAA == "swap"))
97103 then {
98104 let deletEnty = [DeleteEntry(("swap_" + PMAA)), DeleteEntry(address), DeleteEntry((type + address)), DeleteEntry((a1 + address)), DeleteEntry((a2 + address))]
99105 deletEnty
100106 }
101107 else {
102108 let bbentry = [DeleteEntry(address), DeleteEntry(("POOL_" + PMAA)), DeleteEntry(("lp_asset_" + PMAA)), DeleteEntry((aa1 + address)), DeleteEntry((aa2 + address)), DeleteEntry((type + address))]
103109 bbentry
104110 }
105111 else throw("Only the Admin itself can invoke this function")
106112 }
107113
108114
109115 @Verifier(tx)
110116 func verify () = match tx {
111117 case _ =>
112118 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
113119 }
114120

github/deemru/w8io/169f3d6 
31.89 ms