tx · 4vhRdvuMFNdV3soNtfhaow52srUucKhmpUEo7yjz6xSg

3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a:  -0.01400000 Waves

2021.07.21 16:45 [1623456] smart account 3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a > SELF 0.00000000 Waves

{ "type": 13, "id": "4vhRdvuMFNdV3soNtfhaow52srUucKhmpUEo7yjz6xSg", "fee": 1400000, "feeAssetId": null, "timestamp": 1626875196266, "version": 2, "chainId": 84, "sender": "3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a", "senderPublicKey": "4L5wicmAjiPH6pnWtdZQfrXQ9H45uCbVMTJcq7rU4vRf", "proofs": [ "Firq5KbDSFvrLdUvPWzCrjQ9yPQiDn9qmgfVajaP4BQCM3HHuc6HrSzbY7DaVyRmo1VC1msUgxu4NjbdwBWP45y" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAADQAAAAARa2V5QWN0aXZhdGVIZWlnaHQCAAAAD2FjdGl2YXRlX2hlaWdodAAAAAAPa2V5RmluaXNoSGVpZ2h0AgAAAA1maW5pc2hfaGVpZ2h0AAAAAA5hY3RpdmF0ZUhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAARa2V5QWN0aXZhdGVIZWlnaHQAAAAADGZpbmlzaEhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAAPa2V5RmluaXNoSGVpZ2h0AAAAAA50b3RhbFNoYXJlU1dPUAAAAFrzEHpAAAAAAAAEU1dPUAEAAAAgEv+BIJFIbrNA9tN9ExhCV/1vofsy06rszWo/nWl9O/gAAAAAGGtleVVzZXJTV09QQ2xhaW1lZEFtb3VudAIAAAAUX1NXT1BfY2xhaW1lZF9hbW91bnQAAAAAHGtleVVzZXJTV09QTGFzdENsYWltZWRBbW91bnQCAAAAGV9TV09QX2xhc3RfY2xhaW1lZF9hbW91bnQAAAA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LAAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAABxrZXlVc2VyU1dPUExhc3RDbGFpbWVkQW1vdW50BQAAAAtjbGFpbUFtb3VudAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgEAAAAEmFkbWluUHViS2V5MVNpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAxhZG1pblB1YktleTEAAAAAAAAAAAEAAAAAAAAAAAAEAAAAEmFkbWluUHViS2V5MlNpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABBQAAAAxhZG1pblB1YktleTIAAAAAAAAAAAEAAAAAAAAAAAAEAAAAEmFkbWluUHViS2V5M1NpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACBQAAAAxhZG1pblB1YktleTMAAAAAAAAAAAEAAAAAAAAAAAAJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAEmFkbWluUHViS2V5MVNpZ25lZAUAAAASYWRtaW5QdWJLZXkyU2lnbmVkBQAAABJhZG1pblB1YktleTNTaWduZWQAAAAAAAAAAAKzsucC", "height": 1623456, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7fuHykfTK2JnuyABW5pvwNe49maJEQNPPacjxGHkhhht Next: AB9tDdfsxDKVwdch4JYceapcLHHrdb4qFD88iUFwv29g Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 4 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyActivateHeight = "activate_height"
1717
1818 let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount"
1919
20-let adminPubKey1 = base58'DXDY2itiEcYBtGkVLnkpHtDFyWQUkoLJz79uJ7ECbMrA'
20+let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
2121
22-let adminPubKey2 = base58'E6Wa1SGoktYcjHjsKrvjMiqJY3SWmGKcD8Q5L8kxSPS7'
22+let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
2323
24-let adminPubKey3 = base58'AZmWJtuy4GeVrMmJH4hfFBRApe1StvhJSk4jcbT6bArQ'
24+let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
2525
2626 func getCallerShare (caller) = {
2727 let callerShare = getInteger(this, ("share_" + toString(caller)))
6666
6767
6868 @Verifier(tx)
69-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
69+func verify () = match tx {
70+ case _ =>
71+ let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
72+ then 1
73+ else 0
74+ let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
75+ then 1
76+ else 0
77+ let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
78+ then 1
79+ else 0
80+ (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
81+}
7082
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 4 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyActivateHeight = "activate_height"
55
66 let keyFinishHeight = "finish_height"
77
88 let activateHeight = getIntegerValue(this, keyActivateHeight)
99
1010 let finishHeight = getIntegerValue(this, keyFinishHeight)
1111
1212 let totalShareSWOP = 100000000000000
1313
1414 let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ'
1515
1616 let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount"
1717
1818 let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount"
1919
20-let adminPubKey1 = base58'DXDY2itiEcYBtGkVLnkpHtDFyWQUkoLJz79uJ7ECbMrA'
20+let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
2121
22-let adminPubKey2 = base58'E6Wa1SGoktYcjHjsKrvjMiqJY3SWmGKcD8Q5L8kxSPS7'
22+let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
2323
24-let adminPubKey3 = base58'AZmWJtuy4GeVrMmJH4hfFBRApe1StvhJSk4jcbT6bArQ'
24+let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
2525
2626 func getCallerShare (caller) = {
2727 let callerShare = getInteger(this, ("share_" + toString(caller)))
2828 let callerShareAmount = match callerShare {
2929 case share: Int =>
3030 share
3131 case share: Unit =>
3232 throw("Only early liquidity providers can call this function")
3333 case _ =>
3434 throw("Match error")
3535 }
3636 callerShareAmount
3737 }
3838
3939
4040 func getClaimedAmount (caller) = {
4141 let callerWithdrawn = getInteger(this, (toString(caller) + keyUserSWOPClaimedAmount))
4242 let callerWithdrawnAmount = match callerWithdrawn {
4343 case share: Int =>
4444 share
4545 case share: Unit =>
4646 0
4747 case _ =>
4848 throw("Match error")
4949 }
5050 callerWithdrawnAmount
5151 }
5252
5353
5454 @Callable(i)
5555 func claimSWOP () = {
5656 let blockDuration = (finishHeight - activateHeight)
5757 let currentDuration = if ((finishHeight > height))
5858 then height
5959 else finishHeight
6060 let userShare = getCallerShare(i.caller)
6161 let userClaimedAmount = getClaimedAmount(i.caller)
6262 let claimAmount = (fraction((currentDuration - activateHeight), userShare, blockDuration) - userClaimedAmount)
6363 let userClaimedAmountNew = (userClaimedAmount + claimAmount)
6464 [ScriptTransfer(i.caller, claimAmount, SWOP), IntegerEntry((toString(i.caller) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserSWOPLastClaimedAmount), claimAmount)]
6565 }
6666
6767
6868 @Verifier(tx)
69-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
69+func verify () = match tx {
70+ case _ =>
71+ let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
72+ then 1
73+ else 0
74+ let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
75+ then 1
76+ else 0
77+ let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
78+ then 1
79+ else 0
80+ (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
81+}
7082

github/deemru/w8io/026f985 
28.15 ms