tx · BwAM9u7cK6NRK8Yf21Zq87ZyCdyqFLCRrposwjkANaF9

3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS:  -0.01400000 Waves

2021.10.25 17:20 [1761954] smart account 3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS > SELF 0.00000000 Waves

{ "type": 13, "id": "BwAM9u7cK6NRK8Yf21Zq87ZyCdyqFLCRrposwjkANaF9", "fee": 1400000, "feeAssetId": null, "timestamp": 1635171717817, "version": 1, "sender": "3MxaubN2nHCzE5spNox3ZCbPbDMfczSFrZS", "senderPublicKey": "FWDMjbKuHyuUuAo4utnjwDgcbsiysMPDjX835SxvtLHq", "proofs": [ "5QCQjcjv8Xfo2b1uNtrcCYogYjo9AxUhr7Gqjq9MCfB4CRfKLbKHsxKTHX99eP9hWCSEh2qyL693ci132kNU1sQw" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgASAwoBARIDCgEBAAAAFwAAAAAHYmFsYW5jZQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVKMjU/C0oWt5judpFHXM19dztnXKmPy+aQAAAAARU1dPUGdvdmVybmFuY2VBZHIJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2JhbGFuY2UCAAAAD1NXT1BfZ292ZXJuYW5jZQIAAAAVRW1wdHkgU1dPUF9nb3Zlcm5hbmNlAAAAAA1XYXZlc1VzZG5Qb29sCQEAAAAFdmFsdWUAAAABCQAEJgAAAAEJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdiYWxhbmNlAgAAAA9XQVZFU19VU0ROX1Bvb2wCAAAAFUVtcHR5IFdBVkVTX1VTRE5fUG9vbAAAAAAXZGVmaWhlbHBlck1hbmFnZXJQdWJLZXkJAAJZAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAdiYWxhbmNlAgAA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F3BQAAAARTV09QBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAO5XAn8=", "chainId": 84, "height": 1761954, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3sjRy5uvZd8M25EaoMwU1owfxMU4KThg1xVRdwe982vP Next: 48TQYq1gFvN2eGAMj6UVFDn4WQsyXYEDdKddjDBVVzeo Diff:
OldNewDifferences
2020 let keyIsProtocolActive = "isProtocolActive"
2121
2222 let owner = addressFromString(valueOrErrorMessage(getString(this, keyOwner), "Empty keyOwner"))
23+
24+let ownerStr = valueOrErrorMessage(getString(this, keyOwner), "Empty keyOwner")
2325
2426 let isProtocolActive = valueOrErrorMessage(getBoolean(balance, keyIsProtocolActive), "Empty key isProtocolActive")
2527
8486 then [StringEntry(keyOwner, toString(i.caller))]
8587 else if ((size(i.payments) == 1))
8688 then {
87- let $t033113386 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
88- let pmtAmount = $t033113386._1
89- let pmtAssetId = $t033113386._2
89+ let $t033893464 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
90+ let pmtAmount = $t033893464._1
91+ let pmtAssetId = $t033893464._2
9092 if ((pmtAssetId != SWOP))
9193 then throw("Only SWOP payment available in init()")
9294 else {
102104
103105 @Callable(i)
104106 func governanceLockSWOP () = {
105- let $t038003875 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
106- let pmtAmount = $t038003875._1
107- let pmtAssetId = $t038003875._2
107+ let $t038783953 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
108+ let pmtAmount = $t038783953._1
109+ let pmtAssetId = $t038783953._2
108110 if ((pmtAssetId != SWOP))
109111 then throw("Only SWOP payment available in governanceLockSWOP()")
110112 else {
130132 let z = invoke(SWOPgovernanceAdr, "claimAndStakeSWOP", nil, nil)
131133 if ((z == z))
132134 then {
133- let y = invoke(balance, "extractFee", [protocolFee, owner], nil)
135+ let y = invoke(balance, "extractFee", [protocolFee, ownerStr], nil)
134136 if ((y == y))
135137 then nil
136138 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")))
77
88 let WavesUsdnPool = value(addressFromString(valueOrErrorMessage(getString(balance, "WAVES_USDN_Pool"), "Empty WAVES_USDN_Pool")))
99
1010 let defihelperManagerPubKey = fromBase58String(valueOrElse(getString(balance, "defihelper_manager_PubKey"), "Empty key defihelper_manager_PubKey"))
1111
1212 let adminPubKey1 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1313
1414 let adminPubKey2 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1515
1616 let adminPubKey3 = base58'Aqj7onZFvn779uRCiW2zCmXG1RKsGeA6k3SWXmH7s5Lv'
1717
1818 let keyOwner = "owner"
1919
2020 let keyIsProtocolActive = "isProtocolActive"
2121
2222 let owner = addressFromString(valueOrErrorMessage(getString(this, keyOwner), "Empty keyOwner"))
23+
24+let ownerStr = valueOrErrorMessage(getString(this, keyOwner), "Empty keyOwner")
2325
2426 let isProtocolActive = valueOrErrorMessage(getBoolean(balance, keyIsProtocolActive), "Empty key isProtocolActive")
2527
2628 let keyLastInterest = "last_interest"
2729
2830 let keyUserSWOPLocked = "_SWOP_amount"
2931
3032 let keyUserLastInterest = "_last_interest"
3133
3234 let SWOP = base58'Ccgesc9iWMSg1f8CqFP5nZwgF6xsGirReDhpvNp1JAWW'
3335
3436 let scaleValue = 100000000
3537
3638 func getLastInterestInfo () = {
3739 let lastInterest = valueOrElse(getInteger(SWOPgovernanceAdr, keyLastInterest), 0)
3840 lastInterest
3941 }
4042
4143
4244 func calcWavesProtocolFee () = {
4345 let balanceUSDN = valueOrErrorMessage(getInteger(WavesUsdnPool, "B_asset_balance"), "Empty B_asset_balance")
4446 let balanceWAVES = valueOrErrorMessage(getInteger(WavesUsdnPool, "A_asset_balance"), "Empty A_asset_balance")
4547 let feeInUSDN = valueOrErrorMessage(getInteger(balance, "protocol_fee_in_usdn"), "Empty protocol_fee_in_usdn")
4648 let priceWAVES = fraction(balanceUSDN, feeInUSDN, balanceWAVES)
4749 priceWAVES
4850 }
4951
5052
5153 func getUserSWOPLocked (user) = valueOrElse(getInteger(SWOPgovernanceAdr, (toString(user) + keyUserSWOPLocked)), 0)
5254
5355
5456 func getUserInterestInfo (user,lastInterest) = {
5557 let userSWOPAmount = getUserSWOPLocked(user)
5658 let userLastInterest = getInteger(SWOPgovernanceAdr, (toString(user) + keyUserLastInterest))
5759 let userLastInterestValue = match userLastInterest {
5860 case userLastInterest: Int =>
5961 userLastInterest
6062 case _ =>
6163 lastInterest
6264 }
6365 $Tuple2(userLastInterestValue, userSWOPAmount)
6466 }
6567
6668
6769 func claimCalc (caller) = {
6870 let lastInterest = getLastInterestInfo()
6971 let uifo = getUserInterestInfo(caller, lastInterest)
7072 let userLastInterest = uifo._1
7173 let userSWOPLocked = uifo._2
7274 let claimAmount = fraction(userSWOPLocked, (lastInterest - userLastInterest), scaleValue)
7375 let userNewInterest = lastInterest
7476 $Tuple2(userNewInterest, claimAmount)
7577 }
7678
7779
7880 let protocolFee = calcWavesProtocolFee()
7981
8082 @Callable(i)
8183 func init () = if (isDefined(getString(this, keyOwner)))
8284 then throw("Contract already initialized")
8385 else if ((size(i.payments) == 0))
8486 then [StringEntry(keyOwner, toString(i.caller))]
8587 else if ((size(i.payments) == 1))
8688 then {
87- let $t033113386 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
88- let pmtAmount = $t033113386._1
89- let pmtAssetId = $t033113386._2
89+ let $t033893464 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
90+ let pmtAmount = $t033893464._1
91+ let pmtAssetId = $t033893464._2
9092 if ((pmtAssetId != SWOP))
9193 then throw("Only SWOP payment available in init()")
9294 else {
9395 let z = invoke(SWOPgovernanceAdr, "lockSWOP", nil, [AttachedPayment(SWOP, pmtAmount)])
9496 if ((z == z))
9597 then [StringEntry(keyOwner, toString(i.caller))]
9698 else throw("Strict value is not equal to itself.")
9799 }
98100 }
99101 else throw("Incorrect paynemt. You should attach SWOP or empty payment")
100102
101103
102104
103105 @Callable(i)
104106 func governanceLockSWOP () = {
105- let $t038003875 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
106- let pmtAmount = $t038003875._1
107- let pmtAssetId = $t038003875._2
107+ let $t038783953 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
108+ let pmtAmount = $t038783953._1
109+ let pmtAssetId = $t038783953._2
108110 if ((pmtAssetId != SWOP))
109111 then throw("Only SWOP payment available in governanceLockSWOP()")
110112 else {
111113 let z = invoke(SWOPgovernanceAdr, "lockSWOP", nil, [AttachedPayment(SWOP, pmtAmount)])
112114 if ((z == z))
113115 then nil
114116 else throw("Strict value is not equal to itself.")
115117 }
116118 }
117119
118120
119121
120122 @Callable(i)
121123 func governanceClaimAndStake (minSWOPreward) = if (if ((i.caller != owner))
122124 then (i.callerPublicKey != defihelperManagerPubKey)
123125 else false)
124126 then throw("Only owner or admin can call this function")
125127 else {
126128 let claimAmount = claimCalc(this)._2
127129 if ((minSWOPreward > claimAmount))
128130 then throw("Amount to claim is less than minSWOPreward")
129131 else {
130132 let z = invoke(SWOPgovernanceAdr, "claimAndStakeSWOP", nil, nil)
131133 if ((z == z))
132134 then {
133- let y = invoke(balance, "extractFee", [protocolFee, owner], nil)
135+ let y = invoke(balance, "extractFee", [protocolFee, ownerStr], nil)
134136 if ((y == y))
135137 then nil
136138 else throw("Strict value is not equal to itself.")
137139 }
138140 else throw("Strict value is not equal to itself.")
139141 }
140142 }
141143
142144
143145
144146 @Callable(i)
145147 func governanceWithdraw (amtToWithdraw) = if ((i.caller != owner))
146148 then throw("Only owner can call this function")
147149 else {
148150 let z = invoke(SWOPgovernanceAdr, "withdrawSWOP", [amtToWithdraw], nil)
149151 if ((z == z))
150152 then [ScriptTransfer(i.caller, amtToWithdraw, SWOP)]
151153 else throw("Strict value is not equal to itself.")
152154 }
153155
154156

github/deemru/w8io/169f3d6 
34.59 ms