tx · eqbcHuimumrFQy33VSYmh2ENB5VF31jmJac5miPvo4Y

3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE:  -0.04000000 Waves

2022.05.04 22:24 [2037362] smart account 3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE > SELF 0.00000000 Waves

{ "type": 13, "id": "eqbcHuimumrFQy33VSYmh2ENB5VF31jmJac5miPvo4Y", "fee": 4000000, "feeAssetId": null, "timestamp": 1651692319503, "version": 2, "chainId": 84, "sender": "3N19jxhEYkphA6vga9hXTPsU5YfRMR27YoE", "senderPublicKey": "B3JNxLE1zmVDjs6MqSA1d3N7V6dS5Rq2wvxZqqVHo1fK", "proofs": [ "wPhXqXVchBdp5Uyp3TRtQFmWePKANzi4QGnthcm4pWEr1Z9MezqbJCBxKTx2uZP2hg3x1WfKT2YTXhF3qtxKuYR" ], "script": "base64:AAIFAAAAAAAAACQIAhIDCgEIEggKBggICAgICBIDCgEEEgcKBQgICAgIEgMKAQgAAAASAAAAAARtYWluAgAAAAptYWluX2Fzc2V0AAAAAAFsAgAAAAlscF9hc3NldF8AAAAAAmExAgAAAAxzd2FwX2Fzc2V0MV8AAAAAAnN0AgAAAA9hZGRyZXNzX3N0YWtlcl8AAAAAA3NzdAIAAAANYWRkcmVzc19wb29sXwAAAAADc3dwAgAAAA1hZGRyZXNzX3N3YXBfAAAAAAJhMgIAAAAMc3dhcF9hc3NldDJfAAAAAANhYTECAAAAB3Bvb2xfMV8AAAAAA2FhMgIAAAAHcG9vbF8yXwAAAAADc3QxAgAAAA5zdGFrZXJfYWRkcmVzcwAAAAAEdHlwZQIAAAAFdHlwZV8AAAAACWxlYXNlUG9vbAkBAAAAB0FkZHJlc3MAAAABCAUAAAAEdGhpcwAAAAVieXRlcwAAAAACc2ECAAAAD1NUQUtJTkdfQU1PVU5UXwAAAAACbGECAAAADUxFQVNFX0FNT1VOVF8AAAAAAml4AgAAAANJRF8AAAAADGV4Y2hhbmdlUmF0ZQAAAAAAAAAABQEAAAARZ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RlRW50cnkAAAABCQABLAAAAAIFAAAAA2FhMQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAAA2FhMgUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAABHR5cGUFAAAAB2FkZHJlc3MFAAAAA25pbAUAAAAHYmJlbnRyeQkAAAIAAAABAgAAAC5Pbmx5IHRoZSBBZG1pbiBpdHNlbGYgY2FuIGludm9rZSB0aGlzIGZ1bmN0aW9uAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V58PzLWQ==", "height": 2037362, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FojiDjck3sVZ4wKiy9Fef5RrU23FVGP6javx8ahypcai Next: 85iKRZVSPmoyb4Z1JMrvgD8HC6xeHk3Bf1gkbiaiimtf Diff:
OldNewDifferences
3636 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse " + address) + " as address")))
3737
3838
39+func getAssetIfValid (assetId) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(assetId))).id, (("Asset Id: " + assetId) + " is invalid.")))
40+
41+
3942 @Callable(i)
4043 func addMainAsset (id) = if ((i.caller == this))
4144 then [StringEntry(main, id)]
4447
4548
4649 @Callable(i)
47-func addPool (addres,pair,lp,stake,asset1,asset2) = {
50+func addPool (addres,pair,llp,stake,asset11,asset22) = {
4851 let address = getAddressIfValid(addres)
4952 let staker = getAddressIfValid(stake)
53+ let lp = getAssetIfValid(llp)
54+ let asset1 = getAssetIfValid(asset11)
55+ let asset2 = getAssetIfValid(asset22)
5056 let PMAA = getString(this, address)
5157 if ((i.caller == this))
5258 then if (isDefined(PMAA))
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
39+func getAssetIfValid (assetId) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(assetId))).id, (("Asset Id: " + assetId) + " is invalid.")))
40+
41+
3942 @Callable(i)
4043 func addMainAsset (id) = if ((i.caller == this))
4144 then [StringEntry(main, id)]
4245 else throw("Only the Admin itself can invoke this function")
4346
4447
4548
4649 @Callable(i)
47-func addPool (addres,pair,lp,stake,asset1,asset2) = {
50+func addPool (addres,pair,llp,stake,asset11,asset22) = {
4851 let address = getAddressIfValid(addres)
4952 let staker = getAddressIfValid(stake)
53+ let lp = getAssetIfValid(llp)
54+ let asset1 = getAssetIfValid(asset11)
55+ let asset2 = getAssetIfValid(asset22)
5056 let PMAA = getString(this, address)
5157 if ((i.caller == this))
5258 then if (isDefined(PMAA))
5359 then throw("The pool has been previously added.")
5460 else if ((addres == staker))
5561 then throw("Pool address cannot be the same as staker")
5662 else [StringEntry(address, pair), StringEntry(("POOL_" + pair), staker), StringEntry((l + pair), lp), StringEntry((aa1 + address), asset1), StringEntry((aa2 + address), asset2), StringEntry((type + address), "pools")]
5763 else throw("Only the Admin itself can invoke this function")
5864 }
5965
6066
6167
6268 @Callable(i)
6369 func activate (v) = if ((i.caller == this))
6470 then [BooleanEntry("activate", v)]
6571 else throw("Only the Admin itself can invoke this function")
6672
6773
6874
6975 @Callable(i)
7076 func addSwap (addres,stake,pair,asset1,asset2) = {
7177 let address = getAddressIfValid(addres)
7278 let staker = getAddressIfValid(stake)
7379 let PMAA = getString(this, address)
7480 if ((i.caller == this))
7581 then if (isDefined(PMAA))
7682 then throw("The address for this swap has been previously added.")
7783 else if ((addres == staker))
7884 then throw("Swap address cannot be the same as staker")
7985 else [StringEntry(("swap_" + pair), staker), StringEntry(address, pair), StringEntry((a1 + address), asset1), StringEntry((a2 + address), asset2), StringEntry((type + address), "swap")]
8086 else throw("Only the Admin itself can invoke this function")
8187 }
8288
8389
8490
8591 @Callable(i)
8692 func removeSwapOrPool (address) = {
8793 let PAA = getStringValue(this, (type + address))
8894 let PMAA = getStringValue(this, address)
8995 if ((i.caller == this))
9096 then if ((PAA == "swap"))
9197 then {
9298 let deletEnty = [DeleteEntry(("swap_" + PMAA)), DeleteEntry(address), DeleteEntry((type + address)), DeleteEntry((a1 + address)), DeleteEntry((a2 + address))]
9399 deletEnty
94100 }
95101 else {
96102 let bbentry = [DeleteEntry(address), DeleteEntry(("POOL_" + PMAA)), DeleteEntry(("lp_asset_" + PMAA)), DeleteEntry((aa1 + address)), DeleteEntry((aa2 + address)), DeleteEntry((type + address))]
97103 bbentry
98104 }
99105 else throw("Only the Admin itself can invoke this function")
100106 }
101107
102108
103109 @Verifier(tx)
104110 func verify () = match tx {
105111 case _ =>
106112 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
107113 }
108114

github/deemru/w8io/169f3d6 
33.41 ms