tx · 3FeqZfcBUkgvS4hWunrgSPa5komepakdZsdsYAiZkQe2

3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5:  -0.01400000 Waves

2021.12.15 12:33 [1835192] smart account 3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5 > SELF 0.00000000 Waves

{ "type": 13, "id": "3FeqZfcBUkgvS4hWunrgSPa5komepakdZsdsYAiZkQe2", "fee": 1400000, "feeAssetId": null, "timestamp": 1639560833186, "version": 1, "sender": "3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5", "senderPublicKey": "hXnMcUKtqomxgSbnHn7eToAsYJGaa1PWq7Lq6QQLumm", "proofs": [ "V7ZDWDArHBYzhvhkSmLJ4oPtwGGnUdfuRdG7yqRXT99L126BeZ7V7wvGXz6uTWCJpoY8F7jMb59XoH2deNF2HFx" ], "script": "base64:AAIFAAAAAAAAABoIAhIDCgEIEgASBAoCCAESAwoBCBIECgIICAAAAAwAAAAAA1NFUAIAAAACX18BAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQiAAAAAQUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgIAAAAPbWFuZGF0b3J5IHRoaXMuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsAAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAptYW5kYXRvcnkgCQAEJQAAAAEFAAAAB2FkZHJlc3MCAAAAAS4FAAAAA2tleQIAAAAPIGlzIG5vdCBkZWZpbmVkAQAAABFrZXlGYWN0b3J5QWRkcmVzcwAAAAACAAAAHCVzJXNfX2NvbmZpZ19fZmFjdG9yeU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zc1N0cgUAAAAMbHBBc3NldElkU3RyBQAAAAZhbW91bnQIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQFAAAAA25pbAAAAAFpAQAAAAdjbGFpbVd4AAAAAQAAAAxscEFzc2V0SWRTdHIJAAACAAAAAQIAAAARdGVtb3JhcnkgZGlzYWJsZWQAAAABaQEAAAAPY2xhaW1XeFJFQURPTkxZAAAAAgAAAAxscEFzc2V0SWRTdHIAAAALdXNlckFkZHJlc3MJAAUUAAAAAgUAAAADbmlsCQAEuQAAAAIJAARMAAAAAgIAAAAGJXMlcyVkCQAETAAAAAIFAAAADGxwQXNzZXRJZFN0cgkABEwAAAACBQAAAAt1c2VyQWRkcmVzcwkABEwAAAACAgAAAAEwBQAAAANuaWwFAAAAA1NFUAAAAAB2cdPd", "chainId": 84, "height": 1835192, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3h61i52da33peAjoDhbkS8BsCcWZQPe9du5hU69rqSKu Next: Y1KgusWFJELB6cXfFKvEARaMVy4ADCfMb3sRBT8LmiT Diff:
OldNewDifferences
5959 then toString(i.originCaller)
6060 else callerStr
6161 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
62- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
63- let stakedByUser = readStaked(stakedByUserKEY)
64- let stakedTotal = readStaked(stakedTotalKEY)
62+ if (true)
63+ then throw(((((((("callerStr: " + callerStr) + ", userAddressStr: ") + userAddressStr) + ", lpDappStr: ") + lpDappStr) + ", stakedByUserKEY: ") + stakedByUserKEY))
64+ else {
65+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
66+ let stakedByUser = readStaked(stakedByUserKEY)
67+ let stakedTotal = readStaked(stakedTotalKEY)
6568 [IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)]
69+ }
6670 }
6771 }
6872
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
77
88
99 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
1010
1111
1212 func keyFactoryAddress () = "%s%s__config__factoryAddress"
1313
1414
1515 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
1616
1717
1818 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress()))
1919
2020
2121 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
2222
2323
2424 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
2525
2626
2727 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
2828
2929
3030 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
3131
3232
3333 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
3434
3535
3636 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
3737
3838
3939 @Callable(i)
4040 func constructor (factoryAddressStr) = if ((i.caller != this))
4141 then throw("not authorized")
4242 else [StringEntry(keyFactoryAddress(), factoryAddressStr)]
4343
4444
4545
4646 @Callable(i)
4747 func stake () = {
4848 let factory = readFactoryAddressOrFail()
4949 if ((size(i.payments) != 1))
5050 then throw("invalid payment - exact one payment must be attached")
5151 else {
5252 let pmt = i.payments[0]
5353 let lpAssetId = value(pmt.assetId)
5454 let lpAssetIdStr = toBase58String(lpAssetId)
5555 let amount = pmt.amount
5656 let lpDappStr = valueOrErrorMessage(getString(factory, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
5757 let callerStr = toString(i.caller)
5858 let userAddressStr = if ((callerStr == lpDappStr))
5959 then toString(i.originCaller)
6060 else callerStr
6161 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
62- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
63- let stakedByUser = readStaked(stakedByUserKEY)
64- let stakedTotal = readStaked(stakedTotalKEY)
62+ if (true)
63+ then throw(((((((("callerStr: " + callerStr) + ", userAddressStr: ") + userAddressStr) + ", lpDappStr: ") + lpDappStr) + ", stakedByUserKEY: ") + stakedByUserKEY))
64+ else {
65+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
66+ let stakedByUser = readStaked(stakedByUserKEY)
67+ let stakedTotal = readStaked(stakedTotalKEY)
6568 [IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)]
69+ }
6670 }
6771 }
6872
6973
7074
7175 @Callable(i)
7276 func unstake (lpAssetIdStr,amount) = {
7377 let factory = readFactoryAddressOrFail()
7478 let lpAssetId = fromBase58String(lpAssetIdStr)
7579 let lpDappStr = valueOrErrorMessage(getString(factory, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
7680 let callerStr = toString(i.caller)
7781 let userAddressStr = if ((callerStr == lpDappStr))
7882 then toString(i.originCaller)
7983 else callerStr
8084 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
8185 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
8286 let stakedByUser = readStaked(stakedByUserKEY)
8387 let stakedTotal = readStaked(stakedTotalKEY)
8488 if ((amount > stakedByUser))
8589 then throw("passed amount is less then available")
8690 else [IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)]
8791 }
8892
8993
9094
9195 @Callable(i)
9296 func claimWx (lpAssetIdStr) = throw("temorary disabled")
9397
9498
9599
96100 @Callable(i)
97101 func claimWxREADONLY (lpAssetIdStr,userAddress) = $Tuple2(nil, makeString(["%s%s%d", lpAssetIdStr, userAddress, "0"], SEP))
98102
99103

github/deemru/w8io/fabc49c 
23.89 ms