tx · 6pEJp49btvb7sddDa9SwvejMnwHYfqh8uFfsUTQ1P67W

3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5:  -0.01000000 Waves

2021.11.16 16:14 [1793639] smart account 3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5 > SELF 0.00000000 Waves

{ "type": 13, "id": "6pEJp49btvb7sddDa9SwvejMnwHYfqh8uFfsUTQ1P67W", "fee": 1000000, "feeAssetId": null, "timestamp": 1637068498668, "version": 1, "sender": "3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5", "senderPublicKey": "hXnMcUKtqomxgSbnHn7eToAsYJGaa1PWq7Lq6QQLumm", "proofs": [ "khkKm1vrfRSptqeGke37yhcwmkTAZrSMkHUup9GoSDbdDtHvh314XJ9TbCXMamtf1GDSgJBUf4NSJQqaKCf1Xem" ], "script": "base64:AAIFAAAAAAAAABoIAhIDCgEIEgASBAoCCAESAwoBCBIECgIICAAAACcAAAAABlNDQUxFOAAAAAAAAAAACAAAAAAFTVVMVDgAAAAAAAX14QAAAAAAB1NDQUxFMTgAAAAAAAAAABIAAAAABk1VTFQxOAkAATYAAAABAA3gtrOnZAAAAAAAAANTRVACAAAAAl9fAQAAAA9nZXRTdHJpbmdPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEIgAAAAEFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD21hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQBAAAAGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbAAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAKbWFuZGF0b3J5IAkABCUAAAABBQAAAAdhZGRyZXNzAgAAAAEuBQ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WCZNQg==", "chainId": 84, "height": 1793639, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BzDBEe1F5VgzByL4GqG686GQd34Pufp2n7j7M4yvrpQ1 Next: 3h61i52da33peAjoDhbkS8BsCcWZQPe9du5hU69rqSKu Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let SCALE8 = 8
5+
6+let MULT8 = 100000000
7+
8+let SCALE18 = 18
9+
10+let MULT18 = toBigInt(1000000000000000000)
11+
412 let SEP = "__"
513
614 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
917 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
1018
1119
20+func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
21+
22+
23+func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
24+
25+
1226 func keyFactoryAddress () = "%s%s__config__factoryAddress"
27+
28+
29+let IdxFactoryCfgStakingDapp = 1
30+
31+let IdxFactoryCfgBoostingDapp = 2
32+
33+let IdxFactoryCfgIdoDapp = 3
34+
35+let IdxFactoryCfgTeamDapp = 4
36+
37+let IdxFactoryCfgEmissionDapp = 5
38+
39+let IdxFactoryCfgRestDapp = 6
40+
41+let IdxFactoryCfgSlippageDapp = 7
42+
43+func keyFactoryCfg () = "%s__factoryConfig"
1344
1445
1546 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
1647
1748
49+func keyFactoryLpList () = "%s__lpTokensList"
50+
51+
52+func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
53+
54+
55+func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
56+
57+
1858 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress()))
59+
60+
61+func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
62+
63+
64+func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
65+
66+
67+func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
68+
69+
70+func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
71+
72+
73+func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
74+
75+
76+func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
77+
78+
79+func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
80+
81+
82+func keyEmissionStartBlock () = "%s%s__emission__startBlock"
83+
84+
85+func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
86+
87+
88+func keyEmissionEndBlock () = "%s%s__emission__endBlock"
1989
2090
2191 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
94164
95165
96166 @Callable(i)
97-func claimWxREADONLY (lpAssetIdStr,userAddress) = $Tuple2(nil, makeString(["%s%s%d", lpAssetIdStr, userAddress, "0"], SEP))
167+func claimWxREADONLY (lpAssetIdStr,userAddress) = {
168+ let factoryContract = readFactoryAddressOrFail()
169+ let factoryCfg = readFactoryCfgOrFail(factoryContract)
170+ let emissionContract = getEmissionAddressOrFail(factoryCfg)
171+ let stakedByUserKEY = keyStakedByUser(userAddress, lpAssetIdStr)
172+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
173+ let stakedByUser = readStaked(stakedByUserKEY)
174+ let stakedTotal = readStaked(stakedTotalKEY)
175+ let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
176+ let poolWeightMult = MULT8
177+ let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
178+ let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
179+ let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
180+ let passedBlocks = if ((emissionStartBlock > height))
181+ then 0
182+ else (height - emissionStartBlock)
183+ let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, poolWeightMult)
184+ let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
185+ $Tuple2(nil, makeString(["%s%s%d", lpAssetIdStr, userAddress, toString(userWxReward)], SEP))
186+ }
98187
99188
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let SCALE8 = 8
5+
6+let MULT8 = 100000000
7+
8+let SCALE18 = 18
9+
10+let MULT18 = toBigInt(1000000000000000000)
11+
412 let SEP = "__"
513
614 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
715
816
917 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
1018
1119
20+func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
21+
22+
23+func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
24+
25+
1226 func keyFactoryAddress () = "%s%s__config__factoryAddress"
27+
28+
29+let IdxFactoryCfgStakingDapp = 1
30+
31+let IdxFactoryCfgBoostingDapp = 2
32+
33+let IdxFactoryCfgIdoDapp = 3
34+
35+let IdxFactoryCfgTeamDapp = 4
36+
37+let IdxFactoryCfgEmissionDapp = 5
38+
39+let IdxFactoryCfgRestDapp = 6
40+
41+let IdxFactoryCfgSlippageDapp = 7
42+
43+func keyFactoryCfg () = "%s__factoryConfig"
1344
1445
1546 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
1647
1748
49+func keyFactoryLpList () = "%s__lpTokensList"
50+
51+
52+func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
53+
54+
55+func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
56+
57+
1858 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress()))
59+
60+
61+func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
62+
63+
64+func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
65+
66+
67+func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
68+
69+
70+func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
71+
72+
73+func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
74+
75+
76+func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
77+
78+
79+func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
80+
81+
82+func keyEmissionStartBlock () = "%s%s__emission__startBlock"
83+
84+
85+func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
86+
87+
88+func keyEmissionEndBlock () = "%s%s__emission__endBlock"
1989
2090
2191 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
2292
2393
2494 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
2595
2696
2797 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
2898
2999
30100 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
31101
32102
33103 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
34104
35105
36106 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
37107
38108
39109 @Callable(i)
40110 func constructor (factoryAddressStr) = if ((i.caller != this))
41111 then throw("not authorized")
42112 else [StringEntry(keyFactoryAddress(), factoryAddressStr)]
43113
44114
45115
46116 @Callable(i)
47117 func stake () = {
48118 let factory = readFactoryAddressOrFail()
49119 if ((size(i.payments) != 1))
50120 then throw("invalid payment - exact one payment must be attached")
51121 else {
52122 let pmt = i.payments[0]
53123 let lpAssetId = value(pmt.assetId)
54124 let lpAssetIdStr = toBase58String(lpAssetId)
55125 let amount = pmt.amount
56126 let lpDappStr = valueOrErrorMessage(getString(factory, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
57127 let callerStr = toString(i.caller)
58128 let userAddressStr = if ((callerStr == lpDappStr))
59129 then toString(i.originCaller)
60130 else callerStr
61131 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
62132 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
63133 let stakedByUser = readStaked(stakedByUserKEY)
64134 let stakedTotal = readStaked(stakedTotalKEY)
65135 [IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)]
66136 }
67137 }
68138
69139
70140
71141 @Callable(i)
72142 func unstake (lpAssetIdStr,amount) = {
73143 let factory = readFactoryAddressOrFail()
74144 let userAddressStr = toString(i.caller)
75145 let lpAssetId = fromBase58String(lpAssetIdStr)
76146 if (!(isDefined(getString(factory, keyFactoryLp2AssetsMapping(lpAssetIdStr)))))
77147 then throw(("unsupported lp asset " + lpAssetIdStr))
78148 else {
79149 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
80150 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
81151 let stakedByUser = readStaked(stakedByUserKEY)
82152 let stakedTotal = readStaked(stakedTotalKEY)
83153 if ((amount > stakedByUser))
84154 then throw("passed amount is less then available")
85155 else [IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)]
86156 }
87157 }
88158
89159
90160
91161 @Callable(i)
92162 func claimWx (lpAssetIdStr) = throw("temorary disabled")
93163
94164
95165
96166 @Callable(i)
97-func claimWxREADONLY (lpAssetIdStr,userAddress) = $Tuple2(nil, makeString(["%s%s%d", lpAssetIdStr, userAddress, "0"], SEP))
167+func claimWxREADONLY (lpAssetIdStr,userAddress) = {
168+ let factoryContract = readFactoryAddressOrFail()
169+ let factoryCfg = readFactoryCfgOrFail(factoryContract)
170+ let emissionContract = getEmissionAddressOrFail(factoryCfg)
171+ let stakedByUserKEY = keyStakedByUser(userAddress, lpAssetIdStr)
172+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
173+ let stakedByUser = readStaked(stakedByUserKEY)
174+ let stakedTotal = readStaked(stakedTotalKEY)
175+ let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
176+ let poolWeightMult = MULT8
177+ let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
178+ let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
179+ let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
180+ let passedBlocks = if ((emissionStartBlock > height))
181+ then 0
182+ else (height - emissionStartBlock)
183+ let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, poolWeightMult)
184+ let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
185+ $Tuple2(nil, makeString(["%s%s%d", lpAssetIdStr, userAddress, toString(userWxReward)], SEP))
186+ }
98187
99188

github/deemru/w8io/fabc49c 
30.37 ms