tx · F7q6VDXsJdmLz5PEwss27dK14xz9FWgWg2ZvyhzNc79m 3N313C4z4RbEC616WHLeVRpGQkoxaGWrdtM: -0.01000000 Waves 2019.08.14 09:35 [630387] smart account 3N313C4z4RbEC616WHLeVRpGQkoxaGWrdtM > SELF 0.00000000 Waves
{ "type": 13, "id": "F7q6VDXsJdmLz5PEwss27dK14xz9FWgWg2ZvyhzNc79m", "fee": 1000000, "feeAssetId": null, "timestamp": 1565764500388, "version": 1, "sender": "3N313C4z4RbEC616WHLeVRpGQkoxaGWrdtM", "senderPublicKey": "AWzwkpZ5dYGDGavkFVy562SJPRsa9koEzroPmPk9EYzh", "proofs": [ "2g6cpoH3gPoBvcuhyAtM2JrEJx3M2oyyxD4B788gbkAXfeMG5nXbWVymrjSW3tzXYgsrss4aZLepyZEGBGsBYXwV" ], "script": "base64:AAIDAAAAAAAAAAAAAAAeAAAAAAxkZXBvc2l0VG9rZW4FAAAABHVuaXQAAAAADW9yYWNsZURhdGFLZXkCAAAAC3dhdmVzX2J0Y184AAAAAA5ncmFjZVBlcmlvZEtleQIAAAALZ3JhY2VQZXJpb2QAAAAAEWludGVyZXN0UGVyaW9kS2V5AgAAAA5pbnRlcmVzdFBlcmlvZAAAAAAJb3JhY2xlS2V5AgAAAAZvcmFjbGUAAAAAFWRpc2NvdW50UGVyY2VudGlsZUtleQIAAAASZGlzY291bnRQZXJjZW50aWxlAAAAAAptYXhSYXRlS2V5AgAAAAdtYXhSYXRlAAAAAA1hc3NldFRva2VuS2V5AgAAAAphc3NldFRva2VuAAAAAAhvd25lcktleQIAAAAFb3duZXIBAAAAB3N0YXJ0T2YAAAABAAAABnJlbnRlcgkAASwAAAACAgAAAAlzdGFydF9vZl8FAAAABnJlbnRlcgEAAAAMZW5kT2ZHcmFjZU9mAAAAAQAAAAZyZW50ZXIJAAEsAAAAAgIAAAAQZW5kX29mX2dyYWNlX29mXwUAAAAGcmVudGVyAQAAAA1lbmRPZkZyZWV6ZU9mAAAAAQAAAAZy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XIgY2FuIGNsb3NlIGV4cGlyZWQgcmVudCBvZiBhIHVzZXIDCQEAAAABIQAAAAEFAAAAC2xvYW5FeHBpcmVkCQAAAgAAAAEJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAN093bmVyIGNhbiBvbmx5IGNsb3NlIGV4cGlyZWQgcmVudHMuIEV4cGlyaW5nIG9uIGhlaWdodCAJAAGkAAAAAQUAAAAMZXhwaXJ5SGVpZ2h0AgAAABAsIGN1cnJlbnQgaGVpZ2h0CQABpAAAAAEFAAAABmhlaWdodAkBAAAADGNsb3NlRXhwaXJlZAAAAAEFAAAAB2FkZHJlc3MAAAABaQEAAAAHZGlzY2FyZAAAAAAEAAAAB2FkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkBAAAADGNsb3NlRXhwaXJlZAAAAAEFAAAAB2FkZHJlc3MAAAABaQEAAAAId2l0aGRyYXcAAAABAAAABmFtb3VudAMJAAAAAAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAVvd25lcgkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAVvd25lcgUAAAAGYW1vdW50BQAAAAphc3NldFRva2VuBQAAAANuaWwJAAACAAAAAQIAAAAcb25seSBvd25lciBjYW4gd2l0aGRyYXcgV0JUQwAAAACB7Dio", "chainId": 84, "height": 630387, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let depositToken = unit | |
5 | + | ||
6 | + | let oracleDataKey = "waves_btc_8" | |
7 | + | ||
8 | + | let gracePeriodKey = "gracePeriod" | |
9 | + | ||
10 | + | let interestPeriodKey = "interestPeriod" | |
11 | + | ||
12 | + | let oracleKey = "oracle" | |
13 | + | ||
14 | + | let discountPercentileKey = "discountPercentile" | |
15 | + | ||
16 | + | let maxRateKey = "maxRate" | |
17 | + | ||
18 | + | let assetTokenKey = "assetToken" | |
19 | + | ||
20 | + | let ownerKey = "owner" | |
21 | + | ||
22 | + | func startOf (renter) = ("start_of_" + renter) | |
23 | + | ||
24 | + | ||
25 | + | func endOfGraceOf (renter) = ("end_of_grace_of_" + renter) | |
26 | + | ||
27 | + | ||
28 | + | func endOfFreezeOf (renter) = ("end_of_freeze_of_" + renter) | |
29 | + | ||
30 | + | ||
31 | + | func rateOf (renter) = ("rate_of_" + renter) | |
32 | + | ||
33 | + | ||
34 | + | func depositOf (renter) = ("deposit_of_" + renter) | |
35 | + | ||
36 | + | ||
37 | + | func lendAmount (renter) = ("lend_of_" + renter) | |
38 | + | ||
39 | + | ||
40 | + | func registeredTx (txId) = ("registered_return_of_" + txId) | |
41 | + | ||
42 | + | ||
43 | + | let owner = addressFromStringValue(value(getString(this, ownerKey))) | |
44 | + | ||
45 | + | let assetToken = fromBase58String(value(getString(this, assetTokenKey))) | |
46 | + | ||
47 | + | let gracePeriod = value(getInteger(this, gracePeriodKey)) | |
48 | + | ||
49 | + | let interestPeriod = value(getInteger(this, interestPeriodKey)) | |
50 | + | ||
51 | + | let maxRate = value(getInteger(this, maxRateKey)) | |
52 | + | ||
53 | + | let oracle = value(getString(this, oracleKey)) | |
54 | + | ||
55 | + | let oracleValue = value(getInteger(value(addressFromString(oracle)), oracleDataKey)) | |
56 | + | ||
57 | + | let discountPercentile = value(getInteger(this, discountPercentileKey)) | |
58 | + | ||
59 | + | let rate = if ((maxRate >= oracleValue)) | |
60 | + | then oracleValue | |
61 | + | else throw(((("Suspicious rate value: actual: " + toString(oracleValue)) + ", max: ") + toString(maxRate))) | |
62 | + | ||
63 | + | let initialized = isDefined(getString(this, assetTokenKey)) | |
64 | + | ||
65 | + | func isLendOpen (renter) = match getInteger(this, startOf(renter)) { | |
66 | + | case s: Int => | |
67 | + | (s > 0) | |
68 | + | case _ => | |
69 | + | false | |
70 | + | } | |
71 | + | ||
72 | + | ||
73 | + | func closing (renter) = WriteSet([DataEntry(startOf(renter), 0), DataEntry(endOfGraceOf(renter), 0), DataEntry(endOfFreezeOf(renter), 0), DataEntry(rateOf(renter), 0), DataEntry(depositOf(renter), 0), DataEntry(lendAmount(renter), 0)]) | |
74 | + | ||
75 | + | ||
76 | + | func closeExpired (address) = { | |
77 | + | let loanSize = value(getInteger(this, depositOf(address))) | |
78 | + | ScriptResult(closing(address), TransferSet([ScriptTransfer(owner, loanSize, depositToken)])) | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | func doBB (renter,returnAssetId,returnAmt) = { | |
83 | + | let renterStr = toString(renter) | |
84 | + | let hasOpenLoan = isLendOpen(renterStr) | |
85 | + | let isTokenCorrect = (returnAssetId == assetToken) | |
86 | + | let loanAmount = getIntegerValue(this, lendAmount(renterStr)) | |
87 | + | let isAmountCorrect = (loanAmount == returnAmt) | |
88 | + | let depositedValue = getIntegerValue(this, depositOf(renterStr)) | |
89 | + | if (!(hasOpenLoan)) | |
90 | + | then throw("No open loan for caller") | |
91 | + | else if (!(isTokenCorrect)) | |
92 | + | then throw(((("User must return WBTC: " + toBase58String(assetToken)) + " but returning: ") + toBase58String(returnAssetId))) | |
93 | + | else if (!(isAmountCorrect)) | |
94 | + | then throw(((("User must return " + toString(loanAmount)) + " WBTC, but returning ") + toString(returnAmt))) | |
95 | + | else { | |
96 | + | let graceHeight = getIntegerValue(this, endOfGraceOf(renterStr)) | |
97 | + | let expirationHeight = getIntegerValue(this, endOfFreezeOf(renterStr)) | |
98 | + | let canReturnFullAmount = (graceHeight >= height) | |
99 | + | let returnAmount = if (canReturnFullAmount) | |
100 | + | then depositedValue | |
101 | + | else if ((height > expirationHeight)) | |
102 | + | then throw("your loan has expired") | |
103 | + | else fraction(depositedValue, (expirationHeight - height), (expirationHeight - graceHeight)) | |
104 | + | let theRestOfAmount = (depositedValue - returnAmount) | |
105 | + | ScriptResult(closing(renterStr), TransferSet([ScriptTransfer(renter, returnAmount, depositToken), ScriptTransfer(owner, theRestOfAmount, depositToken)])) | |
106 | + | } | |
107 | + | } | |
108 | + | ||
109 | + | ||
110 | + | @Callable(i) | |
111 | + | func init (owner,token,oracle,maxRate,discount,grace,interest) = if ((i.caller == this)) | |
112 | + | then WriteSet([DataEntry(ownerKey, owner), DataEntry(discountPercentileKey, discount), DataEntry(assetTokenKey, token), DataEntry(oracleKey, oracle), DataEntry(maxRateKey, maxRate), DataEntry(gracePeriodKey, grace), DataEntry(interestPeriodKey, interest)]) | |
113 | + | else throw("only dapp itself can init") | |
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | @Callable(i) | |
118 | + | func updateParams (oracle,maxRate,discount,grace,interest) = if ((i.caller == owner)) | |
119 | + | then WriteSet([DataEntry(oracleKey, oracle), DataEntry(maxRateKey, maxRate), DataEntry(discountPercentileKey, discount), DataEntry(gracePeriodKey, grace), DataEntry(interestPeriodKey, interest)]) | |
120 | + | else throw("only contract owner can update params") | |
121 | + | ||
122 | + | ||
123 | + | ||
124 | + | @Callable(i) | |
125 | + | func borrow () = { | |
126 | + | let renter = toBase58String(i.caller.bytes) | |
127 | + | if (isLendOpen(renter)) | |
128 | + | then throw((renter + " already has an open loan")) | |
129 | + | else match i.payment { | |
130 | + | case a: AttachedPayment => | |
131 | + | if ((a.assetId == depositToken)) | |
132 | + | then { | |
133 | + | let currentHeight = height | |
134 | + | let graceHeight = (height + gracePeriod) | |
135 | + | let expirationHeight = (graceHeight + interestPeriod) | |
136 | + | let depositAmount = a.amount | |
137 | + | let assetTokensLent = fraction((a.amount / rate), discountPercentile, 100) | |
138 | + | let datas = WriteSet([DataEntry(startOf(renter), currentHeight), DataEntry(endOfGraceOf(renter), graceHeight), DataEntry(endOfFreezeOf(renter), expirationHeight), DataEntry(rateOf(renter), fraction(rate, 100, discountPercentile)), DataEntry(depositOf(renter), depositAmount), DataEntry(lendAmount(renter), assetTokensLent)]) | |
139 | + | ScriptResult(datas, TransferSet([ScriptTransfer(i.caller, assetTokensLent, assetToken)])) | |
140 | + | } | |
141 | + | else throw(("can only lend WBTC for WAVES, but got " + toBase58String(value(a.assetId)))) | |
142 | + | case _ => | |
143 | + | throw("payment in assetTokens must be attached") | |
144 | + | } | |
145 | + | } | |
146 | + | ||
147 | + | ||
148 | + | ||
149 | + | @Callable(i) | |
150 | + | func restoreBuyBack (txId) = match transferTransactionById(fromBase58String(txId)) { | |
151 | + | case t: TransferTransaction => | |
152 | + | match getBoolean(this, registeredTx(txId)) { | |
153 | + | case b: Boolean => | |
154 | + | throw((("Tx id " + txId) + " has already been registered")) | |
155 | + | case _ => | |
156 | + | if ((t.recipient != this)) | |
157 | + | then throw("Can only register payments for this dapp address") | |
158 | + | else { | |
159 | + | let sr = doBB(t.sender, value(t.assetId), t.amount) | |
160 | + | ScriptResult(WriteSet([DataEntry(registeredTx(txId), true), sr.writeSet.data]), sr.transferSet) | |
161 | + | } | |
162 | + | } | |
163 | + | case _: Unit => | |
164 | + | throw("Transaction doesn't exist") | |
165 | + | case _ => | |
166 | + | throw() | |
167 | + | } | |
168 | + | ||
169 | + | ||
170 | + | ||
171 | + | @Callable(i) | |
172 | + | func buyBack () = doBB(i.caller, value(value(i.payment).assetId), value(i.payment).amount) | |
173 | + | ||
174 | + | ||
175 | + | ||
176 | + | @Callable(i) | |
177 | + | func closeExpiredFor (address) = { | |
178 | + | let expiryHeight = value(getInteger(this, endOfFreezeOf(address))) | |
179 | + | let loanExpired = (height > expiryHeight) | |
180 | + | let ownerCall = (i.caller == owner) | |
181 | + | if (!(ownerCall)) | |
182 | + | then throw("Only owner can close expired rent of a user") | |
183 | + | else if (!(loanExpired)) | |
184 | + | then throw(((("Owner can only close expired rents. Expiring on height " + toString(expiryHeight)) + ", current height") + toString(height))) | |
185 | + | else closeExpired(address) | |
186 | + | } | |
187 | + | ||
188 | + | ||
189 | + | ||
190 | + | @Callable(i) | |
191 | + | func discard () = { | |
192 | + | let address = toBase58String(i.caller.bytes) | |
193 | + | closeExpired(address) | |
194 | + | } | |
195 | + | ||
196 | + | ||
197 | + | ||
198 | + | @Callable(i) | |
199 | + | func withdraw (amount) = if ((i.caller == owner)) | |
200 | + | then TransferSet([ScriptTransfer(owner, amount, assetToken)]) | |
201 | + | else throw("only owner can withdraw WBTC") | |
202 | + | ||
203 | + |
github/deemru/w8io/026f985 34.93 ms ◑