tx · 9YHJtRyc9unsyhkpkLr4o2Gk1LpB6CWVhBESJFV5oagG

3MqkoGVxf9wAeNTiksudck7HuNKruh3W9yg:  -0.04000000 Waves

2021.08.24 01:28 [1671576] smart account 3MqkoGVxf9wAeNTiksudck7HuNKruh3W9yg > SELF 0.00000000 Waves

{ "type": 13, "id": "9YHJtRyc9unsyhkpkLr4o2Gk1LpB6CWVhBESJFV5oagG", "fee": 4000000, "feeAssetId": null, "timestamp": 1629757722062, "version": 2, "chainId": 84, "sender": "3MqkoGVxf9wAeNTiksudck7HuNKruh3W9yg", "senderPublicKey": "4adRtnahFnRGxzn67XppfF97pKLyUFPtNw5aCZ4NM9UV", "proofs": [ "4iEB4PztpvwfohyM7J6WxzU9Yn6tVrxa1EcWASwR1EUA2RxE9dNSzqJeT5w6dTgTrQaK965SgUjZnt8hJUsZewjd" ], "script": "base64:AAIFAAAAAAAAABgIAhIECgIIGBIDCgEIEgMKAQgSBAoCCAQAAAAHAAAAAAZjb25maWcJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAABmNvbmZpZwIAAAAAAAAAAAVhZG1pbgMJAQAAAAIhPQAAAAIFAAAABmNvbmZpZwIAAAAACQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAABWFkbWluAgAAAAACAAAAAAAAAAAFcG9vbHMJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAAVwb29scwIAAAAWTm8ga2V5IHBvb2xzIHdhcyBmb3VuZAEAAAAHaXNBZG1pbgAAAAEAAAANY2FsbGVyQWRkcmVzcwMJAAAAAAAAAgUAAAANY2FsbGVyQWRkcmVzcwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAFY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AARQGV4dHJOYXRpdmUoMTA1MykAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAtwb29sQWRkcmVzcwIAAAAIZFRva2VuSWQEAAAAByRtYXRjaDAFAAAAC3Rva2VuQW1vdW50AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXQFAAAAByRtYXRjaDAJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAF0CQACWQAAAAEFAAAAB3Rva2VuSWQFAAAAA25pbAkAAAIAAAABAgAAABhJbmNvcnJlY3QgaW52b2tlIHJlc3VsdCEJAAACAAAAAQIAAAAUTm8gcGF5bWVudCBhdHRhY2hlZCEJAAACAAAAAQIAAAAXUG9vbCBhZGRyZXNzIG5vdCBmb3VuZCEAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleYSF/gg=", "height": 1671576, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CyCd4HwEBFdFkVe3o1qiU3xJ9mJQTi3hqChsXRdxnZj8 Next: BuvCu3v1C8XbyCp5rKGkgZFTarzwCaZiNZpoNpcSmNTS Diff:
OldNewDifferences
2626
2727
2828 @Callable(i)
29-func setup (configAddress,pools) = if (if ((admin != ""))
30- then true
31- else isAdmin(i.caller))
29+func setup (configAddress,pools) = if ((admin == ""))
3230 then [writeString("config", configAddress), writeString("poolsStrg", makeString(pools, ";"))]
33- else throw("Address does not match with admin address!")
31+ else if (isAdmin(i.caller))
32+ then [writeString("config", configAddress), writeString("poolsStrg", makeString(pools, ";"))]
33+ else throw("Address does not match with admin address!")
3434
3535
3636
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let config = valueOrElse(getStringValue(this, "config"), "")
55
66 let admin = if ((config != ""))
77 then valueOrElse(getStringValue(addressFromStringValue(config), "admin"), "")
88 else ""
99
1010 let pools = valueOrErrorMessage(getString(this, "pools"), "No key pools was found")
1111
1212 func isAdmin (callerAddress) = if ((callerAddress == addressFromStringValue(admin)))
1313 then true
1414 else false
1515
1616
1717 func checkPool (poolAdd) = if (contains(pools, poolAdd))
1818 then true
1919 else false
2020
2121
2222 func writeString (key,stringValue) = StringEntry(key, stringValue)
2323
2424
2525 func writeInteger (key,integerValue) = IntegerEntry(key, integerValue)
2626
2727
2828 @Callable(i)
29-func setup (configAddress,pools) = if (if ((admin != ""))
30- then true
31- else isAdmin(i.caller))
29+func setup (configAddress,pools) = if ((admin == ""))
3230 then [writeString("config", configAddress), writeString("poolsStrg", makeString(pools, ";"))]
33- else throw("Address does not match with admin address!")
31+ else if (isAdmin(i.caller))
32+ then [writeString("config", configAddress), writeString("poolsStrg", makeString(pools, ";"))]
33+ else throw("Address does not match with admin address!")
3434
3535
3636
3737 @Callable(i)
3838 func addPool (poolAddress) = if (isAdmin(i.caller))
3939 then {
4040 let poolList = split(pools, ";")
4141 if ((containsElement(poolList, poolAddress) == false))
4242 then {
4343 let newPools = (poolList :+ poolAddress)
4444 [writeString("pools", makeString(newPools, ";"))]
4545 }
4646 else throw("Pool already exists!")
4747 }
4848 else throw("Address does not match with admin address!")
4949
5050
5151
5252 @Callable(i)
5353 func updateConfig (configAddress) = if (isAdmin(i.caller))
5454 then [writeString("config", configAddress)]
5555 else throw("Address does not match with admin address!")
5656
5757
5858
5959 @Callable(i)
6060 func depositAt (poolAddress,isCollateral) = if (checkPool(poolAddress))
6161 then if ((size(i.payments) > 0))
6262 then {
6363 let user = toBase58String(i.caller.bytes)
6464 let tokenAmount = invoke(addressFromStringValue(poolAddress), "deposit", [user, isCollateral], i.payments)
6565 let tokenId = getStringValue(addressFromStringValue(poolAddress), "dTokenId")
6666 match tokenAmount {
6767 case t: Int =>
6868 [ScriptTransfer(i.caller, t, fromBase58String(tokenId))]
6969 case _ =>
7070 throw("Incorrect invoke result!")
7171 }
7272 }
7373 else throw("No payment attached!")
7474 else throw("Pool address not found!")
7575
7676
7777 @Verifier(tx)
7878 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
7979

github/deemru/w8io/169f3d6 
39.20 ms