tx · HxiTscvZdKWKreKhF6oqun29jxg41dEuXaCdSWavho5o

3MpQMfcqygL5TqY51peDk3tD4YC35ZtLHDR:  -0.00400000 Waves

2024.04.28 22:50 [3083150] smart account 3MpQMfcqygL5TqY51peDk3tD4YC35ZtLHDR > SELF 0.00000000 Waves

{ "type": 13, "id": "HxiTscvZdKWKreKhF6oqun29jxg41dEuXaCdSWavho5o", "fee": 400000, "feeAssetId": null, "timestamp": 1714333855532, "version": 1, "sender": "3MpQMfcqygL5TqY51peDk3tD4YC35ZtLHDR", "senderPublicKey": "6gZhJH4ky42qJRCmfh8c56C2eeKTB5MRzEKsSZToBtYT", "proofs": [ "4Fs6dQSeH4iR1pmcwfvxhG9QcNTJ2jhZEq3CPPa1UK3srY79s5iHnTFhXHbvSNNidzHrK3nMLW6M8YdMvCu36M5n" ], "script": "base64:BgINCAISABIDCgEIEgASAAkABnVzZG5JZAEgD/IcEqzkxDya7EYaqyWosOy6BytGzG2IcvC14pJJAbQACXVzZG5JZFN0cgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQACHB1enpsZUlkASBUIP2ahsY3H5qgvXhIyN9J/Le53Mzn5csGOcF0H4nk2wAFU2NhbGUAgKCUpY0dAQ10cnlHZXRJbnRlZ2VyAQNrZXkEByRtYXRjaDAJAJoIAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQBYgUHJG1hdGNoMAUBYgAAAQx0cnlHZXRTdHJpbmcBA2tleQQHJG1hdGNoMAkAnQgCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFhBQckbWF0Y2gwBQFhAgABEGNsYWltQWxpYXNSZXN1bHQCB2FkZHJlc3MKYXNzZXRJZFN0cgQKYWRkcmVzc1N0cgkApQgBBQdhZGRyZXNzBA9jdXJyZW50SW50ZXJlc3QJAQ10cnlHZXRJbnRlZ2VyAQkArAICCQCsAgICEWdsb2JhbF9sYXN0Q2hl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0cgIJX2Vhcm5pbmdzCQBkAgkBDXRyeUdldEludGVnZXIBCQCsAgIJAKwCAgIHZ2xvYmFsXwUKYXNzZXRJZFN0cgIJX2Vhcm5pbmdzBQZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICAhFnbG9iYWxfbGFzdENoZWNrXwUKYXNzZXRJZFN0cgIJX2ludGVyZXN0CQBkAgUPY3VycmVudEludGVyZXN0BQ1pbnRlcmVzdERlbHRhBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5UPw7/w==", "chainId": 84, "height": 3083150, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 92votuufkWPrPiLdRsmxfSoyeQ2pDX8GxRemzA5mM2sH Next: none Diff:
OldNewDifferences
55
66 let usdnIdStr = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"
77
8-let puzzleId = base58'HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS'
8+let puzzleId = base58'6fQRaL3L25nGqevXT8kxwjBS28fkBErrJ69JYcj7qKgW'
99
1010 let Scale = 1000000000000
1111
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let usdnId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
55
66 let usdnIdStr = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"
77
8-let puzzleId = base58'HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS'
8+let puzzleId = base58'6fQRaL3L25nGqevXT8kxwjBS28fkBErrJ69JYcj7qKgW'
99
1010 let Scale = 1000000000000
1111
1212 func tryGetInteger (key) = match getInteger(this, key) {
1313 case b: Int =>
1414 b
1515 case _ =>
1616 0
1717 }
1818
1919
2020 func tryGetString (key) = match getString(this, key) {
2121 case a: String =>
2222 a
2323 case _ =>
2424 ""
2525 }
2626
2727
2828 func claimAliasResult (address,assetIdStr) = {
2929 let addressStr = toString(address)
3030 let currentInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest"))
3131 let lastCheckInterest = tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"))
3232 let stakedAmount = if ((assetIdStr == usdnIdStr))
3333 then tryGetInteger((addressStr + "_staked"))
3434 else tryGetInteger((((addressStr + "_") + assetIdStr) + "_staked"))
3535 let reward = if ((lastCheckInterest > 0))
3636 then fraction((currentInterest - lastCheckInterest), stakedAmount, Scale)
3737 else 0
3838 [IntegerEntry((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"), currentInterest), IntegerEntry((((addressStr + "_") + assetIdStr) + "_claimed"), (tryGetInteger((((addressStr + "_") + assetIdStr) + "_claimed")) + reward)), ScriptTransfer(address, reward, usdnId)]
3939 }
4040
4141
4242 func claimResult (address) = claimAliasResult(address, usdnIdStr)
4343
4444
4545 func checkNFTValidity (assetId) = match getString(Address(base58'3N9yxp4gyTCsEtPUzE7CFLnae4YwqRgwUkW'), (("art_" + toBase58String(assetId)) + "_type")) {
4646 case x: String =>
4747 5
4848 case _ =>
4949 if ((getString(Address(base58'3N7CE8qNvnNNzk1pCxFJ4S8LA4sTyWakczC'), (("nft_" + toBase58String(assetId)) + "_issuer")) == "3N7G3XELPvHrkSrTLzbWQwAxPLcEUhNnsht"))
5050 then 1
5151 else 0
5252 }
5353
5454
5555 @Callable(i)
5656 func stake () = {
5757 let addressStr = toString(i.caller)
5858 let nftId = if ((i.payments[0].amount == 1))
5959 then value(i.payments[0].assetId)
6060 else throw("please attach NFT")
6161 let assetIdStr = toBase58String(usdnId)
6262 let currentInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest"))
6363 let totalStakedAmount = tryGetInteger("global_staked")
6464 let assetPower = fraction(10000, checkNFTValidity(nftId), 5)
6565 let NFTName = if ((assetPower == 10000))
6666 then "Eagle NFT"
6767 else "Ania NFT"
6868 if ((assetPower == 0))
6969 then throw("not valid NFT attached")
7070 else (claimResult(i.caller) ++ [IntegerEntry("global_staked", (totalStakedAmount + assetPower)), IntegerEntry((addressStr + "_staked"), (tryGetInteger((addressStr + "_staked")) + assetPower)), StringEntry((toBase58String(nftId) + "_owner"), addressStr), IntegerEntry(((("address_" + toString(i.caller)) + "_nft_") + toBase58String(nftId)), lastBlock.timestamp), StringEntry((toBase58String(nftId) + "_name"), NFTName)])
7171 }
7272
7373
7474
7575 @Callable(i)
7676 func unStake (nftIdStr) = {
7777 let assetPower = fraction(10000, checkNFTValidity(fromBase58String(nftIdStr)), 5)
7878 let addressStr = toString(i.caller)
7979 let stakedAmount = tryGetInteger((addressStr + "_staked"))
8080 let nftOwner = tryGetString((nftIdStr + "_owner"))
8181 if ((addressStr != nftOwner))
8282 then throw("you don't have NFT available")
8383 else (claimResult(i.caller) ++ [IntegerEntry((addressStr + "_staked"), (stakedAmount - assetPower)), IntegerEntry("global_staked", (tryGetInteger("global_staked") - assetPower)), ScriptTransfer(i.caller, 1, fromBase58String(nftIdStr)), DeleteEntry((nftIdStr + "_owner")), DeleteEntry(((("address_" + toString(i.caller)) + "_nft_") + nftIdStr))])
8484 }
8585
8686
8787
8888 @Callable(i)
8989 func claimReward () = claimResult(i.caller)
9090
9191
9292
9393 @Callable(i)
9494 func topUpReward () = {
9595 let amount = i.payments[0].amount
9696 let assetIdStr = usdnIdStr
9797 let currentInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest"))
9898 let totalStakedAmount = tryGetInteger("global_staked")
9999 let interestDelta = if ((totalStakedAmount > 0))
100100 then fraction(amount, Scale, totalStakedAmount)
101101 else 0
102102 let currentUltraInterest = tryGetInteger("global_lastCheck_ultra_interest")
103103 let totalUltraStakedAmount = tryGetInteger("global_ultra_staked")
104104 let ultraInterestDelta = if ((totalStakedAmount > 0))
105105 then fraction(amount, Scale, totalStakedAmount)
106106 else 0
107107 if ((i.payments[0].assetId != usdnId))
108108 then throw("wrong asset attached")
109109 else [IntegerEntry((("global_" + assetIdStr) + "_earnings"), (tryGetInteger((("global_" + assetIdStr) + "_earnings")) + amount)), IntegerEntry((("global_lastCheck_" + assetIdStr) + "_interest"), (currentInterest + interestDelta))]
110110 }
111111
112112
113113 @Verifier(tx)
114114 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
115115

github/deemru/w8io/026f985 
26.25 ms