tx · G8rXyivHFiyBJ7BgnrrUQ23P1hjdkn1HDxoBQ7LxM2Ww 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU: -0.04000000 Waves 2021.09.01 23:39 [1684456] smart account 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU > SELF 0.00000000 Waves
{ "type": 13, "id": "G8rXyivHFiyBJ7BgnrrUQ23P1hjdkn1HDxoBQ7LxM2Ww", "fee": 4000000, "feeAssetId": null, "timestamp": 1630528791988, "version": 2, "chainId": 84, "sender": "3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU", "senderPublicKey": "EhGswdVQkp8SXCWyKvRCUKYDidTrRjnzTPa8CZk6GYgN", "proofs": [ "5f9bG6j8bwvY3Cpe8jbqoYzUHmTHhdtj6jHmWateFSCgzv9PWErkuuqmkPm1u16gPNNwa6AmPZN6yFJvEX74NoJ1" ], "script": "base64:AAIFAAAAAAAAABUIAhIECgIIBBIGCgQICAgIEgMKAQgAAAAnAAAAAApiYXNlRmFjdG9yAAAAAAAAAAPoAAAAAAliYXNlSW5kZXgAACOG8m/BAAAAAAAADWJsb2Nrc1BlclllYXIAAAAAAAAIBSAAAAAABmNvbmZpZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA1jb25maWdBZGRyZXNzAgAAAAAAAAAABWFkbWluCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAAFYWRtaW4CAAAAAAAAAAALd2F2ZXRyb2xsZXIJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAt3YXZldHJvbGxlcgIAAAAAAAAAAAphc3NldElkU3ViCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAAHY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AAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAADa2V5BQAAAANuaWwJAAACAAAAAQIAAAAXQ2FsbGVyIGlzIG5vdCBhbiBhZG1pbiEAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tledLHavQ=", "height": 1684456, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FY3LcmAJKzwe7hV8UHrTfZiPCjpbidDsowYP3xJ7LTK8 Next: 2EybzTBaxU1BEA75NcGobNMj8umFXjPX6A8FmZVDxbRz Diff:
Old | New | Differences | |
---|---|---|---|
53 | 53 | else false | |
54 | 54 | ||
55 | 55 | ||
56 | + | func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub)) | |
57 | + | then true | |
58 | + | else false | |
59 | + | ||
60 | + | ||
56 | 61 | func writeString (key,stringValue) = StringEntry(key, stringValue) | |
57 | 62 | ||
58 | 63 | ||
59 | 64 | func writeInteger (key,integerValue) = IntegerEntry(key, integerValue) | |
60 | 65 | ||
61 | 66 | ||
62 | - | func | |
67 | + | func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0) | |
63 | 68 | ||
64 | 69 | ||
65 | 70 | let utilization = if ((totalSupply > 0)) | |
110 | 115 | then { | |
111 | 116 | let userTokenAmount = calcTokenAmount(i.payments[0].amount) | |
112 | 117 | let currentDTokenSupply = (dTokenSupply + userTokenAmount) | |
113 | - | let userBalance = (userTokenBalance(user) + userTokenAmount) | |
114 | - | $Tuple2([Reissue(fromBase58String(dTokenId), userTokenAmount, true), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger((user + "_tokenBalance"), userBalance), BooleanEntry((user + "_useAsCollateral"), isCollateral), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount) | |
118 | + | if (isCollateral) | |
119 | + | then { | |
120 | + | let lockedUserBalance = (userlockedBalance(user) + userTokenAmount) | |
121 | + | $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true)], (toString(i.payments[0].amount) + "were successfully locked")) | |
122 | + | } | |
123 | + | else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount) | |
115 | 124 | } | |
116 | 125 | else throw("Address does not match with wavetroller address!") | |
117 | 126 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let baseFactor = 1000 | |
5 | 5 | ||
6 | 6 | let baseIndex = 10000000000000000 | |
7 | 7 | ||
8 | 8 | let blocksPerYear = 525600 | |
9 | 9 | ||
10 | 10 | let config = valueOrElse(getString(this, "configAddress"), "") | |
11 | 11 | ||
12 | 12 | let admin = valueOrElse(getString(addressFromStringValue(config), "admin"), "") | |
13 | 13 | ||
14 | 14 | let wavetroller = valueOrElse(getString(addressFromStringValue(config), "wavetroller"), "") | |
15 | 15 | ||
16 | 16 | let assetIdSub = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!") | |
17 | 17 | ||
18 | 18 | let assetDecimals = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Decimals")), (("No key " + (assetIdSub + "_Decimals")) + " was found")) | |
19 | 19 | ||
20 | 20 | let multiplier = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Multiplier")), (("No key " + (assetIdSub + "_Multiplier")) + " was found")) | |
21 | 21 | ||
22 | 22 | let kink = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Kink")), (("No key " + (assetIdSub + "_Kink")) + " was found")) | |
23 | 23 | ||
24 | 24 | let jumpMultiplier = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_JumpMultiplier")), (("No key " + (assetIdSub + "_JumpMultiplier")) + " was found")) | |
25 | 25 | ||
26 | 26 | let baseRate = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_BaseRate")), (("No key " + (assetIdSub + "_BaseRate")) + " was found")) | |
27 | 27 | ||
28 | 28 | let reserveFactor = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_ReserveFactor")), (("No key " + (assetIdSub + "_ReserveFactor")) + " was found")) | |
29 | 29 | ||
30 | 30 | let totalBorrow = valueOrElse(getInteger(this, "totalBorrow"), 0) | |
31 | 31 | ||
32 | 32 | let totalSupply = valueOrElse(getInteger(this, "totalSupply"), 0) | |
33 | 33 | ||
34 | 34 | let totalReserve = valueOrElse(getInteger(this, "totalReserve"), 0) | |
35 | 35 | ||
36 | 36 | let dTokenSupply = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found") | |
37 | 37 | ||
38 | 38 | let dTokenDecimals = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found") | |
39 | 39 | ||
40 | 40 | let dTokenId = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found") | |
41 | 41 | ||
42 | 42 | let storedHeight = valueOrElse(getInteger(this, "storedHeight"), height) | |
43 | 43 | ||
44 | 44 | let storedIndex = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000) | |
45 | 45 | ||
46 | 46 | func isAdminAddress (address) = if ((addressFromStringValue(admin) == address)) | |
47 | 47 | then true | |
48 | 48 | else false | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func isWavetroller (address) = if ((addressFromStringValue(wavetroller) == address)) | |
52 | 52 | then true | |
53 | 53 | else false | |
54 | 54 | ||
55 | 55 | ||
56 | + | func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub)) | |
57 | + | then true | |
58 | + | else false | |
59 | + | ||
60 | + | ||
56 | 61 | func writeString (key,stringValue) = StringEntry(key, stringValue) | |
57 | 62 | ||
58 | 63 | ||
59 | 64 | func writeInteger (key,integerValue) = IntegerEntry(key, integerValue) | |
60 | 65 | ||
61 | 66 | ||
62 | - | func | |
67 | + | func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0) | |
63 | 68 | ||
64 | 69 | ||
65 | 70 | let utilization = if ((totalSupply > 0)) | |
66 | 71 | then fraction(totalBorrow, baseFactor, totalSupply) | |
67 | 72 | else 0 | |
68 | 73 | ||
69 | 74 | let apr = { | |
70 | 75 | let minValue = [utilization, kink] | |
71 | 76 | let minValueItem = min(minValue) | |
72 | 77 | let maxValue = [0, (utilization - kink)] | |
73 | 78 | let maxValueItem = max(maxValue) | |
74 | 79 | ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate) | |
75 | 80 | } | |
76 | 81 | ||
77 | 82 | let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor) | |
78 | 83 | ||
79 | 84 | let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor)) | |
80 | 85 | ||
81 | 86 | let deltaBlocks = (height - storedHeight) | |
82 | 87 | ||
83 | 88 | let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING) | |
84 | 89 | ||
85 | 90 | let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex) | |
86 | 91 | ||
87 | 92 | let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex) | |
88 | 93 | ||
89 | 94 | let currentSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor)) | |
90 | 95 | ||
91 | 96 | let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor)) | |
92 | 97 | ||
93 | 98 | let dTokenExchangeRate = if ((dTokenSupply > 0)) | |
94 | 99 | then { | |
95 | 100 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
96 | 101 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
97 | 102 | fraction(currentSupply, mantissa, dTokenSupply) | |
98 | 103 | } | |
99 | 104 | else 20000000000000000 | |
100 | 105 | ||
101 | 106 | func calcTokenAmount (assetAmount) = { | |
102 | 107 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
103 | 108 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
104 | 109 | fraction(assetAmount, mantissa, dTokenExchangeRate) | |
105 | 110 | } | |
106 | 111 | ||
107 | 112 | ||
108 | 113 | @Callable(i) | |
109 | 114 | func deposit (user,isCollateral) = if (isWavetroller(i.caller)) | |
110 | 115 | then { | |
111 | 116 | let userTokenAmount = calcTokenAmount(i.payments[0].amount) | |
112 | 117 | let currentDTokenSupply = (dTokenSupply + userTokenAmount) | |
113 | - | let userBalance = (userTokenBalance(user) + userTokenAmount) | |
114 | - | $Tuple2([Reissue(fromBase58String(dTokenId), userTokenAmount, true), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger((user + "_tokenBalance"), userBalance), BooleanEntry((user + "_useAsCollateral"), isCollateral), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount) | |
118 | + | if (isCollateral) | |
119 | + | then { | |
120 | + | let lockedUserBalance = (userlockedBalance(user) + userTokenAmount) | |
121 | + | $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true)], (toString(i.payments[0].amount) + "were successfully locked")) | |
122 | + | } | |
123 | + | else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount) | |
115 | 124 | } | |
116 | 125 | else throw("Address does not match with wavetroller address!") | |
117 | 126 | ||
118 | 127 | ||
119 | 128 | ||
120 | 129 | @Callable(i) | |
121 | 130 | func setup (aId,configAdd,tokenName,tokenDescription) = if (!(isDefined(getString(this, "configAddress")))) | |
122 | 131 | then { | |
123 | 132 | let asset = Issue(tokenName, tokenDescription, 0, 8, true) | |
124 | 133 | let tokenId = calculateAssetId(asset) | |
125 | 134 | [asset, writeString("assetId", aId), writeString("configAddress", configAdd), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", baseIndex), IntegerEntry("storedHeight", height), writeString("dTokenName", tokenName), writeString("dTokenId", toBase58String(tokenId)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)] | |
126 | 135 | } | |
127 | 136 | else throw("Pool already setup!") | |
128 | 137 | ||
129 | 138 | ||
130 | 139 | ||
131 | 140 | @Callable(i) | |
132 | 141 | func deletEntry (key) = if (isAdminAddress(i.caller)) | |
133 | 142 | then [DeleteEntry(key)] | |
134 | 143 | else throw("Caller is not an admin!") | |
135 | 144 | ||
136 | 145 | ||
137 | 146 | @Verifier(tx) | |
138 | 147 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
139 | 148 |
github/deemru/w8io/026f985 39.97 ms ◑