tx · AB9tDdfsxDKVwdch4JYceapcLHHrdb4qFD88iUFwv29g

3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a:  -0.01400000 Waves

2021.07.21 17:25 [1623495] smart account 3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a > SELF 0.00000000 Waves

{ "type": 13, "id": "AB9tDdfsxDKVwdch4JYceapcLHHrdb4qFD88iUFwv29g", "fee": 1400000, "feeAssetId": null, "timestamp": 1626877536161, "version": 2, "chainId": 84, "sender": "3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a", "senderPublicKey": "4L5wicmAjiPH6pnWtdZQfrXQ9H45uCbVMTJcq7rU4vRf", "proofs": [ "2eua5pM93RDXVGkicH4SSLcc5cPCmf4uHK48KoKD7eWJfv5HpEty6xHdCPTdVpzf7v3HKM3ctopAjZu3wfGv9DsK", "9HeZk6J9NYgkyf5Y8ihkkw7YNp2VCmvSnHMAfkXyU2qXLXBSkxpcEmu1yKzv6XQioiScYDCvvRxdXaMBv29CwiE" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAEgAAAAARa2V5QWN0aXZhdGVIZWlnaHQCAAAAD2FjdGl2YXRlX2hlaWdodAAAAAAPa2V5RmluaXNoSGVpZ2h0AgAAAA1maW5pc2hfaGVpZ2h0AAAAAA5hY3RpdmF0ZUhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAARa2V5QWN0aXZhdGVIZWlnaHQAAAAADGZpbmlzaEhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAAPa2V5RmluaXNoSGVpZ2h0AAAAAA50b3RhbFNoYXJlU1dPUAAAAFrzEHpAAAAAAAAEU1dPUAEAAAAgEv+BIJFIbrNA9tN9ExhCV/1vofsy06rszWo/nWl9O/gAAAAAGGtleVVzZXJTV09QQ2xhaW1lZEFtb3VudAIAAAAUX1NXT1BfY2xhaW1lZF9hbW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LZXkyAAAAAAAAAAABAAAAAAAAAAAABAAAABJhZG1pblB1YktleTNTaWduZWQDCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgUAAAAMYWRtaW5QdWJLZXkzAAAAAAAAAAABAAAAAAAAAAAACQAAZwAAAAIJAABkAAAAAgkAAGQAAAACBQAAABJhZG1pblB1YktleTFTaWduZWQFAAAAEmFkbWluUHViS2V5MlNpZ25lZAUAAAASYWRtaW5QdWJLZXkzU2lnbmVkAAAAAAAAAAAC0bxG9w==", "height": 1623495, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4vhRdvuMFNdV3soNtfhaow52srUucKhmpUEo7yjz6xSg Next: C3gNPZB1y8YFxzDYZDq4WmNEjVzdJ5L4BGeKdjyjdpbx Diff:
OldNewDifferences
1717
1818 let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount"
1919
20-let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
20+let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
2121
22-let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
22+let keyAdminPubKey1 = "admin_pub_1"
2323
24-let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
24+let keyAdminPubKey2 = "admin_pub_2"
25+
26+let keyAdminPubKey3 = "admin_pub_3"
27+
28+func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) {
29+ case string: String =>
30+ fromBase58String(string)
31+ case nothing =>
32+ throw("Admin public key is empty")
33+}
34+
35+
36+let adminPubKey1 = getAdminPub(keyAdminPubKey1)
37+
38+let adminPubKey2 = getAdminPub(keyAdminPubKey2)
39+
40+let adminPubKey3 = getAdminPub(keyAdminPubKey3)
2541
2642 func getCallerShare (caller) = {
2743 let callerShare = getInteger(this, ("share_" + toString(caller)))
Full:
OldNewDifferences
11 {-# 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'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
20+let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
2121
22-let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
22+let keyAdminPubKey1 = "admin_pub_1"
2323
24-let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
24+let keyAdminPubKey2 = "admin_pub_2"
25+
26+let keyAdminPubKey3 = "admin_pub_3"
27+
28+func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) {
29+ case string: String =>
30+ fromBase58String(string)
31+ case nothing =>
32+ throw("Admin public key is empty")
33+}
34+
35+
36+let adminPubKey1 = getAdminPub(keyAdminPubKey1)
37+
38+let adminPubKey2 = getAdminPub(keyAdminPubKey2)
39+
40+let adminPubKey3 = getAdminPub(keyAdminPubKey3)
2541
2642 func getCallerShare (caller) = {
2743 let callerShare = getInteger(this, ("share_" + toString(caller)))
2844 let callerShareAmount = match callerShare {
2945 case share: Int =>
3046 share
3147 case share: Unit =>
3248 throw("Only early liquidity providers can call this function")
3349 case _ =>
3450 throw("Match error")
3551 }
3652 callerShareAmount
3753 }
3854
3955
4056 func getClaimedAmount (caller) = {
4157 let callerWithdrawn = getInteger(this, (toString(caller) + keyUserSWOPClaimedAmount))
4258 let callerWithdrawnAmount = match callerWithdrawn {
4359 case share: Int =>
4460 share
4561 case share: Unit =>
4662 0
4763 case _ =>
4864 throw("Match error")
4965 }
5066 callerWithdrawnAmount
5167 }
5268
5369
5470 @Callable(i)
5571 func claimSWOP () = {
5672 let blockDuration = (finishHeight - activateHeight)
5773 let currentDuration = if ((finishHeight > height))
5874 then height
5975 else finishHeight
6076 let userShare = getCallerShare(i.caller)
6177 let userClaimedAmount = getClaimedAmount(i.caller)
6278 let claimAmount = (fraction((currentDuration - activateHeight), userShare, blockDuration) - userClaimedAmount)
6379 let userClaimedAmountNew = (userClaimedAmount + claimAmount)
6480 [ScriptTransfer(i.caller, claimAmount, SWOP), IntegerEntry((toString(i.caller) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserSWOPLastClaimedAmount), claimAmount)]
6581 }
6682
6783
6884 @Verifier(tx)
6985 func verify () = match tx {
7086 case _ =>
7187 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
7288 then 1
7389 else 0
7490 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
7591 then 1
7692 else 0
7793 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
7894 then 1
7995 else 0
8096 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
8197 }
8298

github/deemru/w8io/169f3d6 
25.01 ms