tx · 6mqZzafti4HwK2FEpzoXkeGy9Ud7cmXLNqrG86w17ha3

3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS:  -0.01000000 Waves

2023.09.29 16:16 [2776764] smart account 3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS > SELF 0.00000000 Waves

{ "type": 13, "id": "6mqZzafti4HwK2FEpzoXkeGy9Ud7cmXLNqrG86w17ha3", "fee": 1000000, "feeAssetId": null, "timestamp": 1695993418435, "version": 2, "chainId": 84, "sender": "3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS", "senderPublicKey": "CMMtdSwXAf6tvNvyJDrdC5VGmRkcXU5CqmsapxKNPhLu", "proofs": [ "5dGmi19TAdp6b6iqETVjTXzuHfFdF3JXD8rV9hgiqeX1qCTJDKs1bn7uTaabkRSWD1hrHQ59XpgkmMvHH8G5NUxa" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIBAQAAAAYAAAAAEXRvdGFsVG9rZW5zQW1vdW50AAABxr9SY0AAAAAAAB9iYXNlVG9rZW5Db3VudEZvck9uZVJld2FyZFRva2VuAAAAAAAAmJaAAAAAAAVNVUxUOAAAAAAABfXhAAAAAAAVY3VycmVudFRva2Vuc0dpdmVkS2V5AgAAABRjdXJyZW50X3Rva2Vuc19naXZlZAEAAAAOY2FsY3VsYXRlS29lZmYAAAABAAAAEmN1cnJlbnRUb2tlbnNHaXZlZAMJAAAAAAAAAgUAAAASY3VycmVudFRva2Vuc0dpdmVkAAAAAAAAAAAABQAAAAVNVUxUOAkAAGUAAAACBQAAAAVNVUxUOAkAAGsAAAADBQAAABJjdXJyZW50VG9rZW5zR2l2ZWQFAAAABU1VTFQ4BQAAABF0b3RhbFRva2Vuc0Ftb3VudAEAAAASY2FsY3VsYXRlU0JUQW1vdW50AAAAAgAAABByZXdhcmRUb2tlbkNvdW50AAAAFWN1cnJlbnRTYnRUb2tlbnNHaXZlZAQAAAAUc2J0UGVyT25lUmV3YXJkVG9rZW4JAABrAAAAAwUAAAAfYmFzZVRva2VuQ291bnRGb3JPbmVSZXdhcmRUb2tlbgkBAAAADmNhbGN1bGF0ZUtvZWZmAAAAAQUAAAAVY3VycmVudFNidFRva2Vuc0dpdmVkBQAAAAVNVUxUOAkAAGsAAAADBQAAABRzYnRQZXJPbmVSZXdhcmRUb2tlbgUAAAAQcmV3YXJkVG9rZW5Db3VudAUAAAAFTVVMVDgAAAABAAAAAWkBAAAACWNhbGN1bGF0ZQAAAAIAAAAQcmV3YXJkVG9rZW5Db3VudAAAABVjdXJyZW50U2J0VG9rZW5zR2l2ZWQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAABnJlc3VsdAkBAAAAEmNhbGN1bGF0ZVNCVEFtb3VudAAAAAIFAAAAEHJld2FyZFRva2VuQ291bnQFAAAAFWN1cnJlbnRTYnRUb2tlbnNHaXZlZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnUtV3N", "height": 2776764, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: PPPqBKPWSyaeHr8hRciFUiDAMGP9jZPRn8jf5twyoQY Next: FtsnacRqpiawrdHdKnq21M7nDFskb7CVNJJHorTJhvhh Diff:
OldNewDifferences
1616
1717 func calculateSBTAmount (rewardTokenCount,currentSbtTokensGived) = {
1818 let sbtPerOneRewardToken = fraction(baseTokenCountForOneRewardToken, calculateKoeff(currentSbtTokensGived), MULT8)
19- (sbtPerOneRewardToken * rewardTokenCount)
19+ fraction(sbtPerOneRewardToken, rewardTokenCount, MULT8)
2020 }
2121
2222
2323 @Callable(i)
24-func calculate (rewardTokenCount,currentSbtTokensGived) = {
25- let currentTokensGived = valueOrElse(getInteger(currentTokensGivedKey), 0)
26-[IntegerEntry("result", calculateSBTAmount(rewardTokenCount, currentSbtTokensGived))]
27- }
24+func calculate (rewardTokenCount,currentSbtTokensGived) = [IntegerEntry("result", calculateSBTAmount(rewardTokenCount, currentSbtTokensGived))]
2825
2926
3027 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let totalTokensAmount = 500000000000000
55
66 let baseTokenCountForOneRewardToken = 10000000
77
88 let MULT8 = 100000000
99
1010 let currentTokensGivedKey = "current_tokens_gived"
1111
1212 func calculateKoeff (currentTokensGived) = if ((currentTokensGived == 0))
1313 then MULT8
1414 else (MULT8 - fraction(currentTokensGived, MULT8, totalTokensAmount))
1515
1616
1717 func calculateSBTAmount (rewardTokenCount,currentSbtTokensGived) = {
1818 let sbtPerOneRewardToken = fraction(baseTokenCountForOneRewardToken, calculateKoeff(currentSbtTokensGived), MULT8)
19- (sbtPerOneRewardToken * rewardTokenCount)
19+ fraction(sbtPerOneRewardToken, rewardTokenCount, MULT8)
2020 }
2121
2222
2323 @Callable(i)
24-func calculate (rewardTokenCount,currentSbtTokensGived) = {
25- let currentTokensGived = valueOrElse(getInteger(currentTokensGivedKey), 0)
26-[IntegerEntry("result", calculateSBTAmount(rewardTokenCount, currentSbtTokensGived))]
27- }
24+func calculate (rewardTokenCount,currentSbtTokensGived) = [IntegerEntry("result", calculateSBTAmount(rewardTokenCount, currentSbtTokensGived))]
2825
2926
3027 @Verifier(tx)
3128 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
3229

github/deemru/w8io/169f3d6 
28.12 ms