2021.12.06 01:36 [2886532] smart account 3P984CrEYKGfoBLdwRFiNE2j3gFoYA1cvYp > SELF 0.00000000 Waves

{ "type": 13, "id": "GuqqU8iZRh4mkdRGdYXCteRVBCYb7RMeJHVyGquNKvA5", "fee": 1000000, "feeAssetId": null, "timestamp": 1638743860279, "version": 2, "chainId": 87, "sender": "3P984CrEYKGfoBLdwRFiNE2j3gFoYA1cvYp", "senderPublicKey": "9mKotRjaeDuiRhrXqMg55Uh1V1WzwG4kDaAcE7HGzh43", "proofs": [ "29dbh2KL4cZjda9Fiw4jnQ8JN6ffCE3bCyoLqgEhufox8aDaxRVgb4xidrMLkTRHZ1a8GsrwDXNCfgrhysrC6adc" ], "script": "base64:AAIFAAAAAAAAAAIIAgAAAAAAAAAAAAAAAPjY3s4=", "height": 2886532, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G7VYmRPcU7DdPVPAbAmzyZxr2NZWg1NiZ3569ikEBDpH Next: H21k4we4mos3TQZ4jfFfVTMZyseJQyHajvbj6rRuL8bY Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
54
6-let NEUTRINO = base58'3PNikM6yp4NqcSU8guxQtmR5onr2D4e8yTJ'
7-
8-@Callable(i)
9-func stakeUSDN (amount) = {
10- let USDNBalance = assetBalance(this, USDN)
11- if (!((USDNBalance > amount)))
12- then throw("exceeds the available amount")
13- else {
14- let result = invoke(Address(NEUTRINO), "lockNeutrino", nil, [AttachedPayment(USDN, amount)])
15- if ((result == result))
16- then {
17- let stakedUSDN = valueOrElse(getInteger(this, "staked_usdn_amount"), 0)
18- let totalStakedUSDN = (stakedUSDN + amount)
19- $Tuple2([IntegerEntry("staked_usdn_amount", totalStakedUSDN)], unit)
20- }
21- else throw("Strict value is not equal to itself.")
22- }
23- }
24-
25-
26-
27-@Callable(i)
28-func unstakeUSDN () = {
29- let totalStakedUSDN = getIntegerValue(this, "staked_usdn_amount")
30- let totalStakedUSDNNeutrino = getIntegerValue(Address(NEUTRINO), ("rpd_balance_DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p_" + toString(this)))
31- if (!((totalStakedUSDN == totalStakedUSDNNeutrino)))
32- then throw("amounts are not matching, check it!!!")
33- else {
34- let result = invoke(Address(NEUTRINO), "unlockNeutrino", [totalStakedUSDN, "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p"], nil)
35- if ((result == result))
36- then $Tuple2([BooleanEntry("unstaked_usdn", true), IntegerEntry("unstaked_usdn_amount", totalStakedUSDN), IntegerEntry("staked_usdn_amount", 0)], unit)
37- else throw("Strict value is not equal to itself.")
38- }
39- }
40-
41-
42-
43-@Callable(i)
44-func stakeWaves (amount) = {
45- let availableWavesBalance = wavesBalance(this).available
46- if (!(((availableWavesBalance - 200000000) >= amount)))
47- then throw("not enough waves amount to lease")
48- else {
49- let LeaseAction = Lease(Address(base58'3P9DEDP5VbyXQyKtXDUt2crRPn5B7gs6ujc'), amount)
50- let leaseId = calculateLeaseId(LeaseAction)
51- let leasedAmount = valueOrElse(getInteger(this, "leased_amount"), 0)
52- let totalLeasedAmount = (leasedAmount + amount)
53- $Tuple2([LeaseAction, IntegerEntry("leased_amount", totalLeasedAmount), BinaryEntry("leasing_id", leaseId)], unit)
54- }
55- }
56-
57-
58-
59-@Callable(i)
60-func unstakeWaves () = {
61- let leaseid = getBinaryValue(this, "leasing_id")
62- $Tuple2([DeleteEntry("staked_usdn_amount"), DeleteEntry("unstaked_usdn"), DeleteEntry("unstaked_usdn_amount"), LeaseCancel(leaseid)], unit)
63- }
64-
65-
66-
67-@Callable(i)
68-func sendit () = if ((toString(i.caller) != "3PJVLNCkc7ChN4ADTTwDzGWyCXgVNuF124s"))
69- then throw("not that")
70- else $Tuple2([ScriptTransfer(i.caller, 1000, base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p')], unit)
715
726

github/deemru/w8io/786bc32 
26.23 ms