tx · E6mPRV73FRV8cmsLyVF4YGLC32MKkcP3Tnf9fMM1FJsM

3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV:  -0.01400000 Waves

2022.01.19 19:18 [1886032] smart account 3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV > SELF 0.00000000 Waves

{ "type": 13, "id": "E6mPRV73FRV8cmsLyVF4YGLC32MKkcP3Tnf9fMM1FJsM", "fee": 1400000, "feeAssetId": null, "timestamp": 1642609152578, "version": 1, "sender": "3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV", "senderPublicKey": "8KXPjDuC8ffL9qjNuDBLnkvJKbMojhZYcnm2o75UCyun", "proofs": [ "kaE4pnNsjdgcNFtAHSKUMXnexeXHDczcgBFQgvygbMfvAeiW33E7UjkLhkFecvERpVBr69t7dnAN764A77MQBY1" ], "script": "base64:AAIFAAAAAAAAABEIAhIDCgEIEggKBgEBAQEIAQAAABUAAAAAA1NFUAIAAAACX18AAAAABUVNUFRZAgAAAAAAAAAADmlkeFBvb2xBZGRyZXNzAAAAAAAAAAABAAAAAAlpZHhMUEFzSWQAAAAAAAAAAAMAAAAACWlkeEFtQXNJZAAAAAAAAAAABAAAAAAJaWR4UHJBc0lkAAAAAAAAAAAFAAAAAA9pZHhGYWN0U3Rha0NudHIAAAAAAAAAAAEBAAAAC2tleUZhY3RDbnRyAAAAAAIAAAATJXNfX2ZhY3RvcnlDb250cmFjdAEAAAAMa2V5TWFuUHViS2V5AAAAAAIAAAAUJXNfX21hbmFnZXJQdWJsaWNLZXkBAAAAC2tleVBvb2xBZGRyAAAAAAIAAAAPJXNfX3Bvb2xBZGRyZXNzAQAAAAtrZXlBbXRBc3NldAAAAAACAAAADyVzX19hbW91bnRBc3NldAEAAAANa2V5UHJpY2VBc3NldAAAAAACAAAADiVzX19wcmljZUFzc2V0AQAAABBrZXlGYWN0b3J5Q29uZmlnAAAAAAIAAAARJXNfX2ZhY3RvcnlDb25maWcBAAAADWtleVBvb2xDb25maW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CQAAAAAAAAIFAAAACWdldE9uZVRrbgUAAAAJZ2V0T25lVGtuBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAQAAAAFYWRtaW4JAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwkBAAAADGtleU1hblB1YktleQAAAAAFAAAABUVNUFRZAwkAAAAAAAACBQAAAAVhZG1pbgUAAAAFRU1QVFkJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkAAlkAAAABBQAAAAVhZG1pbkRF7Do=", "chainId": 84, "height": 1886032, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3nyt2ksAk7iedRwP4PCieEfp1h41N16S1nJNffZnrBCT Next: 35EPfP3LhJY6P1XH6HsTbVYu7RpgVrym2B1AdvGxeMnX Diff:
OldNewDifferences
4545 func getIntOrFail (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
4646
4747
48-let factoryContract = addressFromStringValue(getStringOrFail(this, keyFactCntr()))
48+let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr()))
4949
50-let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr()))
50+let factoryContract = addressFromStringValue(getStringOrFail(poolContract, keyFactCntr()))
5151
5252 func getPoolConfig () = {
5353 let amtAs = getStringOrFail(poolContract, keyAmtAsset())
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let idxPoolAddress = 1
99
1010 let idxLPAsId = 3
1111
1212 let idxAmAsId = 4
1313
1414 let idxPrAsId = 5
1515
1616 let idxFactStakCntr = 1
1717
1818 func keyFactCntr () = "%s__factoryContract"
1919
2020
2121 func keyManPubKey () = "%s__managerPublicKey"
2222
2323
2424 func keyPoolAddr () = "%s__poolAddress"
2525
2626
2727 func keyAmtAsset () = "%s__amountAsset"
2828
2929
3030 func keyPriceAsset () = "%s__priceAsset"
3131
3232
3333 func keyFactoryConfig () = "%s__factoryConfig"
3434
3535
3636 func keyPoolConfig (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
3737
3838
3939 func keyMappingsBaseAsset2internalId (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
4040
4141
4242 func getStringOrFail (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
4343
4444
4545 func getIntOrFail (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
4646
4747
48-let factoryContract = addressFromStringValue(getStringOrFail(this, keyFactCntr()))
48+let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr()))
4949
50-let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr()))
50+let factoryContract = addressFromStringValue(getStringOrFail(poolContract, keyFactCntr()))
5151
5252 func getPoolConfig () = {
5353 let amtAs = getStringOrFail(poolContract, keyAmtAsset())
5454 let priceAs = getStringOrFail(poolContract, keyPriceAsset())
5555 let iPriceAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAs))
5656 let iAmtAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAs))
5757 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAs), toString(iPriceAs))), SEP)
5858 }
5959
6060
6161 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
6262
6363
6464 @Callable(i)
6565 func constructor (poolAddress) = if ((i.caller != this))
6666 then throw("denied")
6767 else [StringEntry(keyPoolAddr(), poolAddress)]
6868
6969
7070
7171 @Callable(i)
7272 func unstakeAndGet (amount,exchResult,notUsed,outAmount,outAssetId,slippage) = {
7373 let checkPayments = if ((size(i.payments) != 0))
7474 then throw("No pmnts expd")
7575 else true
7676 if ((checkPayments == checkPayments))
7777 then {
7878 let cfg = getPoolConfig()
7979 let factoryCfg = getFactoryConfig()
8080 let lpAssetId = fromBase58String(cfg[idxLPAsId])
8181 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
8282 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
8383 if ((unstakeInv == unstakeInv))
8484 then {
8585 let getOneTkn = invoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], nil)
8686 if ((getOneTkn == getOneTkn))
8787 then nil
8888 else throw("Strict value is not equal to itself.")
8989 }
9090 else throw("Strict value is not equal to itself.")
9191 }
9292 else throw("Strict value is not equal to itself.")
9393 }
9494
9595
9696 @Verifier(tx)
9797 func verify () = match tx {
9898 case _ =>
9999 let admin = valueOrElse(getString(this, keyManPubKey()), EMPTY)
100100 if ((admin == EMPTY))
101101 then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
102102 else sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(admin))
103103 }
104104

github/deemru/w8io/169f3d6 
33.90 ms