tx · 2Qp12fZwLwVAPpCiue1oQXGCPANFKZiZy5ByGNhMsLSr 3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha: -0.09990000 Waves 2020.10.16 21:48 [1223512] smart account 3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha > SELF 0.00000000 Waves
{ "type": 13, "id": "2Qp12fZwLwVAPpCiue1oQXGCPANFKZiZy5ByGNhMsLSr", "fee": 9990000, "feeAssetId": null, "timestamp": 1602874110910, "version": 2, "chainId": 84, "sender": "3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha", "senderPublicKey": "ex6ShQCmaXZr3wDm8wGbC3EMesy4a8hsg3hoF1gqDqJ", "proofs": [ "5dDusxuHfnYAoPK5KdLqyBsvsMEtLFnE9NdkPqqevh2rLwx8LRzqhGcZ8HWGDRiyhCm51vaFC2A7iBzTtF3Swfuh" ], "script": "base64:AAIDAAAAAAAAAAsIARIAEgMKAQESAAAAAAAAAAADAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAA9Db2xsYXRlcmFsVG9rZW4BAAAAIEXAbIcI8kUexOI20CBj9o7wm7aY+dhr4NqLF5bb9v1DBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAAAAAAIJAQAAAAdleHRyYWN0AAAAAQgFAAAAA3BtdAAAAAdhc3NldElkBQAAAA9Db2xsYXRlcmFsVG9rZW4HBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJ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xlcgUAAAAGYW1vdW50BQAAAA9Db2xsYXRlcmFsVG9rZW4FAAAAA25pbAAAAAFpAQAAAAhwYXlZaWVsZAAAAAAEAAAAC0dvdmVyblRva2VuAQAAACC8BnLNTH75zY/85pKTg3cOi9DRRgrZqRPS5vvLPGg8zQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAANY3VycmVudEFtb3VudAAAAAAAAAAAAAQAAAAGYW1vdW50CQAD6wAAAAIFAAAABHRoaXMFAAAAC0dvdmVyblRva2VuAwkAAGYAAAACAAAAAAAAAAAKBQAAAAZhbW91bnQJAAACAAAAAQIAAAAhTm8gZW5vdWdoIEdvdmVyblRva2VuIEluIENvbnRyYWN0CQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQAAAAAAAAAACgUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAACgUAAAALR292ZXJuVG9rZW4FAAAAA25pbAkAAAIAAAABAgAAADxZb3UgbmVlZCB0byBkZXBvc2l0IENvbGxhdGVyYWwgVG9rZW4gdG8gcmVjZWl2ZSBHb3Zlcm4gVG9rZW4AAAAApnHi3w==", "height": 1223512, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2evVrpxvxeas8wBe8q3aDNMX5NTuxbDXcK6N4wr8BPWq Next: 7fpkbU5g8CPCG3y2TD3ZKHrGUSBG6kYgmUzpJzeBjVMn Diff:
Old | New | Differences | |
---|---|---|---|
48 | 48 | ||
49 | 49 | @Callable(i) | |
50 | 50 | func payYield () = { | |
51 | - | let GovernToken = base58' | |
51 | + | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
52 | 52 | let currentKey = toBase58String(i.caller.bytes) | |
53 | 53 | let currentAmount = match getInteger(this, currentKey) { | |
54 | 54 | case a: Int => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func deposit () = { | |
8 | 8 | let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
9 | 9 | let pmt = extract(i.payment) | |
10 | 10 | if (if (isDefined(pmt.assetId)) | |
11 | 11 | then (extract(pmt.assetId) == CollateralToken) | |
12 | 12 | else false) | |
13 | 13 | then { | |
14 | 14 | let currentKey = toBase58String(i.caller.bytes) | |
15 | 15 | let currentAmount = match getInteger(this, currentKey) { | |
16 | 16 | case a: Int => | |
17 | 17 | a | |
18 | 18 | case _ => | |
19 | 19 | 0 | |
20 | 20 | } | |
21 | 21 | let newAmount = (currentAmount + pmt.amount) | |
22 | 22 | WriteSet([DataEntry(currentKey, newAmount)]) | |
23 | 23 | } | |
24 | 24 | else throw("Can deposit only MyToken") | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Callable(i) | |
30 | 30 | func withdraw (amount) = { | |
31 | 31 | let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
32 | 32 | let currentKey = toBase58String(i.caller.bytes) | |
33 | 33 | let currentAmount = match getInteger(this, currentKey) { | |
34 | 34 | case a: Int => | |
35 | 35 | a | |
36 | 36 | case _ => | |
37 | 37 | 0 | |
38 | 38 | } | |
39 | 39 | let newAmount = (currentAmount - amount) | |
40 | 40 | if ((0 > amount)) | |
41 | 41 | then throw("Can't withdraw negative amount") | |
42 | 42 | else if ((0 > newAmount)) | |
43 | 43 | then throw("User cannot withdraw more than deposited funds") | |
44 | 44 | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, CollateralToken)])) | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(i) | |
50 | 50 | func payYield () = { | |
51 | - | let GovernToken = base58' | |
51 | + | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
52 | 52 | let currentKey = toBase58String(i.caller.bytes) | |
53 | 53 | let currentAmount = match getInteger(this, currentKey) { | |
54 | 54 | case a: Int => | |
55 | 55 | a | |
56 | 56 | case _ => | |
57 | 57 | 0 | |
58 | 58 | } | |
59 | 59 | if ((currentAmount > 0)) | |
60 | 60 | then { | |
61 | 61 | let amount = assetBalance(this, GovernToken) | |
62 | 62 | if ((10 > amount)) | |
63 | 63 | then throw("No enough GovernToken In Contract") | |
64 | 64 | else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)])) | |
65 | 65 | } | |
66 | 66 | else throw("You need to deposit Collateral Token to receive Govern Token") | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 |
github/deemru/w8io/026f985 26.85 ms ◑