tx · 7MBNuUuJ5mXuH84EAeHpxCxsqYz5k4jGbgdUfxRXGXSk 3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9: -0.04000000 Waves 2021.08.25 00:06 [1672919] smart account 3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9 > SELF 0.00000000 Waves
{ "type": 13, "id": "7MBNuUuJ5mXuH84EAeHpxCxsqYz5k4jGbgdUfxRXGXSk", "fee": 4000000, "feeAssetId": null, "timestamp": 1629839243649, "version": 2, "chainId": 84, "sender": "3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9", "senderPublicKey": "5fe3Hm6UB8fRqvLYhGeeNdy7rEgwpxWjdEFPgnNwSRCz", "proofs": [ "5zn8559DFUHAExQLY18SoqCwmCbpzUQCYQLYx9jNL51bwAB6UJBXeXqXxHh5KeEWdocX9LeWZuN76Zc6kKvfPrL" ], "script": "base64:AAIFAAAAAAAAABAIAhIECgIIBBIGCgQICAgIAAAAJgAAAAAKYmFzZUZhY3RvcgAAAAAAAAAD6AAAAAAJYmFzZUluZGV4AAAjhvJvwQAAAAAAAA1ibG9ja3NQZXJZZWFyAAAAAAAACAUgAAAAAAZjb25maWcJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA1jb25maWdBZGRyZXNzAgAAADFObyBjb25maWcgYWRkcmVzcyBjb3VsZCBiZSBmb3VuZCBpbiBkYXRhIHN0b3JhZ2UhAAAAAAVhZG1pbgkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAAFYWRtaW4CAAAAME5vIGFkbWluIGFkZHJlc3MgY291bGQgYmUgZm91bmQgaW4gZGF0YSBzdG9yYWdlIQAAAAALd2F2ZXRyb2xsZXIJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACCQEAAAARQG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keSBzZXR1cCEAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleXIOwPI=", "height": 1672919, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GULrNcZi283aQvWgjApCh7g734KLzU7KCVkz4WWKWTAe Next: AoWCoxJ26T9LSHrydyXi5iTkBKZf2zowoDdm7qNrznM7 Diff:
Old | New | Differences | |
---|---|---|---|
124 | 124 | ||
125 | 125 | ||
126 | 126 | @Callable(i) | |
127 | - | func setup (aId,tokenName) = { | |
128 | - | let isAdmin = isAdminAddress(i.caller) | |
129 | - | if (isAdmin) | |
130 | - | then { | |
131 | - | let asset = Issue("dWAVES_Pool_Token", "Direct.finance Liquidity Provider Token of the Waves Coin Pool", 0, 8, true) | |
132 | - | let tokenId = calculateAssetId(asset) | |
133 | - | [writeString("assetId", aId), writeString("configAddress", "3N3ayfE547Cw4gBpg8iuMor6V2Ap2wELatz"), 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)] | |
134 | - | } | |
135 | - | else throw("Address does not match with admin address!") | |
136 | - | } | |
127 | + | func setup (aId,configAdd,tokenName,tokenDescription) = if (if (!(isDefined("config"))) | |
128 | + | then !(isDefined("admin")) | |
129 | + | else false) | |
130 | + | then { | |
131 | + | let asset = Issue(tokenName, tokenDescription, 0, 8, true) | |
132 | + | let tokenId = calculateAssetId(asset) | |
133 | + | [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)] | |
134 | + | } | |
135 | + | else throw("Pool already setup!") | |
137 | 136 | ||
138 | 137 | ||
139 | 138 | @Verifier(tx) |
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 = valueOrErrorMessage(getString(this, "configAddress"), "No config address could be found in data storage!") | |
11 | 11 | ||
12 | 12 | let admin = valueOrErrorMessage(getString(addressFromStringValue(config), "admin"), "No admin address could be found in data storage!") | |
13 | 13 | ||
14 | 14 | let wavetroller = valueOrErrorMessage(getString(addressFromStringValue(config), "wavetroller"), "No wavetroller address could be found in data storage!") | |
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 = valueOrErrorMessage(getInteger(this, "totalBorrow"), "No key totalBorrow was found") | |
31 | 31 | ||
32 | 32 | let totalSupply = valueOrErrorMessage(getInteger(this, "totalSupply"), "No key totalSupply was found") | |
33 | 33 | ||
34 | 34 | let totalReserve = valueOrErrorMessage(getInteger(this, "totalReserve"), "No key totalReserve was found") | |
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 = valueOrErrorMessage(getInteger(this, "storedHeight"), "No key storedHeight was found") | |
43 | 43 | ||
44 | 44 | let storedIndex = valueOrErrorMessage(getInteger(this, "storedIndex"), "No key storedIndex was found") | |
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 | 56 | func writeString (key,stringValue) = StringEntry(key, stringValue) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func writeInteger (key,integerValue) = IntegerEntry(key, integerValue) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func userTokenBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_tokenBalance")), 0) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | let utilization = fraction(totalBorrow, baseFactor, totalSupply) | |
66 | 66 | ||
67 | 67 | let apr = { | |
68 | 68 | let minValue = [utilization, kink] | |
69 | 69 | let minValueItem = min(minValue) | |
70 | 70 | let maxValue = [0, (utilization - kink)] | |
71 | 71 | let maxValueItem = max(maxValue) | |
72 | 72 | ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate) | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor) | |
76 | 76 | ||
77 | 77 | let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor)) | |
78 | 78 | ||
79 | 79 | let deltaBlocks = (height - storedHeight) | |
80 | 80 | ||
81 | 81 | let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING) | |
82 | 82 | ||
83 | 83 | let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex) | |
84 | 84 | ||
85 | 85 | let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex) | |
86 | 86 | ||
87 | 87 | let currentSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor)) | |
88 | 88 | ||
89 | 89 | let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor)) | |
90 | 90 | ||
91 | 91 | let dTokenExchangeRate = if ((dTokenSupply > 0)) | |
92 | 92 | then { | |
93 | 93 | let exponent = ((18 - 8) + assetDecimals) | |
94 | 94 | if ((10 > exponent)) | |
95 | 95 | then fraction(currentSupply, (1 * pow(10, 2, exponent, 1, 18, CEILING)), dTokenSupply) | |
96 | 96 | else fraction(currentSupply, (1 * pow(10, 2, exponent, 2, 18, CEILING)), dTokenSupply) | |
97 | 97 | } | |
98 | 98 | else { | |
99 | 99 | let rBaseExponent = (assetDecimals + 6) | |
100 | 100 | if ((10 > rBaseExponent)) | |
101 | 101 | then fraction(2, (1 * pow(10, 2, rBaseExponent, 1, 18, CEILING)), 1) | |
102 | 102 | else fraction(2, (1 * pow(10, 2, rBaseExponent, 2, 18, CEILING)), 1) | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | func calcTokenAmout (assetAmount) = { | |
106 | 106 | let exponent = ((18 - 8) + assetDecimals) | |
107 | 107 | let exponentPoint = if ((10 > exponent)) | |
108 | 108 | then 1 | |
109 | 109 | else 2 | |
110 | 110 | fraction(assetAmount, (1 * pow(10, 2, exponent, exponentPoint, 18, CEILING)), dTokenExchangeRate) | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | @Callable(i) | |
115 | 115 | func deposit (user,isCollateral) = if (isWavetroller(i.caller)) | |
116 | 116 | then { | |
117 | 117 | let userTokenAmount = calcTokenAmout(i.payments[0].amount) | |
118 | 118 | let currentDTokenSupply = (dTokenSupply + userTokenAmount) | |
119 | 119 | let userBalance = (userTokenBalance(user) + userTokenAmount) | |
120 | 120 | [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))] | |
121 | 121 | } | |
122 | 122 | else throw("Address does not match with wavetroller address!") | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | ||
126 | 126 | @Callable(i) | |
127 | - | func setup (aId,tokenName) = { | |
128 | - | let isAdmin = isAdminAddress(i.caller) | |
129 | - | if (isAdmin) | |
130 | - | then { | |
131 | - | let asset = Issue("dWAVES_Pool_Token", "Direct.finance Liquidity Provider Token of the Waves Coin Pool", 0, 8, true) | |
132 | - | let tokenId = calculateAssetId(asset) | |
133 | - | [writeString("assetId", aId), writeString("configAddress", "3N3ayfE547Cw4gBpg8iuMor6V2Ap2wELatz"), 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)] | |
134 | - | } | |
135 | - | else throw("Address does not match with admin address!") | |
136 | - | } | |
127 | + | func setup (aId,configAdd,tokenName,tokenDescription) = if (if (!(isDefined("config"))) | |
128 | + | then !(isDefined("admin")) | |
129 | + | else false) | |
130 | + | then { | |
131 | + | let asset = Issue(tokenName, tokenDescription, 0, 8, true) | |
132 | + | let tokenId = calculateAssetId(asset) | |
133 | + | [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)] | |
134 | + | } | |
135 | + | else throw("Pool already setup!") | |
137 | 136 | ||
138 | 137 | ||
139 | 138 | @Verifier(tx) | |
140 | 139 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
141 | 140 |
github/deemru/w8io/169f3d6 32.55 ms ◑