tx · DDsxGpmXTDDHrdexu4MFSrK1D2QcCgFj2Mr6iFcjmq2n
3N9E2aUbiyf6wn4bSqyATFBEQFUKYy9datz: -0.01000000 Waves
2022.05.11 11:52 [2046966] smart account 3N9E2aUbiyf6wn4bSqyATFBEQFUKYy9datz > SELF 0.00000000 Waves
{
"type": 13,
"id": "DDsxGpmXTDDHrdexu4MFSrK1D2QcCgFj2Mr6iFcjmq2n",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1652269948253,
"version": 2,
"chainId": 84,
"sender": "3N9E2aUbiyf6wn4bSqyATFBEQFUKYy9datz",
"senderPublicKey": "4RUVreqGaYfi1yVRnNWAip2edczRrUTTiiZwKnd4YD3u",
"proofs": [
"4N8BGDY2qMrLsXPnDcyn2Fi7f19XUjBuajYLjqZgDdiAqmxwggmuC9Dj5wiYgByV8pSoaPe7f9C8apHFiVp2s4VA"
],
"script": "base64:AAIFAAAAAAAAAAQIAhIAAAAABAAAAAAFdG9rZW4BAAAAINtNgzVkRxuW758ML6DPfdV5nZLo4Zs1D8E/zHsCcCkLAAAAAAVscFRDSQEAAAAgDrGi2xaA6dfCrDNxIQzNNT0qFQi1YLNpLE+x9sMEwfwAAAAABGRhcHABAAAAGgFUWUAnk2tLKe6+saEO5txAuM+kjXoM67UPAAAAAAlpc1N0b3BwZWQHAAAAAQAAAAFpAQAAAAVzdGFrZQAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAJcG10QW1vdW50CAUAAAADcG10AAAABmFtb3VudAQAAAAJa2V5U3Rha2VkAgAAAAlTVEFLRURfTFADCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABXRva2VuCQAAAgAAAAECAAAAHWF0dGFjaCBVU0RUVVNETkxQIHRva2VucyBvbmx5AwUAAAAJaXNTdG9wcGVkCQAAAgAAAAECAAAAGXNtYXJ0IGNvbnRyYWN0IGlzIG9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BtvLTYiAAhfHX9KLL9Srt8eNAfd5i53
Next: Asdx7mgXzUgyBibCC86eEENaon4eA3xQ1wyVgUjoajca
Diff:
Old | New | | Differences |
---|
32 | 32 | | } |
---|
33 | 33 | | else throw("Can't find asset") |
---|
34 | 34 | | } |
---|
35 | | - | let n = (i - g) |
---|
36 | | - | let o = fraction(k, 100000000, n) |
---|
37 | | - | let p = fraction(g, o, 100000000) |
---|
38 | | - | let q = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [f]) |
---|
39 | | - | if ((q == q)) |
---|
| 35 | + | if ((i != 0)) |
---|
40 | 36 | | then { |
---|
41 | | - | let r = Reissue(b, p, true) |
---|
42 | | - | let s = ScriptTransfer(e.caller, p, b) |
---|
43 | | - | [r, s, j] |
---|
| 37 | + | let n = fraction(k, 100000000, g) |
---|
| 38 | + | let o = fraction(g, n, 100000000) |
---|
| 39 | + | let p = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [f]) |
---|
| 40 | + | if ((p == p)) |
---|
| 41 | + | then { |
---|
| 42 | + | let q = Reissue(b, o, true) |
---|
| 43 | + | let r = ScriptTransfer(e.caller, o, b) |
---|
| 44 | + | [q, r, j] |
---|
| 45 | + | } |
---|
| 46 | + | else throw("Strict value is not equal to itself.") |
---|
44 | 47 | | } |
---|
45 | | - | else throw("Strict value is not equal to itself.") |
---|
| 48 | + | else { |
---|
| 49 | + | let s = (i - g) |
---|
| 50 | + | let n = fraction(k, 100000000, s) |
---|
| 51 | + | let o = fraction(g, n, 100000000) |
---|
| 52 | + | let p = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [f]) |
---|
| 53 | + | if ((p == p)) |
---|
| 54 | + | then { |
---|
| 55 | + | let q = Reissue(b, o, true) |
---|
| 56 | + | let r = ScriptTransfer(e.caller, o, b) |
---|
| 57 | + | [q, r, j] |
---|
| 58 | + | } |
---|
| 59 | + | else throw("Strict value is not equal to itself.") |
---|
| 60 | + | } |
---|
46 | 61 | | } |
---|
47 | 62 | | else throw("Strict value is not equal to itself.") |
---|
48 | 63 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS' |
---|
5 | 5 | | |
---|
6 | 6 | | let b = base58'zMoz8KokhTvMU6GosBdAHrWfg8aCWSpP1nBigwwi63D' |
---|
7 | 7 | | |
---|
8 | 8 | | let c = base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz' |
---|
9 | 9 | | |
---|
10 | 10 | | let d = false |
---|
11 | 11 | | |
---|
12 | 12 | | @Callable(e) |
---|
13 | 13 | | func stake () = { |
---|
14 | 14 | | let f = value(e.payments[0]) |
---|
15 | 15 | | let g = f.amount |
---|
16 | 16 | | let h = "STAKED_LP" |
---|
17 | 17 | | if ((f.assetId != a)) |
---|
18 | 18 | | then throw("attach USDTUSDNLP tokens only") |
---|
19 | 19 | | else if (d) |
---|
20 | 20 | | then throw("smart contract is on lock") |
---|
21 | 21 | | else { |
---|
22 | 22 | | let i = valueOrElse(getInteger(this, h), 0) |
---|
23 | 23 | | let j = IntegerEntry(h, (i + e.payments[0].amount)) |
---|
24 | 24 | | if ((j == j)) |
---|
25 | 25 | | then { |
---|
26 | 26 | | let k = { |
---|
27 | 27 | | let l = assetInfo(b) |
---|
28 | 28 | | if ($isInstanceOf(l, "Asset")) |
---|
29 | 29 | | then { |
---|
30 | 30 | | let m = l |
---|
31 | 31 | | m.quantity |
---|
32 | 32 | | } |
---|
33 | 33 | | else throw("Can't find asset") |
---|
34 | 34 | | } |
---|
35 | | - | let n = (i - g) |
---|
36 | | - | let o = fraction(k, 100000000, n) |
---|
37 | | - | let p = fraction(g, o, 100000000) |
---|
38 | | - | let q = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [f]) |
---|
39 | | - | if ((q == q)) |
---|
| 35 | + | if ((i != 0)) |
---|
40 | 36 | | then { |
---|
41 | | - | let r = Reissue(b, p, true) |
---|
42 | | - | let s = ScriptTransfer(e.caller, p, b) |
---|
43 | | - | [r, s, j] |
---|
| 37 | + | let n = fraction(k, 100000000, g) |
---|
| 38 | + | let o = fraction(g, n, 100000000) |
---|
| 39 | + | let p = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [f]) |
---|
| 40 | + | if ((p == p)) |
---|
| 41 | + | then { |
---|
| 42 | + | let q = Reissue(b, o, true) |
---|
| 43 | + | let r = ScriptTransfer(e.caller, o, b) |
---|
| 44 | + | [q, r, j] |
---|
| 45 | + | } |
---|
| 46 | + | else throw("Strict value is not equal to itself.") |
---|
44 | 47 | | } |
---|
45 | | - | else throw("Strict value is not equal to itself.") |
---|
| 48 | + | else { |
---|
| 49 | + | let s = (i - g) |
---|
| 50 | + | let n = fraction(k, 100000000, s) |
---|
| 51 | + | let o = fraction(g, n, 100000000) |
---|
| 52 | + | let p = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [f]) |
---|
| 53 | + | if ((p == p)) |
---|
| 54 | + | then { |
---|
| 55 | + | let q = Reissue(b, o, true) |
---|
| 56 | + | let r = ScriptTransfer(e.caller, o, b) |
---|
| 57 | + | [q, r, j] |
---|
| 58 | + | } |
---|
| 59 | + | else throw("Strict value is not equal to itself.") |
---|
| 60 | + | } |
---|
46 | 61 | | } |
---|
47 | 62 | | else throw("Strict value is not equal to itself.") |
---|
48 | 63 | | } |
---|
49 | 64 | | } |
---|
50 | 65 | | |
---|
51 | 66 | | |
---|