tx · 48TQYq1gFvN2eGAMj6UVFDn4WQsyXYEDdKddjDBVVzeo

3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS:  -0.01400000 Waves

2021.10.25 17:43 [1761977] smart account 3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS > SELF 0.00000000 Waves

{ "type": 13, "id": "48TQYq1gFvN2eGAMj6UVFDn4WQsyXYEDdKddjDBVVzeo", "fee": 1400000, "feeAssetId": null, "timestamp": 1635173004858, "version": 1, "sender": "3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS", "senderPublicKey": "FWDMjbKuHyuUuAo4utnjwDgcbsiysMPDjX835SxvtLHq", "proofs": [ "41SUjqz5NFnbCMqZcTBmtmYnPvNSpin11vuhaY4bEqn1xP2sAMVQxfwj8WorjuheBWKmGkBg5ReSPvCDwibS33XH" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgASAwoBARIDCgEBAAAAFAAAAAAHYmFsYW5jZQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVKMjU/C0oWt5judpFHXM19dztnXKmPy+aQAAAAARU1dPUGdvdmVybmFuY2VBZHIJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2JhbGFuY2UCAAAAD1NXT1BfZ292ZXJuYW5jZQIAAAAVRW1wdHkgU1dPUF9nb3Zlcm5hbmNlAAAAABdkZWZpaGVscGVyTWFuYWdlclB1YktleQkAAlkAAAABCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAAB2JhbGFuY2UCAAAAGWRlZmloZWxwZXJfbWFuYWdlcl9QdWJLZXkCAAAAI0VtcHR5IGtleSBkZWZpaGVscGVyX21hbmFnZXJfUHViS2V5AAAAAAxhZG1pblB1YktleTEBAAAAIJI0rvSL2N+4Jd3ss8OgEArwbahdnCXQKg1y+jLzTuJDAAAAAAxhZG1pblB1YktleTIBAAAAIJI0rvSL2N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sAwkAAAAAAAACBQAAAAF6BQAAAAF6CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAANYW10VG9XaXRoZHJhdwUAAAAEU1dPUAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAAvXLB5", "chainId": 84, "height": 1761977, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BwAM9u7cK6NRK8Yf21Zq87ZyCdyqFLCRrposwjkANaF9 Next: 6juBwX97hPpSRpMw8dL8zPfAp7PRdgBAckdEZZZnwEow Diff:
OldNewDifferences
44 let balance = Address(base58'3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J')
55
66 let SWOPgovernanceAdr = value(addressFromString(valueOrErrorMessage(getString(balance, "SWOP_governance"), "Empty SWOP_governance")))
7-
8-let WavesUsdnPool = value(addressFromString(valueOrErrorMessage(getString(balance, "WAVES_USDN_Pool"), "Empty WAVES_USDN_Pool")))
97
108 let defihelperManagerPubKey = fromBase58String(valueOrElse(getString(balance, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey"))
119
4139 }
4240
4341
44-func calcWavesProtocolFee () = {
45- let balanceUSDN = valueOrErrorMessage(getInteger(WavesUsdnPool, "B_asset_balance"), "Empty B_asset_balance")
46- let balanceWAVES = valueOrErrorMessage(getInteger(WavesUsdnPool, "A_asset_balance"), "Empty A_asset_balance")
47- let feeInUSDN = valueOrErrorMessage(getInteger(balance, "protocol_fee_in_usdn"), "Empty protocol_fee_in_usdn")
48- let priceWAVES = fraction(balanceUSDN, feeInUSDN, balanceWAVES)
49- priceWAVES
50- }
51-
52-
5342 func getUserSWOPLocked (user) = valueOrElse(getInteger(SWOPgovernanceAdr, (toString(user) + keyUserSWOPLocked)), 0)
5443
5544
7766 }
7867
7968
80-let protocolFee = calcWavesProtocolFee()
81-
8269 @Callable(i)
8370 func init () = if (isDefined(getString(this, keyOwner)))
8471 then throw("Contract already initialized")
8673 then [StringEntry(keyOwner, toString(i.caller))]
8774 else if ((size(i.payments) == 1))
8875 then {
89- let $t033893464 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
90- let pmtAmount = $t033893464._1
91- let pmtAssetId = $t033893464._2
76+ let $t027652840 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
77+ let pmtAmount = $t027652840._1
78+ let pmtAssetId = $t027652840._2
9279 if ((pmtAssetId != SWOP))
9380 then throw("Only SWOP payment available in init()")
9481 else {
10491
10592 @Callable(i)
10693 func governanceLockSWOP () = {
107- let $t038783953 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
108- let pmtAmount = $t038783953._1
109- let pmtAssetId = $t038783953._2
94+ let $t032543329 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
95+ let pmtAmount = $t032543329._1
96+ let pmtAssetId = $t032543329._2
11097 if ((pmtAssetId != SWOP))
11198 then throw("Only SWOP payment available in governanceLockSWOP()")
11299 else {
132119 let z = invoke(SWOPgovernanceAdr, "claimAndStakeSWOP", nil, nil)
133120 if ((z == z))
134121 then {
135- let y = invoke(balance, "extractFee", [protocolFee, ownerStr], nil)
122+ let y = invoke(balance, "extractFee", [ownerStr], nil)
136123 if ((y == y))
137124 then nil
138125 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let balance = Address(base58'3N4ngEpA29qJdUKnRto5zUzXvJJLwUuNs5J')
55
66 let SWOPgovernanceAdr = value(addressFromString(valueOrErrorMessage(getString(balance, "SWOP_governance"), "Empty SWOP_governance")))
7-
8-let WavesUsdnPool = value(addressFromString(valueOrErrorMessage(getString(balance, "WAVES_USDN_Pool"), "Empty WAVES_USDN_Pool")))
97
108 let defihelperManagerPubKey = fromBase58String(valueOrElse(getString(balance, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey"))
119
1210 let adminPubKey1 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1311
1412 let adminPubKey2 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1513
1614 let adminPubKey3 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1715
1816 let keyOwner = "owner"
1917
2018 let keyIsProtocolActive = "isProtocolActive"
2119
2220 let owner = addressFromString(valueOrErrorMessage(getString(this, keyOwner), "Empty keyOwner"))
2321
2422 let ownerStr = valueOrErrorMessage(getString(this, keyOwner), "Empty keyOwner")
2523
2624 let isProtocolActive = valueOrErrorMessage(getBoolean(balance, keyIsProtocolActive), "Empty key isProtocolActive")
2725
2826 let keyLastInterest = "last_interest"
2927
3028 let keyUserSWOPLocked = "_SWOP_amount"
3129
3230 let keyUserLastInterest = "_last_interest"
3331
3432 let SWOP = base58'Ccgesc9iWMSg1f8CqFP5nZwgF6xsGirReDhpvNp1JAWW'
3533
3634 let scaleValue = 100000000
3735
3836 func getLastInterestInfo () = {
3937 let lastInterest = valueOrElse(getInteger(SWOPgovernanceAdr, keyLastInterest), 0)
4038 lastInterest
4139 }
4240
4341
44-func calcWavesProtocolFee () = {
45- let balanceUSDN = valueOrErrorMessage(getInteger(WavesUsdnPool, "B_asset_balance"), "Empty B_asset_balance")
46- let balanceWAVES = valueOrErrorMessage(getInteger(WavesUsdnPool, "A_asset_balance"), "Empty A_asset_balance")
47- let feeInUSDN = valueOrErrorMessage(getInteger(balance, "protocol_fee_in_usdn"), "Empty protocol_fee_in_usdn")
48- let priceWAVES = fraction(balanceUSDN, feeInUSDN, balanceWAVES)
49- priceWAVES
50- }
51-
52-
5342 func getUserSWOPLocked (user) = valueOrElse(getInteger(SWOPgovernanceAdr, (toString(user) + keyUserSWOPLocked)), 0)
5443
5544
5645 func getUserInterestInfo (user,lastInterest) = {
5746 let userSWOPAmount = getUserSWOPLocked(user)
5847 let userLastInterest = getInteger(SWOPgovernanceAdr, (toString(user) + keyUserLastInterest))
5948 let userLastInterestValue = match userLastInterest {
6049 case userLastInterest: Int =>
6150 userLastInterest
6251 case _ =>
6352 lastInterest
6453 }
6554 $Tuple2(userLastInterestValue, userSWOPAmount)
6655 }
6756
6857
6958 func claimCalc (caller) = {
7059 let lastInterest = getLastInterestInfo()
7160 let uifo = getUserInterestInfo(caller, lastInterest)
7261 let userLastInterest = uifo._1
7362 let userSWOPLocked = uifo._2
7463 let claimAmount = fraction(userSWOPLocked, (lastInterest - userLastInterest), scaleValue)
7564 let userNewInterest = lastInterest
7665 $Tuple2(userNewInterest, claimAmount)
7766 }
7867
7968
80-let protocolFee = calcWavesProtocolFee()
81-
8269 @Callable(i)
8370 func init () = if (isDefined(getString(this, keyOwner)))
8471 then throw("Contract already initialized")
8572 else if ((size(i.payments) == 0))
8673 then [StringEntry(keyOwner, toString(i.caller))]
8774 else if ((size(i.payments) == 1))
8875 then {
89- let $t033893464 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
90- let pmtAmount = $t033893464._1
91- let pmtAssetId = $t033893464._2
76+ let $t027652840 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
77+ let pmtAmount = $t027652840._1
78+ let pmtAssetId = $t027652840._2
9279 if ((pmtAssetId != SWOP))
9380 then throw("Only SWOP payment available in init()")
9481 else {
9582 let z = invoke(SWOPgovernanceAdr, "lockSWOP", nil, [AttachedPayment(SWOP, pmtAmount)])
9683 if ((z == z))
9784 then [StringEntry(keyOwner, toString(i.caller))]
9885 else throw("Strict value is not equal to itself.")
9986 }
10087 }
10188 else throw("Incorrect paynemt. You should attach SWOP or empty payment")
10289
10390
10491
10592 @Callable(i)
10693 func governanceLockSWOP () = {
107- let $t038783953 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
108- let pmtAmount = $t038783953._1
109- let pmtAssetId = $t038783953._2
94+ let $t032543329 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
95+ let pmtAmount = $t032543329._1
96+ let pmtAssetId = $t032543329._2
11097 if ((pmtAssetId != SWOP))
11198 then throw("Only SWOP payment available in governanceLockSWOP()")
11299 else {
113100 let z = invoke(SWOPgovernanceAdr, "lockSWOP", nil, [AttachedPayment(SWOP, pmtAmount)])
114101 if ((z == z))
115102 then nil
116103 else throw("Strict value is not equal to itself.")
117104 }
118105 }
119106
120107
121108
122109 @Callable(i)
123110 func governanceClaimAndStake (minSWOPreward) = if (if ((i.caller != owner))
124111 then (i.callerPublicKey != defihelperManagerPubKey)
125112 else false)
126113 then throw("Only owner or admin can call this function")
127114 else {
128115 let claimAmount = claimCalc(this)._2
129116 if ((minSWOPreward > claimAmount))
130117 then throw("Amount to claim is less than minSWOPreward")
131118 else {
132119 let z = invoke(SWOPgovernanceAdr, "claimAndStakeSWOP", nil, nil)
133120 if ((z == z))
134121 then {
135- let y = invoke(balance, "extractFee", [protocolFee, ownerStr], nil)
122+ let y = invoke(balance, "extractFee", [ownerStr], nil)
136123 if ((y == y))
137124 then nil
138125 else throw("Strict value is not equal to itself.")
139126 }
140127 else throw("Strict value is not equal to itself.")
141128 }
142129 }
143130
144131
145132
146133 @Callable(i)
147134 func governanceWithdraw (amtToWithdraw) = if ((i.caller != owner))
148135 then throw("Only owner can call this function")
149136 else {
150137 let z = invoke(SWOPgovernanceAdr, "withdrawSWOP", [amtToWithdraw], nil)
151138 if ((z == z))
152139 then [ScriptTransfer(i.caller, amtToWithdraw, SWOP)]
153140 else throw("Strict value is not equal to itself.")
154141 }
155142
156143

github/deemru/w8io/169f3d6 
70.59 ms