├── .gitignore ├── abis ├── Cat.json ├── DSProxyFactory.json ├── DssCdpManager.json ├── Flapper.json ├── Flipper.json ├── Flopper.json ├── Jug.json ├── Pot.json ├── Spotter.json ├── Vat.json └── Vow.json ├── package.json ├── prettier.config.js ├── schema.graphql ├── src ├── entities │ ├── index.ts │ ├── system.ts │ └── user.ts └── mappings │ └── modules │ ├── collateral │ └── flip.ts │ ├── core │ ├── cat.ts │ ├── spot.ts │ └── vat.ts │ ├── proxy │ ├── cdp-manager.ts │ └── proxy-factory.ts │ ├── rates │ ├── jug.ts │ └── pot.ts │ └── system-stabilizer │ ├── flap.ts │ ├── flop.ts │ └── vow.ts ├── subgraph.yaml ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | /generated 3 | /build -------------------------------------------------------------------------------- /abis/Cat.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" } 5 | ], 6 | "payable": false, 7 | "stateMutability": "nonpayable", 8 | "type": "constructor" 9 | }, 10 | { 11 | "anonymous": false, 12 | "inputs": [ 13 | { 14 | "indexed": true, 15 | "internalType": "bytes32", 16 | "name": "ilk", 17 | "type": "bytes32" 18 | }, 19 | { 20 | "indexed": true, 21 | "internalType": "address", 22 | "name": "urn", 23 | "type": "address" 24 | }, 25 | { 26 | "indexed": false, 27 | "internalType": "uint256", 28 | "name": "ink", 29 | "type": "uint256" 30 | }, 31 | { 32 | "indexed": false, 33 | "internalType": "uint256", 34 | "name": "art", 35 | "type": "uint256" 36 | }, 37 | { 38 | "indexed": false, 39 | "internalType": "uint256", 40 | "name": "tab", 41 | "type": "uint256" 42 | }, 43 | { 44 | "indexed": false, 45 | "internalType": "address", 46 | "name": "flip", 47 | "type": "address" 48 | }, 49 | { 50 | "indexed": false, 51 | "internalType": "uint256", 52 | "name": "id", 53 | "type": "uint256" 54 | } 55 | ], 56 | "name": "Bite", 57 | "type": "event" 58 | }, 59 | { 60 | "anonymous": true, 61 | "inputs": [ 62 | { 63 | "indexed": true, 64 | "internalType": "bytes4", 65 | "name": "sig", 66 | "type": "bytes4" 67 | }, 68 | { 69 | "indexed": true, 70 | "internalType": "address", 71 | "name": "usr", 72 | "type": "address" 73 | }, 74 | { 75 | "indexed": true, 76 | "internalType": "bytes32", 77 | "name": "arg1", 78 | "type": "bytes32" 79 | }, 80 | { 81 | "indexed": true, 82 | "internalType": "bytes32", 83 | "name": "arg2", 84 | "type": "bytes32" 85 | }, 86 | { 87 | "indexed": false, 88 | "internalType": "bytes", 89 | "name": "data", 90 | "type": "bytes" 91 | } 92 | ], 93 | "name": "LogNote", 94 | "type": "event" 95 | }, 96 | { 97 | "constant": false, 98 | "inputs": [ 99 | { "internalType": "bytes32", "name": "ilk", "type": "bytes32" }, 100 | { "internalType": "address", "name": "urn", "type": "address" } 101 | ], 102 | "name": "bite", 103 | "outputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 104 | "payable": false, 105 | "stateMutability": "nonpayable", 106 | "type": "function" 107 | }, 108 | { 109 | "constant": false, 110 | "inputs": [], 111 | "name": "cage", 112 | "outputs": [], 113 | "payable": false, 114 | "stateMutability": "nonpayable", 115 | "type": "function" 116 | }, 117 | { 118 | "constant": false, 119 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 120 | "name": "deny", 121 | "outputs": [], 122 | "payable": false, 123 | "stateMutability": "nonpayable", 124 | "type": "function" 125 | }, 126 | { 127 | "constant": false, 128 | "inputs": [ 129 | { "internalType": "bytes32", "name": "ilk", "type": "bytes32" }, 130 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 131 | { "internalType": "uint256", "name": "data", "type": "uint256" } 132 | ], 133 | "name": "file", 134 | "outputs": [], 135 | "payable": false, 136 | "stateMutability": "nonpayable", 137 | "type": "function" 138 | }, 139 | { 140 | "constant": false, 141 | "inputs": [ 142 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 143 | { "internalType": "address", "name": "data", "type": "address" } 144 | ], 145 | "name": "file", 146 | "outputs": [], 147 | "payable": false, 148 | "stateMutability": "nonpayable", 149 | "type": "function" 150 | }, 151 | { 152 | "constant": false, 153 | "inputs": [ 154 | { "internalType": "bytes32", "name": "ilk", "type": "bytes32" }, 155 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 156 | { "internalType": "address", "name": "flip", "type": "address" } 157 | ], 158 | "name": "file", 159 | "outputs": [], 160 | "payable": false, 161 | "stateMutability": "nonpayable", 162 | "type": "function" 163 | }, 164 | { 165 | "constant": true, 166 | "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], 167 | "name": "ilks", 168 | "outputs": [ 169 | { "internalType": "address", "name": "flip", "type": "address" }, 170 | { "internalType": "uint256", "name": "chop", "type": "uint256" }, 171 | { "internalType": "uint256", "name": "lump", "type": "uint256" } 172 | ], 173 | "payable": false, 174 | "stateMutability": "view", 175 | "type": "function" 176 | }, 177 | { 178 | "constant": true, 179 | "inputs": [], 180 | "name": "live", 181 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 182 | "payable": false, 183 | "stateMutability": "view", 184 | "type": "function" 185 | }, 186 | { 187 | "constant": false, 188 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 189 | "name": "rely", 190 | "outputs": [], 191 | "payable": false, 192 | "stateMutability": "nonpayable", 193 | "type": "function" 194 | }, 195 | { 196 | "constant": true, 197 | "inputs": [], 198 | "name": "vat", 199 | "outputs": [ 200 | { "internalType": "contract VatLike", "name": "", "type": "address" } 201 | ], 202 | "payable": false, 203 | "stateMutability": "view", 204 | "type": "function" 205 | }, 206 | { 207 | "constant": true, 208 | "inputs": [], 209 | "name": "vow", 210 | "outputs": [ 211 | { "internalType": "contract VowLike", "name": "", "type": "address" } 212 | ], 213 | "payable": false, 214 | "stateMutability": "view", 215 | "type": "function" 216 | }, 217 | { 218 | "constant": true, 219 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 220 | "name": "wards", 221 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 222 | "payable": false, 223 | "stateMutability": "view", 224 | "type": "function" 225 | } 226 | ] 227 | -------------------------------------------------------------------------------- /abis/DSProxyFactory.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [{ "name": "", "type": "address" }], 5 | "name": "isProxy", 6 | "outputs": [{ "name": "", "type": "bool" }], 7 | "payable": false, 8 | "stateMutability": "view", 9 | "type": "function" 10 | }, 11 | { 12 | "constant": true, 13 | "inputs": [], 14 | "name": "cache", 15 | "outputs": [{ "name": "", "type": "address" }], 16 | "payable": false, 17 | "stateMutability": "view", 18 | "type": "function" 19 | }, 20 | { 21 | "constant": false, 22 | "inputs": [], 23 | "name": "build", 24 | "outputs": [{ "name": "proxy", "type": "address" }], 25 | "payable": false, 26 | "stateMutability": "nonpayable", 27 | "type": "function" 28 | }, 29 | { 30 | "constant": false, 31 | "inputs": [{ "name": "owner", "type": "address" }], 32 | "name": "build", 33 | "outputs": [{ "name": "proxy", "type": "address" }], 34 | "payable": false, 35 | "stateMutability": "nonpayable", 36 | "type": "function" 37 | }, 38 | { 39 | "anonymous": false, 40 | "inputs": [ 41 | { "indexed": true, "name": "sender", "type": "address" }, 42 | { "indexed": true, "name": "owner", "type": "address" }, 43 | { "indexed": false, "name": "proxy", "type": "address" }, 44 | { "indexed": false, "name": "cache", "type": "address" } 45 | ], 46 | "name": "Created", 47 | "type": "event" 48 | } 49 | ] 50 | -------------------------------------------------------------------------------- /abis/DssCdpManager.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" } 5 | ], 6 | "payable": false, 7 | "stateMutability": "nonpayable", 8 | "type": "constructor" 9 | }, 10 | { 11 | "anonymous": true, 12 | "inputs": [ 13 | { 14 | "indexed": true, 15 | "internalType": "bytes4", 16 | "name": "sig", 17 | "type": "bytes4" 18 | }, 19 | { 20 | "indexed": true, 21 | "internalType": "address", 22 | "name": "usr", 23 | "type": "address" 24 | }, 25 | { 26 | "indexed": true, 27 | "internalType": "bytes32", 28 | "name": "arg1", 29 | "type": "bytes32" 30 | }, 31 | { 32 | "indexed": true, 33 | "internalType": "bytes32", 34 | "name": "arg2", 35 | "type": "bytes32" 36 | }, 37 | { 38 | "indexed": false, 39 | "internalType": "bytes", 40 | "name": "data", 41 | "type": "bytes" 42 | } 43 | ], 44 | "name": "LogNote", 45 | "type": "event" 46 | }, 47 | { 48 | "anonymous": false, 49 | "inputs": [ 50 | { 51 | "indexed": true, 52 | "internalType": "address", 53 | "name": "usr", 54 | "type": "address" 55 | }, 56 | { 57 | "indexed": true, 58 | "internalType": "address", 59 | "name": "own", 60 | "type": "address" 61 | }, 62 | { 63 | "indexed": true, 64 | "internalType": "uint256", 65 | "name": "cdp", 66 | "type": "uint256" 67 | } 68 | ], 69 | "name": "NewCdp", 70 | "type": "event" 71 | }, 72 | { 73 | "constant": false, 74 | "inputs": [ 75 | { "internalType": "uint256", "name": "cdp", "type": "uint256" }, 76 | { "internalType": "address", "name": "usr", "type": "address" }, 77 | { "internalType": "uint256", "name": "ok", "type": "uint256" } 78 | ], 79 | "name": "cdpAllow", 80 | "outputs": [], 81 | "payable": false, 82 | "stateMutability": "nonpayable", 83 | "type": "function" 84 | }, 85 | { 86 | "constant": true, 87 | "inputs": [ 88 | { "internalType": "address", "name": "", "type": "address" }, 89 | { "internalType": "uint256", "name": "", "type": "uint256" }, 90 | { "internalType": "address", "name": "", "type": "address" } 91 | ], 92 | "name": "cdpCan", 93 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 94 | "payable": false, 95 | "stateMutability": "view", 96 | "type": "function" 97 | }, 98 | { 99 | "constant": true, 100 | "inputs": [], 101 | "name": "cdpi", 102 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 103 | "payable": false, 104 | "stateMutability": "view", 105 | "type": "function" 106 | }, 107 | { 108 | "constant": true, 109 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 110 | "name": "count", 111 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 112 | "payable": false, 113 | "stateMutability": "view", 114 | "type": "function" 115 | }, 116 | { 117 | "constant": false, 118 | "inputs": [ 119 | { "internalType": "address", "name": "src", "type": "address" }, 120 | { "internalType": "uint256", "name": "cdp", "type": "uint256" } 121 | ], 122 | "name": "enter", 123 | "outputs": [], 124 | "payable": false, 125 | "stateMutability": "nonpayable", 126 | "type": "function" 127 | }, 128 | { 129 | "constant": true, 130 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 131 | "name": "first", 132 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 133 | "payable": false, 134 | "stateMutability": "view", 135 | "type": "function" 136 | }, 137 | { 138 | "constant": false, 139 | "inputs": [ 140 | { "internalType": "bytes32", "name": "ilk", "type": "bytes32" }, 141 | { "internalType": "uint256", "name": "cdp", "type": "uint256" }, 142 | { "internalType": "address", "name": "dst", "type": "address" }, 143 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 144 | ], 145 | "name": "flux", 146 | "outputs": [], 147 | "payable": false, 148 | "stateMutability": "nonpayable", 149 | "type": "function" 150 | }, 151 | { 152 | "constant": false, 153 | "inputs": [ 154 | { "internalType": "uint256", "name": "cdp", "type": "uint256" }, 155 | { "internalType": "address", "name": "dst", "type": "address" }, 156 | { "internalType": "uint256", "name": "wad", "type": "uint256" } 157 | ], 158 | "name": "flux", 159 | "outputs": [], 160 | "payable": false, 161 | "stateMutability": "nonpayable", 162 | "type": "function" 163 | }, 164 | { 165 | "constant": false, 166 | "inputs": [ 167 | { "internalType": "uint256", "name": "cdp", "type": "uint256" }, 168 | { "internalType": "int256", "name": "dink", "type": "int256" }, 169 | { "internalType": "int256", "name": "dart", "type": "int256" } 170 | ], 171 | "name": "frob", 172 | "outputs": [], 173 | "payable": false, 174 | "stateMutability": "nonpayable", 175 | "type": "function" 176 | }, 177 | { 178 | "constant": false, 179 | "inputs": [ 180 | { "internalType": "uint256", "name": "cdp", "type": "uint256" }, 181 | { "internalType": "address", "name": "dst", "type": "address" } 182 | ], 183 | "name": "give", 184 | "outputs": [], 185 | "payable": false, 186 | "stateMutability": "nonpayable", 187 | "type": "function" 188 | }, 189 | { 190 | "constant": true, 191 | "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 192 | "name": "ilks", 193 | "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], 194 | "payable": false, 195 | "stateMutability": "view", 196 | "type": "function" 197 | }, 198 | { 199 | "constant": true, 200 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 201 | "name": "last", 202 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 203 | "payable": false, 204 | "stateMutability": "view", 205 | "type": "function" 206 | }, 207 | { 208 | "constant": true, 209 | "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 210 | "name": "list", 211 | "outputs": [ 212 | { "internalType": "uint256", "name": "prev", "type": "uint256" }, 213 | { "internalType": "uint256", "name": "next", "type": "uint256" } 214 | ], 215 | "payable": false, 216 | "stateMutability": "view", 217 | "type": "function" 218 | }, 219 | { 220 | "constant": false, 221 | "inputs": [ 222 | { "internalType": "uint256", "name": "cdp", "type": "uint256" }, 223 | { "internalType": "address", "name": "dst", "type": "address" }, 224 | { "internalType": "uint256", "name": "rad", "type": "uint256" } 225 | ], 226 | "name": "move", 227 | "outputs": [], 228 | "payable": false, 229 | "stateMutability": "nonpayable", 230 | "type": "function" 231 | }, 232 | { 233 | "constant": false, 234 | "inputs": [ 235 | { "internalType": "bytes32", "name": "ilk", "type": "bytes32" }, 236 | { "internalType": "address", "name": "usr", "type": "address" } 237 | ], 238 | "name": "open", 239 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 240 | "payable": false, 241 | "stateMutability": "nonpayable", 242 | "type": "function" 243 | }, 244 | { 245 | "constant": true, 246 | "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 247 | "name": "owns", 248 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 249 | "payable": false, 250 | "stateMutability": "view", 251 | "type": "function" 252 | }, 253 | { 254 | "constant": false, 255 | "inputs": [ 256 | { "internalType": "uint256", "name": "cdp", "type": "uint256" }, 257 | { "internalType": "address", "name": "dst", "type": "address" } 258 | ], 259 | "name": "quit", 260 | "outputs": [], 261 | "payable": false, 262 | "stateMutability": "nonpayable", 263 | "type": "function" 264 | }, 265 | { 266 | "constant": false, 267 | "inputs": [ 268 | { "internalType": "uint256", "name": "cdpSrc", "type": "uint256" }, 269 | { "internalType": "uint256", "name": "cdpDst", "type": "uint256" } 270 | ], 271 | "name": "shift", 272 | "outputs": [], 273 | "payable": false, 274 | "stateMutability": "nonpayable", 275 | "type": "function" 276 | }, 277 | { 278 | "constant": false, 279 | "inputs": [ 280 | { "internalType": "address", "name": "usr", "type": "address" }, 281 | { "internalType": "uint256", "name": "ok", "type": "uint256" } 282 | ], 283 | "name": "urnAllow", 284 | "outputs": [], 285 | "payable": false, 286 | "stateMutability": "nonpayable", 287 | "type": "function" 288 | }, 289 | { 290 | "constant": true, 291 | "inputs": [ 292 | { "internalType": "address", "name": "", "type": "address" }, 293 | { "internalType": "address", "name": "", "type": "address" } 294 | ], 295 | "name": "urnCan", 296 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 297 | "payable": false, 298 | "stateMutability": "view", 299 | "type": "function" 300 | }, 301 | { 302 | "constant": true, 303 | "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 304 | "name": "urns", 305 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 306 | "payable": false, 307 | "stateMutability": "view", 308 | "type": "function" 309 | }, 310 | { 311 | "constant": true, 312 | "inputs": [], 313 | "name": "vat", 314 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 315 | "payable": false, 316 | "stateMutability": "view", 317 | "type": "function" 318 | } 319 | ] 320 | -------------------------------------------------------------------------------- /abis/Flapper.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" }, 5 | { "internalType": "address", "name": "gem_", "type": "address" } 6 | ], 7 | "payable": false, 8 | "stateMutability": "nonpayable", 9 | "type": "constructor" 10 | }, 11 | { 12 | "anonymous": false, 13 | "inputs": [ 14 | { 15 | "indexed": false, 16 | "internalType": "uint256", 17 | "name": "id", 18 | "type": "uint256" 19 | }, 20 | { 21 | "indexed": false, 22 | "internalType": "uint256", 23 | "name": "lot", 24 | "type": "uint256" 25 | }, 26 | { 27 | "indexed": false, 28 | "internalType": "uint256", 29 | "name": "bid", 30 | "type": "uint256" 31 | } 32 | ], 33 | "name": "Kick", 34 | "type": "event" 35 | }, 36 | { 37 | "anonymous": true, 38 | "inputs": [ 39 | { 40 | "indexed": true, 41 | "internalType": "bytes4", 42 | "name": "sig", 43 | "type": "bytes4" 44 | }, 45 | { 46 | "indexed": true, 47 | "internalType": "address", 48 | "name": "usr", 49 | "type": "address" 50 | }, 51 | { 52 | "indexed": true, 53 | "internalType": "bytes32", 54 | "name": "arg1", 55 | "type": "bytes32" 56 | }, 57 | { 58 | "indexed": true, 59 | "internalType": "bytes32", 60 | "name": "arg2", 61 | "type": "bytes32" 62 | }, 63 | { 64 | "indexed": false, 65 | "internalType": "bytes", 66 | "name": "data", 67 | "type": "bytes" 68 | } 69 | ], 70 | "name": "LogNote", 71 | "type": "event" 72 | }, 73 | { 74 | "constant": true, 75 | "inputs": [], 76 | "name": "beg", 77 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 78 | "payable": false, 79 | "stateMutability": "view", 80 | "type": "function" 81 | }, 82 | { 83 | "constant": true, 84 | "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 85 | "name": "bids", 86 | "outputs": [ 87 | { "internalType": "uint256", "name": "bid", "type": "uint256" }, 88 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 89 | { "internalType": "address", "name": "guy", "type": "address" }, 90 | { "internalType": "uint48", "name": "tic", "type": "uint48" }, 91 | { "internalType": "uint48", "name": "end", "type": "uint48" } 92 | ], 93 | "payable": false, 94 | "stateMutability": "view", 95 | "type": "function" 96 | }, 97 | { 98 | "constant": false, 99 | "inputs": [{ "internalType": "uint256", "name": "rad", "type": "uint256" }], 100 | "name": "cage", 101 | "outputs": [], 102 | "payable": false, 103 | "stateMutability": "nonpayable", 104 | "type": "function" 105 | }, 106 | { 107 | "constant": false, 108 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 109 | "name": "deal", 110 | "outputs": [], 111 | "payable": false, 112 | "stateMutability": "nonpayable", 113 | "type": "function" 114 | }, 115 | { 116 | "constant": false, 117 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 118 | "name": "deny", 119 | "outputs": [], 120 | "payable": false, 121 | "stateMutability": "nonpayable", 122 | "type": "function" 123 | }, 124 | { 125 | "constant": false, 126 | "inputs": [ 127 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 128 | { "internalType": "uint256", "name": "data", "type": "uint256" } 129 | ], 130 | "name": "file", 131 | "outputs": [], 132 | "payable": false, 133 | "stateMutability": "nonpayable", 134 | "type": "function" 135 | }, 136 | { 137 | "constant": true, 138 | "inputs": [], 139 | "name": "gem", 140 | "outputs": [ 141 | { "internalType": "contract GemLike", "name": "", "type": "address" } 142 | ], 143 | "payable": false, 144 | "stateMutability": "view", 145 | "type": "function" 146 | }, 147 | { 148 | "constant": false, 149 | "inputs": [ 150 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 151 | { "internalType": "uint256", "name": "bid", "type": "uint256" } 152 | ], 153 | "name": "kick", 154 | "outputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 155 | "payable": false, 156 | "stateMutability": "nonpayable", 157 | "type": "function" 158 | }, 159 | { 160 | "constant": true, 161 | "inputs": [], 162 | "name": "kicks", 163 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 164 | "payable": false, 165 | "stateMutability": "view", 166 | "type": "function" 167 | }, 168 | { 169 | "constant": true, 170 | "inputs": [], 171 | "name": "live", 172 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 173 | "payable": false, 174 | "stateMutability": "view", 175 | "type": "function" 176 | }, 177 | { 178 | "constant": false, 179 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 180 | "name": "rely", 181 | "outputs": [], 182 | "payable": false, 183 | "stateMutability": "nonpayable", 184 | "type": "function" 185 | }, 186 | { 187 | "constant": true, 188 | "inputs": [], 189 | "name": "tau", 190 | "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], 191 | "payable": false, 192 | "stateMutability": "view", 193 | "type": "function" 194 | }, 195 | { 196 | "constant": false, 197 | "inputs": [ 198 | { "internalType": "uint256", "name": "id", "type": "uint256" }, 199 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 200 | { "internalType": "uint256", "name": "bid", "type": "uint256" } 201 | ], 202 | "name": "tend", 203 | "outputs": [], 204 | "payable": false, 205 | "stateMutability": "nonpayable", 206 | "type": "function" 207 | }, 208 | { 209 | "constant": false, 210 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 211 | "name": "tick", 212 | "outputs": [], 213 | "payable": false, 214 | "stateMutability": "nonpayable", 215 | "type": "function" 216 | }, 217 | { 218 | "constant": true, 219 | "inputs": [], 220 | "name": "ttl", 221 | "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], 222 | "payable": false, 223 | "stateMutability": "view", 224 | "type": "function" 225 | }, 226 | { 227 | "constant": true, 228 | "inputs": [], 229 | "name": "vat", 230 | "outputs": [ 231 | { "internalType": "contract VatLike", "name": "", "type": "address" } 232 | ], 233 | "payable": false, 234 | "stateMutability": "view", 235 | "type": "function" 236 | }, 237 | { 238 | "constant": true, 239 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 240 | "name": "wards", 241 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 242 | "payable": false, 243 | "stateMutability": "view", 244 | "type": "function" 245 | }, 246 | { 247 | "constant": false, 248 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 249 | "name": "yank", 250 | "outputs": [], 251 | "payable": false, 252 | "stateMutability": "nonpayable", 253 | "type": "function" 254 | } 255 | ] 256 | -------------------------------------------------------------------------------- /abis/Flipper.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" }, 5 | { "internalType": "bytes32", "name": "ilk_", "type": "bytes32" } 6 | ], 7 | "payable": false, 8 | "stateMutability": "nonpayable", 9 | "type": "constructor" 10 | }, 11 | { 12 | "anonymous": false, 13 | "inputs": [ 14 | { 15 | "indexed": false, 16 | "internalType": "uint256", 17 | "name": "id", 18 | "type": "uint256" 19 | }, 20 | { 21 | "indexed": false, 22 | "internalType": "uint256", 23 | "name": "lot", 24 | "type": "uint256" 25 | }, 26 | { 27 | "indexed": false, 28 | "internalType": "uint256", 29 | "name": "bid", 30 | "type": "uint256" 31 | }, 32 | { 33 | "indexed": false, 34 | "internalType": "uint256", 35 | "name": "tab", 36 | "type": "uint256" 37 | }, 38 | { 39 | "indexed": true, 40 | "internalType": "address", 41 | "name": "usr", 42 | "type": "address" 43 | }, 44 | { 45 | "indexed": true, 46 | "internalType": "address", 47 | "name": "gal", 48 | "type": "address" 49 | } 50 | ], 51 | "name": "Kick", 52 | "type": "event" 53 | }, 54 | { 55 | "anonymous": true, 56 | "inputs": [ 57 | { 58 | "indexed": true, 59 | "internalType": "bytes4", 60 | "name": "sig", 61 | "type": "bytes4" 62 | }, 63 | { 64 | "indexed": true, 65 | "internalType": "address", 66 | "name": "usr", 67 | "type": "address" 68 | }, 69 | { 70 | "indexed": true, 71 | "internalType": "bytes32", 72 | "name": "arg1", 73 | "type": "bytes32" 74 | }, 75 | { 76 | "indexed": true, 77 | "internalType": "bytes32", 78 | "name": "arg2", 79 | "type": "bytes32" 80 | }, 81 | { 82 | "indexed": false, 83 | "internalType": "bytes", 84 | "name": "data", 85 | "type": "bytes" 86 | } 87 | ], 88 | "name": "LogNote", 89 | "type": "event" 90 | }, 91 | { 92 | "constant": true, 93 | "inputs": [], 94 | "name": "beg", 95 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 96 | "payable": false, 97 | "stateMutability": "view", 98 | "type": "function" 99 | }, 100 | { 101 | "constant": true, 102 | "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 103 | "name": "bids", 104 | "outputs": [ 105 | { "internalType": "uint256", "name": "bid", "type": "uint256" }, 106 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 107 | { "internalType": "address", "name": "guy", "type": "address" }, 108 | { "internalType": "uint48", "name": "tic", "type": "uint48" }, 109 | { "internalType": "uint48", "name": "end", "type": "uint48" }, 110 | { "internalType": "address", "name": "usr", "type": "address" }, 111 | { "internalType": "address", "name": "gal", "type": "address" }, 112 | { "internalType": "uint256", "name": "tab", "type": "uint256" } 113 | ], 114 | "payable": false, 115 | "stateMutability": "view", 116 | "type": "function" 117 | }, 118 | { 119 | "constant": false, 120 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 121 | "name": "deal", 122 | "outputs": [], 123 | "payable": false, 124 | "stateMutability": "nonpayable", 125 | "type": "function" 126 | }, 127 | { 128 | "constant": false, 129 | "inputs": [ 130 | { "internalType": "uint256", "name": "id", "type": "uint256" }, 131 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 132 | { "internalType": "uint256", "name": "bid", "type": "uint256" } 133 | ], 134 | "name": "dent", 135 | "outputs": [], 136 | "payable": false, 137 | "stateMutability": "nonpayable", 138 | "type": "function" 139 | }, 140 | { 141 | "constant": false, 142 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 143 | "name": "deny", 144 | "outputs": [], 145 | "payable": false, 146 | "stateMutability": "nonpayable", 147 | "type": "function" 148 | }, 149 | { 150 | "constant": false, 151 | "inputs": [ 152 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 153 | { "internalType": "uint256", "name": "data", "type": "uint256" } 154 | ], 155 | "name": "file", 156 | "outputs": [], 157 | "payable": false, 158 | "stateMutability": "nonpayable", 159 | "type": "function" 160 | }, 161 | { 162 | "constant": true, 163 | "inputs": [], 164 | "name": "ilk", 165 | "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], 166 | "payable": false, 167 | "stateMutability": "view", 168 | "type": "function" 169 | }, 170 | { 171 | "constant": false, 172 | "inputs": [ 173 | { "internalType": "address", "name": "usr", "type": "address" }, 174 | { "internalType": "address", "name": "gal", "type": "address" }, 175 | { "internalType": "uint256", "name": "tab", "type": "uint256" }, 176 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 177 | { "internalType": "uint256", "name": "bid", "type": "uint256" } 178 | ], 179 | "name": "kick", 180 | "outputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 181 | "payable": false, 182 | "stateMutability": "nonpayable", 183 | "type": "function" 184 | }, 185 | { 186 | "constant": true, 187 | "inputs": [], 188 | "name": "kicks", 189 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 190 | "payable": false, 191 | "stateMutability": "view", 192 | "type": "function" 193 | }, 194 | { 195 | "constant": false, 196 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 197 | "name": "rely", 198 | "outputs": [], 199 | "payable": false, 200 | "stateMutability": "nonpayable", 201 | "type": "function" 202 | }, 203 | { 204 | "constant": true, 205 | "inputs": [], 206 | "name": "tau", 207 | "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], 208 | "payable": false, 209 | "stateMutability": "view", 210 | "type": "function" 211 | }, 212 | { 213 | "constant": false, 214 | "inputs": [ 215 | { "internalType": "uint256", "name": "id", "type": "uint256" }, 216 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 217 | { "internalType": "uint256", "name": "bid", "type": "uint256" } 218 | ], 219 | "name": "tend", 220 | "outputs": [], 221 | "payable": false, 222 | "stateMutability": "nonpayable", 223 | "type": "function" 224 | }, 225 | { 226 | "constant": false, 227 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 228 | "name": "tick", 229 | "outputs": [], 230 | "payable": false, 231 | "stateMutability": "nonpayable", 232 | "type": "function" 233 | }, 234 | { 235 | "constant": true, 236 | "inputs": [], 237 | "name": "ttl", 238 | "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], 239 | "payable": false, 240 | "stateMutability": "view", 241 | "type": "function" 242 | }, 243 | { 244 | "constant": true, 245 | "inputs": [], 246 | "name": "vat", 247 | "outputs": [ 248 | { "internalType": "contract VatLike", "name": "", "type": "address" } 249 | ], 250 | "payable": false, 251 | "stateMutability": "view", 252 | "type": "function" 253 | }, 254 | { 255 | "constant": true, 256 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 257 | "name": "wards", 258 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 259 | "payable": false, 260 | "stateMutability": "view", 261 | "type": "function" 262 | }, 263 | { 264 | "constant": false, 265 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 266 | "name": "yank", 267 | "outputs": [], 268 | "payable": false, 269 | "stateMutability": "nonpayable", 270 | "type": "function" 271 | } 272 | ] 273 | -------------------------------------------------------------------------------- /abis/Flopper.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" }, 5 | { "internalType": "address", "name": "gem_", "type": "address" } 6 | ], 7 | "payable": false, 8 | "stateMutability": "nonpayable", 9 | "type": "constructor" 10 | }, 11 | { 12 | "anonymous": false, 13 | "inputs": [ 14 | { 15 | "indexed": false, 16 | "internalType": "uint256", 17 | "name": "id", 18 | "type": "uint256" 19 | }, 20 | { 21 | "indexed": false, 22 | "internalType": "uint256", 23 | "name": "lot", 24 | "type": "uint256" 25 | }, 26 | { 27 | "indexed": false, 28 | "internalType": "uint256", 29 | "name": "bid", 30 | "type": "uint256" 31 | }, 32 | { 33 | "indexed": true, 34 | "internalType": "address", 35 | "name": "gal", 36 | "type": "address" 37 | } 38 | ], 39 | "name": "Kick", 40 | "type": "event" 41 | }, 42 | { 43 | "anonymous": true, 44 | "inputs": [ 45 | { 46 | "indexed": true, 47 | "internalType": "bytes4", 48 | "name": "sig", 49 | "type": "bytes4" 50 | }, 51 | { 52 | "indexed": true, 53 | "internalType": "address", 54 | "name": "usr", 55 | "type": "address" 56 | }, 57 | { 58 | "indexed": true, 59 | "internalType": "bytes32", 60 | "name": "arg1", 61 | "type": "bytes32" 62 | }, 63 | { 64 | "indexed": true, 65 | "internalType": "bytes32", 66 | "name": "arg2", 67 | "type": "bytes32" 68 | }, 69 | { 70 | "indexed": false, 71 | "internalType": "bytes", 72 | "name": "data", 73 | "type": "bytes" 74 | } 75 | ], 76 | "name": "LogNote", 77 | "type": "event" 78 | }, 79 | { 80 | "constant": true, 81 | "inputs": [], 82 | "name": "beg", 83 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 84 | "payable": false, 85 | "stateMutability": "view", 86 | "type": "function" 87 | }, 88 | { 89 | "constant": true, 90 | "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 91 | "name": "bids", 92 | "outputs": [ 93 | { "internalType": "uint256", "name": "bid", "type": "uint256" }, 94 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 95 | { "internalType": "address", "name": "guy", "type": "address" }, 96 | { "internalType": "uint48", "name": "tic", "type": "uint48" }, 97 | { "internalType": "uint48", "name": "end", "type": "uint48" } 98 | ], 99 | "payable": false, 100 | "stateMutability": "view", 101 | "type": "function" 102 | }, 103 | { 104 | "constant": false, 105 | "inputs": [], 106 | "name": "cage", 107 | "outputs": [], 108 | "payable": false, 109 | "stateMutability": "nonpayable", 110 | "type": "function" 111 | }, 112 | { 113 | "constant": false, 114 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 115 | "name": "deal", 116 | "outputs": [], 117 | "payable": false, 118 | "stateMutability": "nonpayable", 119 | "type": "function" 120 | }, 121 | { 122 | "constant": false, 123 | "inputs": [ 124 | { "internalType": "uint256", "name": "id", "type": "uint256" }, 125 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 126 | { "internalType": "uint256", "name": "bid", "type": "uint256" } 127 | ], 128 | "name": "dent", 129 | "outputs": [], 130 | "payable": false, 131 | "stateMutability": "nonpayable", 132 | "type": "function" 133 | }, 134 | { 135 | "constant": false, 136 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 137 | "name": "deny", 138 | "outputs": [], 139 | "payable": false, 140 | "stateMutability": "nonpayable", 141 | "type": "function" 142 | }, 143 | { 144 | "constant": false, 145 | "inputs": [ 146 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 147 | { "internalType": "uint256", "name": "data", "type": "uint256" } 148 | ], 149 | "name": "file", 150 | "outputs": [], 151 | "payable": false, 152 | "stateMutability": "nonpayable", 153 | "type": "function" 154 | }, 155 | { 156 | "constant": true, 157 | "inputs": [], 158 | "name": "gem", 159 | "outputs": [ 160 | { "internalType": "contract GemLike", "name": "", "type": "address" } 161 | ], 162 | "payable": false, 163 | "stateMutability": "view", 164 | "type": "function" 165 | }, 166 | { 167 | "constant": false, 168 | "inputs": [ 169 | { "internalType": "address", "name": "gal", "type": "address" }, 170 | { "internalType": "uint256", "name": "lot", "type": "uint256" }, 171 | { "internalType": "uint256", "name": "bid", "type": "uint256" } 172 | ], 173 | "name": "kick", 174 | "outputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 175 | "payable": false, 176 | "stateMutability": "nonpayable", 177 | "type": "function" 178 | }, 179 | { 180 | "constant": true, 181 | "inputs": [], 182 | "name": "kicks", 183 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 184 | "payable": false, 185 | "stateMutability": "view", 186 | "type": "function" 187 | }, 188 | { 189 | "constant": true, 190 | "inputs": [], 191 | "name": "live", 192 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 193 | "payable": false, 194 | "stateMutability": "view", 195 | "type": "function" 196 | }, 197 | { 198 | "constant": true, 199 | "inputs": [], 200 | "name": "pad", 201 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 202 | "payable": false, 203 | "stateMutability": "view", 204 | "type": "function" 205 | }, 206 | { 207 | "constant": false, 208 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 209 | "name": "rely", 210 | "outputs": [], 211 | "payable": false, 212 | "stateMutability": "nonpayable", 213 | "type": "function" 214 | }, 215 | { 216 | "constant": true, 217 | "inputs": [], 218 | "name": "tau", 219 | "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], 220 | "payable": false, 221 | "stateMutability": "view", 222 | "type": "function" 223 | }, 224 | { 225 | "constant": false, 226 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 227 | "name": "tick", 228 | "outputs": [], 229 | "payable": false, 230 | "stateMutability": "nonpayable", 231 | "type": "function" 232 | }, 233 | { 234 | "constant": true, 235 | "inputs": [], 236 | "name": "ttl", 237 | "outputs": [{ "internalType": "uint48", "name": "", "type": "uint48" }], 238 | "payable": false, 239 | "stateMutability": "view", 240 | "type": "function" 241 | }, 242 | { 243 | "constant": true, 244 | "inputs": [], 245 | "name": "vat", 246 | "outputs": [ 247 | { "internalType": "contract VatLike", "name": "", "type": "address" } 248 | ], 249 | "payable": false, 250 | "stateMutability": "view", 251 | "type": "function" 252 | }, 253 | { 254 | "constant": true, 255 | "inputs": [], 256 | "name": "vow", 257 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 258 | "payable": false, 259 | "stateMutability": "view", 260 | "type": "function" 261 | }, 262 | { 263 | "constant": true, 264 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 265 | "name": "wards", 266 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 267 | "payable": false, 268 | "stateMutability": "view", 269 | "type": "function" 270 | }, 271 | { 272 | "constant": false, 273 | "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 274 | "name": "yank", 275 | "outputs": [], 276 | "payable": false, 277 | "stateMutability": "nonpayable", 278 | "type": "function" 279 | } 280 | ] 281 | -------------------------------------------------------------------------------- /abis/Jug.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" } 5 | ], 6 | "payable": false, 7 | "stateMutability": "nonpayable", 8 | "type": "constructor" 9 | }, 10 | { 11 | "anonymous": true, 12 | "inputs": [ 13 | { 14 | "indexed": true, 15 | "internalType": "bytes4", 16 | "name": "sig", 17 | "type": "bytes4" 18 | }, 19 | { 20 | "indexed": true, 21 | "internalType": "address", 22 | "name": "usr", 23 | "type": "address" 24 | }, 25 | { 26 | "indexed": true, 27 | "internalType": "bytes32", 28 | "name": "arg1", 29 | "type": "bytes32" 30 | }, 31 | { 32 | "indexed": true, 33 | "internalType": "bytes32", 34 | "name": "arg2", 35 | "type": "bytes32" 36 | }, 37 | { 38 | "indexed": false, 39 | "internalType": "bytes", 40 | "name": "data", 41 | "type": "bytes" 42 | } 43 | ], 44 | "name": "LogNote", 45 | "type": "event" 46 | }, 47 | { 48 | "constant": true, 49 | "inputs": [], 50 | "name": "base", 51 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 52 | "payable": false, 53 | "stateMutability": "view", 54 | "type": "function" 55 | }, 56 | { 57 | "constant": false, 58 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 59 | "name": "deny", 60 | "outputs": [], 61 | "payable": false, 62 | "stateMutability": "nonpayable", 63 | "type": "function" 64 | }, 65 | { 66 | "constant": false, 67 | "inputs": [{ "internalType": "bytes32", "name": "ilk", "type": "bytes32" }], 68 | "name": "drip", 69 | "outputs": [ 70 | { "internalType": "uint256", "name": "rate", "type": "uint256" } 71 | ], 72 | "payable": false, 73 | "stateMutability": "nonpayable", 74 | "type": "function" 75 | }, 76 | { 77 | "constant": false, 78 | "inputs": [ 79 | { "internalType": "bytes32", "name": "ilk", "type": "bytes32" }, 80 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 81 | { "internalType": "uint256", "name": "data", "type": "uint256" } 82 | ], 83 | "name": "file", 84 | "outputs": [], 85 | "payable": false, 86 | "stateMutability": "nonpayable", 87 | "type": "function" 88 | }, 89 | { 90 | "constant": false, 91 | "inputs": [ 92 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 93 | { "internalType": "uint256", "name": "data", "type": "uint256" } 94 | ], 95 | "name": "file", 96 | "outputs": [], 97 | "payable": false, 98 | "stateMutability": "nonpayable", 99 | "type": "function" 100 | }, 101 | { 102 | "constant": false, 103 | "inputs": [ 104 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 105 | { "internalType": "address", "name": "data", "type": "address" } 106 | ], 107 | "name": "file", 108 | "outputs": [], 109 | "payable": false, 110 | "stateMutability": "nonpayable", 111 | "type": "function" 112 | }, 113 | { 114 | "constant": true, 115 | "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], 116 | "name": "ilks", 117 | "outputs": [ 118 | { "internalType": "uint256", "name": "duty", "type": "uint256" }, 119 | { "internalType": "uint256", "name": "rho", "type": "uint256" } 120 | ], 121 | "payable": false, 122 | "stateMutability": "view", 123 | "type": "function" 124 | }, 125 | { 126 | "constant": false, 127 | "inputs": [{ "internalType": "bytes32", "name": "ilk", "type": "bytes32" }], 128 | "name": "init", 129 | "outputs": [], 130 | "payable": false, 131 | "stateMutability": "nonpayable", 132 | "type": "function" 133 | }, 134 | { 135 | "constant": false, 136 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 137 | "name": "rely", 138 | "outputs": [], 139 | "payable": false, 140 | "stateMutability": "nonpayable", 141 | "type": "function" 142 | }, 143 | { 144 | "constant": true, 145 | "inputs": [], 146 | "name": "vat", 147 | "outputs": [ 148 | { "internalType": "contract VatLike", "name": "", "type": "address" } 149 | ], 150 | "payable": false, 151 | "stateMutability": "view", 152 | "type": "function" 153 | }, 154 | { 155 | "constant": true, 156 | "inputs": [], 157 | "name": "vow", 158 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 159 | "payable": false, 160 | "stateMutability": "view", 161 | "type": "function" 162 | }, 163 | { 164 | "constant": true, 165 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 166 | "name": "wards", 167 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 168 | "payable": false, 169 | "stateMutability": "view", 170 | "type": "function" 171 | } 172 | ] 173 | -------------------------------------------------------------------------------- /abis/Pot.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" } 5 | ], 6 | "payable": false, 7 | "stateMutability": "nonpayable", 8 | "type": "constructor" 9 | }, 10 | { 11 | "anonymous": true, 12 | "inputs": [ 13 | { 14 | "indexed": true, 15 | "internalType": "bytes4", 16 | "name": "sig", 17 | "type": "bytes4" 18 | }, 19 | { 20 | "indexed": true, 21 | "internalType": "address", 22 | "name": "usr", 23 | "type": "address" 24 | }, 25 | { 26 | "indexed": true, 27 | "internalType": "bytes32", 28 | "name": "arg1", 29 | "type": "bytes32" 30 | }, 31 | { 32 | "indexed": true, 33 | "internalType": "bytes32", 34 | "name": "arg2", 35 | "type": "bytes32" 36 | }, 37 | { 38 | "indexed": false, 39 | "internalType": "bytes", 40 | "name": "data", 41 | "type": "bytes" 42 | } 43 | ], 44 | "name": "LogNote", 45 | "type": "event" 46 | }, 47 | { 48 | "constant": true, 49 | "inputs": [], 50 | "name": "Pie", 51 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 52 | "payable": false, 53 | "stateMutability": "view", 54 | "type": "function" 55 | }, 56 | { 57 | "constant": false, 58 | "inputs": [], 59 | "name": "cage", 60 | "outputs": [], 61 | "payable": false, 62 | "stateMutability": "nonpayable", 63 | "type": "function" 64 | }, 65 | { 66 | "constant": true, 67 | "inputs": [], 68 | "name": "chi", 69 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 70 | "payable": false, 71 | "stateMutability": "view", 72 | "type": "function" 73 | }, 74 | { 75 | "constant": false, 76 | "inputs": [{ "internalType": "address", "name": "guy", "type": "address" }], 77 | "name": "deny", 78 | "outputs": [], 79 | "payable": false, 80 | "stateMutability": "nonpayable", 81 | "type": "function" 82 | }, 83 | { 84 | "constant": false, 85 | "inputs": [], 86 | "name": "drip", 87 | "outputs": [ 88 | { "internalType": "uint256", "name": "tmp", "type": "uint256" } 89 | ], 90 | "payable": false, 91 | "stateMutability": "nonpayable", 92 | "type": "function" 93 | }, 94 | { 95 | "constant": true, 96 | "inputs": [], 97 | "name": "dsr", 98 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 99 | "payable": false, 100 | "stateMutability": "view", 101 | "type": "function" 102 | }, 103 | { 104 | "constant": false, 105 | "inputs": [{ "internalType": "uint256", "name": "wad", "type": "uint256" }], 106 | "name": "exit", 107 | "outputs": [], 108 | "payable": false, 109 | "stateMutability": "nonpayable", 110 | "type": "function" 111 | }, 112 | { 113 | "constant": false, 114 | "inputs": [ 115 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 116 | { "internalType": "uint256", "name": "data", "type": "uint256" } 117 | ], 118 | "name": "file", 119 | "outputs": [], 120 | "payable": false, 121 | "stateMutability": "nonpayable", 122 | "type": "function" 123 | }, 124 | { 125 | "constant": false, 126 | "inputs": [ 127 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 128 | { "internalType": "address", "name": "addr", "type": "address" } 129 | ], 130 | "name": "file", 131 | "outputs": [], 132 | "payable": false, 133 | "stateMutability": "nonpayable", 134 | "type": "function" 135 | }, 136 | { 137 | "constant": false, 138 | "inputs": [{ "internalType": "uint256", "name": "wad", "type": "uint256" }], 139 | "name": "join", 140 | "outputs": [], 141 | "payable": false, 142 | "stateMutability": "nonpayable", 143 | "type": "function" 144 | }, 145 | { 146 | "constant": true, 147 | "inputs": [], 148 | "name": "live", 149 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 150 | "payable": false, 151 | "stateMutability": "view", 152 | "type": "function" 153 | }, 154 | { 155 | "constant": true, 156 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 157 | "name": "pie", 158 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 159 | "payable": false, 160 | "stateMutability": "view", 161 | "type": "function" 162 | }, 163 | { 164 | "constant": false, 165 | "inputs": [{ "internalType": "address", "name": "guy", "type": "address" }], 166 | "name": "rely", 167 | "outputs": [], 168 | "payable": false, 169 | "stateMutability": "nonpayable", 170 | "type": "function" 171 | }, 172 | { 173 | "constant": true, 174 | "inputs": [], 175 | "name": "rho", 176 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 177 | "payable": false, 178 | "stateMutability": "view", 179 | "type": "function" 180 | }, 181 | { 182 | "constant": true, 183 | "inputs": [], 184 | "name": "vat", 185 | "outputs": [ 186 | { "internalType": "contract VatLike", "name": "", "type": "address" } 187 | ], 188 | "payable": false, 189 | "stateMutability": "view", 190 | "type": "function" 191 | }, 192 | { 193 | "constant": true, 194 | "inputs": [], 195 | "name": "vow", 196 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 197 | "payable": false, 198 | "stateMutability": "view", 199 | "type": "function" 200 | }, 201 | { 202 | "constant": true, 203 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 204 | "name": "wards", 205 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 206 | "payable": false, 207 | "stateMutability": "view", 208 | "type": "function" 209 | } 210 | ] 211 | -------------------------------------------------------------------------------- /abis/Spotter.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" } 5 | ], 6 | "payable": false, 7 | "stateMutability": "nonpayable", 8 | "type": "constructor" 9 | }, 10 | { 11 | "anonymous": true, 12 | "inputs": [ 13 | { 14 | "indexed": true, 15 | "internalType": "bytes4", 16 | "name": "sig", 17 | "type": "bytes4" 18 | }, 19 | { 20 | "indexed": true, 21 | "internalType": "address", 22 | "name": "usr", 23 | "type": "address" 24 | }, 25 | { 26 | "indexed": true, 27 | "internalType": "bytes32", 28 | "name": "arg1", 29 | "type": "bytes32" 30 | }, 31 | { 32 | "indexed": true, 33 | "internalType": "bytes32", 34 | "name": "arg2", 35 | "type": "bytes32" 36 | }, 37 | { 38 | "indexed": false, 39 | "internalType": "bytes", 40 | "name": "data", 41 | "type": "bytes" 42 | } 43 | ], 44 | "name": "LogNote", 45 | "type": "event" 46 | }, 47 | { 48 | "anonymous": false, 49 | "inputs": [ 50 | { 51 | "indexed": false, 52 | "internalType": "bytes32", 53 | "name": "ilk", 54 | "type": "bytes32" 55 | }, 56 | { 57 | "indexed": false, 58 | "internalType": "bytes32", 59 | "name": "val", 60 | "type": "bytes32" 61 | }, 62 | { 63 | "indexed": false, 64 | "internalType": "uint256", 65 | "name": "spot", 66 | "type": "uint256" 67 | } 68 | ], 69 | "name": "Poke", 70 | "type": "event" 71 | }, 72 | { 73 | "constant": false, 74 | "inputs": [], 75 | "name": "cage", 76 | "outputs": [], 77 | "payable": false, 78 | "stateMutability": "nonpayable", 79 | "type": "function" 80 | }, 81 | { 82 | "constant": false, 83 | "inputs": [{ "internalType": "address", "name": "guy", "type": "address" }], 84 | "name": "deny", 85 | "outputs": [], 86 | "payable": false, 87 | "stateMutability": "nonpayable", 88 | "type": "function" 89 | }, 90 | { 91 | "constant": false, 92 | "inputs": [ 93 | { "internalType": "bytes32", "name": "ilk", "type": "bytes32" }, 94 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 95 | { "internalType": "uint256", "name": "data", "type": "uint256" } 96 | ], 97 | "name": "file", 98 | "outputs": [], 99 | "payable": false, 100 | "stateMutability": "nonpayable", 101 | "type": "function" 102 | }, 103 | { 104 | "constant": false, 105 | "inputs": [ 106 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 107 | { "internalType": "uint256", "name": "data", "type": "uint256" } 108 | ], 109 | "name": "file", 110 | "outputs": [], 111 | "payable": false, 112 | "stateMutability": "nonpayable", 113 | "type": "function" 114 | }, 115 | { 116 | "constant": false, 117 | "inputs": [ 118 | { "internalType": "bytes32", "name": "ilk", "type": "bytes32" }, 119 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 120 | { "internalType": "address", "name": "pip_", "type": "address" } 121 | ], 122 | "name": "file", 123 | "outputs": [], 124 | "payable": false, 125 | "stateMutability": "nonpayable", 126 | "type": "function" 127 | }, 128 | { 129 | "constant": true, 130 | "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], 131 | "name": "ilks", 132 | "outputs": [ 133 | { "internalType": "contract PipLike", "name": "pip", "type": "address" }, 134 | { "internalType": "uint256", "name": "mat", "type": "uint256" } 135 | ], 136 | "payable": false, 137 | "stateMutability": "view", 138 | "type": "function" 139 | }, 140 | { 141 | "constant": true, 142 | "inputs": [], 143 | "name": "live", 144 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 145 | "payable": false, 146 | "stateMutability": "view", 147 | "type": "function" 148 | }, 149 | { 150 | "constant": true, 151 | "inputs": [], 152 | "name": "par", 153 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 154 | "payable": false, 155 | "stateMutability": "view", 156 | "type": "function" 157 | }, 158 | { 159 | "constant": false, 160 | "inputs": [{ "internalType": "bytes32", "name": "ilk", "type": "bytes32" }], 161 | "name": "poke", 162 | "outputs": [], 163 | "payable": false, 164 | "stateMutability": "nonpayable", 165 | "type": "function" 166 | }, 167 | { 168 | "constant": false, 169 | "inputs": [{ "internalType": "address", "name": "guy", "type": "address" }], 170 | "name": "rely", 171 | "outputs": [], 172 | "payable": false, 173 | "stateMutability": "nonpayable", 174 | "type": "function" 175 | }, 176 | { 177 | "constant": true, 178 | "inputs": [], 179 | "name": "vat", 180 | "outputs": [ 181 | { "internalType": "contract VatLike", "name": "", "type": "address" } 182 | ], 183 | "payable": false, 184 | "stateMutability": "view", 185 | "type": "function" 186 | }, 187 | { 188 | "constant": true, 189 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 190 | "name": "wards", 191 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 192 | "payable": false, 193 | "stateMutability": "view", 194 | "type": "function" 195 | } 196 | ] 197 | -------------------------------------------------------------------------------- /abis/Vat.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "payable": false, 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "anonymous": true, 10 | "inputs": [ 11 | { 12 | "indexed": true, 13 | "internalType": "bytes4", 14 | "name": "sig", 15 | "type": "bytes4" 16 | }, 17 | { 18 | "indexed": true, 19 | "internalType": "bytes32", 20 | "name": "arg1", 21 | "type": "bytes32" 22 | }, 23 | { 24 | "indexed": true, 25 | "internalType": "bytes32", 26 | "name": "arg2", 27 | "type": "bytes32" 28 | }, 29 | { 30 | "indexed": true, 31 | "internalType": "bytes32", 32 | "name": "arg3", 33 | "type": "bytes32" 34 | }, 35 | { 36 | "indexed": false, 37 | "internalType": "bytes", 38 | "name": "data", 39 | "type": "bytes" 40 | } 41 | ], 42 | "name": "LogNote", 43 | "type": "event" 44 | }, 45 | { 46 | "constant": true, 47 | "inputs": [], 48 | "name": "Line", 49 | "outputs": [ 50 | { 51 | "internalType": "uint256", 52 | "name": "", 53 | "type": "uint256" 54 | } 55 | ], 56 | "payable": false, 57 | "stateMutability": "view", 58 | "type": "function" 59 | }, 60 | { 61 | "constant": false, 62 | "inputs": [], 63 | "name": "cage", 64 | "outputs": [], 65 | "payable": false, 66 | "stateMutability": "nonpayable", 67 | "type": "function" 68 | }, 69 | { 70 | "constant": true, 71 | "inputs": [ 72 | { 73 | "internalType": "address", 74 | "name": "", 75 | "type": "address" 76 | }, 77 | { 78 | "internalType": "address", 79 | "name": "", 80 | "type": "address" 81 | } 82 | ], 83 | "name": "can", 84 | "outputs": [ 85 | { 86 | "internalType": "uint256", 87 | "name": "", 88 | "type": "uint256" 89 | } 90 | ], 91 | "payable": false, 92 | "stateMutability": "view", 93 | "type": "function" 94 | }, 95 | { 96 | "constant": true, 97 | "inputs": [ 98 | { 99 | "internalType": "address", 100 | "name": "", 101 | "type": "address" 102 | } 103 | ], 104 | "name": "dai", 105 | "outputs": [ 106 | { 107 | "internalType": "uint256", 108 | "name": "", 109 | "type": "uint256" 110 | } 111 | ], 112 | "payable": false, 113 | "stateMutability": "view", 114 | "type": "function" 115 | }, 116 | { 117 | "constant": true, 118 | "inputs": [], 119 | "name": "debt", 120 | "outputs": [ 121 | { 122 | "internalType": "uint256", 123 | "name": "", 124 | "type": "uint256" 125 | } 126 | ], 127 | "payable": false, 128 | "stateMutability": "view", 129 | "type": "function" 130 | }, 131 | { 132 | "constant": false, 133 | "inputs": [ 134 | { 135 | "internalType": "address", 136 | "name": "usr", 137 | "type": "address" 138 | } 139 | ], 140 | "name": "deny", 141 | "outputs": [], 142 | "payable": false, 143 | "stateMutability": "nonpayable", 144 | "type": "function" 145 | }, 146 | { 147 | "constant": false, 148 | "inputs": [ 149 | { 150 | "internalType": "bytes32", 151 | "name": "ilk", 152 | "type": "bytes32" 153 | }, 154 | { 155 | "internalType": "bytes32", 156 | "name": "what", 157 | "type": "bytes32" 158 | }, 159 | { 160 | "internalType": "uint256", 161 | "name": "data", 162 | "type": "uint256" 163 | } 164 | ], 165 | "name": "file", 166 | "outputs": [], 167 | "payable": false, 168 | "stateMutability": "nonpayable", 169 | "type": "function" 170 | }, 171 | { 172 | "constant": false, 173 | "inputs": [ 174 | { 175 | "internalType": "bytes32", 176 | "name": "what", 177 | "type": "bytes32" 178 | }, 179 | { 180 | "internalType": "uint256", 181 | "name": "data", 182 | "type": "uint256" 183 | } 184 | ], 185 | "name": "file", 186 | "outputs": [], 187 | "payable": false, 188 | "stateMutability": "nonpayable", 189 | "type": "function" 190 | }, 191 | { 192 | "constant": false, 193 | "inputs": [ 194 | { 195 | "internalType": "bytes32", 196 | "name": "ilk", 197 | "type": "bytes32" 198 | }, 199 | { 200 | "internalType": "address", 201 | "name": "src", 202 | "type": "address" 203 | }, 204 | { 205 | "internalType": "address", 206 | "name": "dst", 207 | "type": "address" 208 | }, 209 | { 210 | "internalType": "uint256", 211 | "name": "wad", 212 | "type": "uint256" 213 | } 214 | ], 215 | "name": "flux", 216 | "outputs": [], 217 | "payable": false, 218 | "stateMutability": "nonpayable", 219 | "type": "function" 220 | }, 221 | { 222 | "constant": false, 223 | "inputs": [ 224 | { 225 | "internalType": "bytes32", 226 | "name": "i", 227 | "type": "bytes32" 228 | }, 229 | { 230 | "internalType": "address", 231 | "name": "u", 232 | "type": "address" 233 | }, 234 | { 235 | "internalType": "int256", 236 | "name": "rate", 237 | "type": "int256" 238 | } 239 | ], 240 | "name": "fold", 241 | "outputs": [], 242 | "payable": false, 243 | "stateMutability": "nonpayable", 244 | "type": "function" 245 | }, 246 | { 247 | "constant": false, 248 | "inputs": [ 249 | { 250 | "internalType": "bytes32", 251 | "name": "ilk", 252 | "type": "bytes32" 253 | }, 254 | { 255 | "internalType": "address", 256 | "name": "src", 257 | "type": "address" 258 | }, 259 | { 260 | "internalType": "address", 261 | "name": "dst", 262 | "type": "address" 263 | }, 264 | { 265 | "internalType": "int256", 266 | "name": "dink", 267 | "type": "int256" 268 | }, 269 | { 270 | "internalType": "int256", 271 | "name": "dart", 272 | "type": "int256" 273 | } 274 | ], 275 | "name": "fork", 276 | "outputs": [], 277 | "payable": false, 278 | "stateMutability": "nonpayable", 279 | "type": "function" 280 | }, 281 | { 282 | "constant": false, 283 | "inputs": [ 284 | { 285 | "internalType": "bytes32", 286 | "name": "i", 287 | "type": "bytes32" 288 | }, 289 | { 290 | "internalType": "address", 291 | "name": "u", 292 | "type": "address" 293 | }, 294 | { 295 | "internalType": "address", 296 | "name": "v", 297 | "type": "address" 298 | }, 299 | { 300 | "internalType": "address", 301 | "name": "w", 302 | "type": "address" 303 | }, 304 | { 305 | "internalType": "int256", 306 | "name": "dink", 307 | "type": "int256" 308 | }, 309 | { 310 | "internalType": "int256", 311 | "name": "dart", 312 | "type": "int256" 313 | } 314 | ], 315 | "name": "frob", 316 | "outputs": [], 317 | "payable": false, 318 | "stateMutability": "nonpayable", 319 | "type": "function" 320 | }, 321 | { 322 | "constant": true, 323 | "inputs": [ 324 | { 325 | "internalType": "bytes32", 326 | "name": "", 327 | "type": "bytes32" 328 | }, 329 | { 330 | "internalType": "address", 331 | "name": "", 332 | "type": "address" 333 | } 334 | ], 335 | "name": "gem", 336 | "outputs": [ 337 | { 338 | "internalType": "uint256", 339 | "name": "", 340 | "type": "uint256" 341 | } 342 | ], 343 | "payable": false, 344 | "stateMutability": "view", 345 | "type": "function" 346 | }, 347 | { 348 | "constant": false, 349 | "inputs": [ 350 | { 351 | "internalType": "bytes32", 352 | "name": "i", 353 | "type": "bytes32" 354 | }, 355 | { 356 | "internalType": "address", 357 | "name": "u", 358 | "type": "address" 359 | }, 360 | { 361 | "internalType": "address", 362 | "name": "v", 363 | "type": "address" 364 | }, 365 | { 366 | "internalType": "address", 367 | "name": "w", 368 | "type": "address" 369 | }, 370 | { 371 | "internalType": "int256", 372 | "name": "dink", 373 | "type": "int256" 374 | }, 375 | { 376 | "internalType": "int256", 377 | "name": "dart", 378 | "type": "int256" 379 | } 380 | ], 381 | "name": "grab", 382 | "outputs": [], 383 | "payable": false, 384 | "stateMutability": "nonpayable", 385 | "type": "function" 386 | }, 387 | { 388 | "constant": false, 389 | "inputs": [ 390 | { 391 | "internalType": "uint256", 392 | "name": "rad", 393 | "type": "uint256" 394 | } 395 | ], 396 | "name": "heal", 397 | "outputs": [], 398 | "payable": false, 399 | "stateMutability": "nonpayable", 400 | "type": "function" 401 | }, 402 | { 403 | "constant": false, 404 | "inputs": [ 405 | { 406 | "internalType": "address", 407 | "name": "usr", 408 | "type": "address" 409 | } 410 | ], 411 | "name": "hope", 412 | "outputs": [], 413 | "payable": false, 414 | "stateMutability": "nonpayable", 415 | "type": "function" 416 | }, 417 | { 418 | "constant": true, 419 | "inputs": [ 420 | { 421 | "internalType": "bytes32", 422 | "name": "", 423 | "type": "bytes32" 424 | } 425 | ], 426 | "name": "ilks", 427 | "outputs": [ 428 | { 429 | "internalType": "uint256", 430 | "name": "Art", 431 | "type": "uint256" 432 | }, 433 | { 434 | "internalType": "uint256", 435 | "name": "rate", 436 | "type": "uint256" 437 | }, 438 | { 439 | "internalType": "uint256", 440 | "name": "spot", 441 | "type": "uint256" 442 | }, 443 | { 444 | "internalType": "uint256", 445 | "name": "line", 446 | "type": "uint256" 447 | }, 448 | { 449 | "internalType": "uint256", 450 | "name": "dust", 451 | "type": "uint256" 452 | } 453 | ], 454 | "payable": false, 455 | "stateMutability": "view", 456 | "type": "function" 457 | }, 458 | { 459 | "constant": false, 460 | "inputs": [ 461 | { 462 | "internalType": "bytes32", 463 | "name": "ilk", 464 | "type": "bytes32" 465 | } 466 | ], 467 | "name": "init", 468 | "outputs": [], 469 | "payable": false, 470 | "stateMutability": "nonpayable", 471 | "type": "function" 472 | }, 473 | { 474 | "constant": true, 475 | "inputs": [], 476 | "name": "live", 477 | "outputs": [ 478 | { 479 | "internalType": "uint256", 480 | "name": "", 481 | "type": "uint256" 482 | } 483 | ], 484 | "payable": false, 485 | "stateMutability": "view", 486 | "type": "function" 487 | }, 488 | { 489 | "constant": false, 490 | "inputs": [ 491 | { 492 | "internalType": "address", 493 | "name": "src", 494 | "type": "address" 495 | }, 496 | { 497 | "internalType": "address", 498 | "name": "dst", 499 | "type": "address" 500 | }, 501 | { 502 | "internalType": "uint256", 503 | "name": "rad", 504 | "type": "uint256" 505 | } 506 | ], 507 | "name": "move", 508 | "outputs": [], 509 | "payable": false, 510 | "stateMutability": "nonpayable", 511 | "type": "function" 512 | }, 513 | { 514 | "constant": false, 515 | "inputs": [ 516 | { 517 | "internalType": "address", 518 | "name": "usr", 519 | "type": "address" 520 | } 521 | ], 522 | "name": "nope", 523 | "outputs": [], 524 | "payable": false, 525 | "stateMutability": "nonpayable", 526 | "type": "function" 527 | }, 528 | { 529 | "constant": false, 530 | "inputs": [ 531 | { 532 | "internalType": "address", 533 | "name": "usr", 534 | "type": "address" 535 | } 536 | ], 537 | "name": "rely", 538 | "outputs": [], 539 | "payable": false, 540 | "stateMutability": "nonpayable", 541 | "type": "function" 542 | }, 543 | { 544 | "constant": true, 545 | "inputs": [ 546 | { 547 | "internalType": "address", 548 | "name": "", 549 | "type": "address" 550 | } 551 | ], 552 | "name": "sin", 553 | "outputs": [ 554 | { 555 | "internalType": "uint256", 556 | "name": "", 557 | "type": "uint256" 558 | } 559 | ], 560 | "payable": false, 561 | "stateMutability": "view", 562 | "type": "function" 563 | }, 564 | { 565 | "constant": false, 566 | "inputs": [ 567 | { 568 | "internalType": "bytes32", 569 | "name": "ilk", 570 | "type": "bytes32" 571 | }, 572 | { 573 | "internalType": "address", 574 | "name": "usr", 575 | "type": "address" 576 | }, 577 | { 578 | "internalType": "int256", 579 | "name": "wad", 580 | "type": "int256" 581 | } 582 | ], 583 | "name": "slip", 584 | "outputs": [], 585 | "payable": false, 586 | "stateMutability": "nonpayable", 587 | "type": "function" 588 | }, 589 | { 590 | "constant": false, 591 | "inputs": [ 592 | { 593 | "internalType": "address", 594 | "name": "u", 595 | "type": "address" 596 | }, 597 | { 598 | "internalType": "address", 599 | "name": "v", 600 | "type": "address" 601 | }, 602 | { 603 | "internalType": "uint256", 604 | "name": "rad", 605 | "type": "uint256" 606 | } 607 | ], 608 | "name": "suck", 609 | "outputs": [], 610 | "payable": false, 611 | "stateMutability": "nonpayable", 612 | "type": "function" 613 | }, 614 | { 615 | "constant": true, 616 | "inputs": [ 617 | { 618 | "internalType": "bytes32", 619 | "name": "", 620 | "type": "bytes32" 621 | }, 622 | { 623 | "internalType": "address", 624 | "name": "", 625 | "type": "address" 626 | } 627 | ], 628 | "name": "urns", 629 | "outputs": [ 630 | { 631 | "internalType": "uint256", 632 | "name": "ink", 633 | "type": "uint256" 634 | }, 635 | { 636 | "internalType": "uint256", 637 | "name": "art", 638 | "type": "uint256" 639 | } 640 | ], 641 | "payable": false, 642 | "stateMutability": "view", 643 | "type": "function" 644 | }, 645 | { 646 | "constant": true, 647 | "inputs": [], 648 | "name": "vice", 649 | "outputs": [ 650 | { 651 | "internalType": "uint256", 652 | "name": "", 653 | "type": "uint256" 654 | } 655 | ], 656 | "payable": false, 657 | "stateMutability": "view", 658 | "type": "function" 659 | }, 660 | { 661 | "constant": true, 662 | "inputs": [ 663 | { 664 | "internalType": "address", 665 | "name": "", 666 | "type": "address" 667 | } 668 | ], 669 | "name": "wards", 670 | "outputs": [ 671 | { 672 | "internalType": "uint256", 673 | "name": "", 674 | "type": "uint256" 675 | } 676 | ], 677 | "payable": false, 678 | "stateMutability": "view", 679 | "type": "function" 680 | } 681 | ] 682 | -------------------------------------------------------------------------------- /abis/Vow.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { "internalType": "address", "name": "vat_", "type": "address" }, 5 | { "internalType": "address", "name": "flapper_", "type": "address" }, 6 | { "internalType": "address", "name": "flopper_", "type": "address" } 7 | ], 8 | "payable": false, 9 | "stateMutability": "nonpayable", 10 | "type": "constructor" 11 | }, 12 | { 13 | "anonymous": true, 14 | "inputs": [ 15 | { 16 | "indexed": true, 17 | "internalType": "bytes4", 18 | "name": "sig", 19 | "type": "bytes4" 20 | }, 21 | { 22 | "indexed": true, 23 | "internalType": "address", 24 | "name": "usr", 25 | "type": "address" 26 | }, 27 | { 28 | "indexed": true, 29 | "internalType": "bytes32", 30 | "name": "arg1", 31 | "type": "bytes32" 32 | }, 33 | { 34 | "indexed": true, 35 | "internalType": "bytes32", 36 | "name": "arg2", 37 | "type": "bytes32" 38 | }, 39 | { 40 | "indexed": false, 41 | "internalType": "bytes", 42 | "name": "data", 43 | "type": "bytes" 44 | } 45 | ], 46 | "name": "LogNote", 47 | "type": "event" 48 | }, 49 | { 50 | "constant": true, 51 | "inputs": [], 52 | "name": "Ash", 53 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 54 | "payable": false, 55 | "stateMutability": "view", 56 | "type": "function" 57 | }, 58 | { 59 | "constant": true, 60 | "inputs": [], 61 | "name": "Sin", 62 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 63 | "payable": false, 64 | "stateMutability": "view", 65 | "type": "function" 66 | }, 67 | { 68 | "constant": true, 69 | "inputs": [], 70 | "name": "bump", 71 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 72 | "payable": false, 73 | "stateMutability": "view", 74 | "type": "function" 75 | }, 76 | { 77 | "constant": false, 78 | "inputs": [], 79 | "name": "cage", 80 | "outputs": [], 81 | "payable": false, 82 | "stateMutability": "nonpayable", 83 | "type": "function" 84 | }, 85 | { 86 | "constant": false, 87 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 88 | "name": "deny", 89 | "outputs": [], 90 | "payable": false, 91 | "stateMutability": "nonpayable", 92 | "type": "function" 93 | }, 94 | { 95 | "constant": true, 96 | "inputs": [], 97 | "name": "dump", 98 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 99 | "payable": false, 100 | "stateMutability": "view", 101 | "type": "function" 102 | }, 103 | { 104 | "constant": false, 105 | "inputs": [{ "internalType": "uint256", "name": "tab", "type": "uint256" }], 106 | "name": "fess", 107 | "outputs": [], 108 | "payable": false, 109 | "stateMutability": "nonpayable", 110 | "type": "function" 111 | }, 112 | { 113 | "constant": false, 114 | "inputs": [ 115 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 116 | { "internalType": "uint256", "name": "data", "type": "uint256" } 117 | ], 118 | "name": "file", 119 | "outputs": [], 120 | "payable": false, 121 | "stateMutability": "nonpayable", 122 | "type": "function" 123 | }, 124 | { 125 | "constant": false, 126 | "inputs": [ 127 | { "internalType": "bytes32", "name": "what", "type": "bytes32" }, 128 | { "internalType": "address", "name": "data", "type": "address" } 129 | ], 130 | "name": "file", 131 | "outputs": [], 132 | "payable": false, 133 | "stateMutability": "nonpayable", 134 | "type": "function" 135 | }, 136 | { 137 | "constant": false, 138 | "inputs": [], 139 | "name": "flap", 140 | "outputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 141 | "payable": false, 142 | "stateMutability": "nonpayable", 143 | "type": "function" 144 | }, 145 | { 146 | "constant": true, 147 | "inputs": [], 148 | "name": "flapper", 149 | "outputs": [ 150 | { "internalType": "contract FlapLike", "name": "", "type": "address" } 151 | ], 152 | "payable": false, 153 | "stateMutability": "view", 154 | "type": "function" 155 | }, 156 | { 157 | "constant": false, 158 | "inputs": [{ "internalType": "uint256", "name": "era", "type": "uint256" }], 159 | "name": "flog", 160 | "outputs": [], 161 | "payable": false, 162 | "stateMutability": "nonpayable", 163 | "type": "function" 164 | }, 165 | { 166 | "constant": false, 167 | "inputs": [], 168 | "name": "flop", 169 | "outputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], 170 | "payable": false, 171 | "stateMutability": "nonpayable", 172 | "type": "function" 173 | }, 174 | { 175 | "constant": true, 176 | "inputs": [], 177 | "name": "flopper", 178 | "outputs": [ 179 | { "internalType": "contract FlopLike", "name": "", "type": "address" } 180 | ], 181 | "payable": false, 182 | "stateMutability": "view", 183 | "type": "function" 184 | }, 185 | { 186 | "constant": false, 187 | "inputs": [{ "internalType": "uint256", "name": "rad", "type": "uint256" }], 188 | "name": "heal", 189 | "outputs": [], 190 | "payable": false, 191 | "stateMutability": "nonpayable", 192 | "type": "function" 193 | }, 194 | { 195 | "constant": true, 196 | "inputs": [], 197 | "name": "hump", 198 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 199 | "payable": false, 200 | "stateMutability": "view", 201 | "type": "function" 202 | }, 203 | { 204 | "constant": false, 205 | "inputs": [{ "internalType": "uint256", "name": "rad", "type": "uint256" }], 206 | "name": "kiss", 207 | "outputs": [], 208 | "payable": false, 209 | "stateMutability": "nonpayable", 210 | "type": "function" 211 | }, 212 | { 213 | "constant": true, 214 | "inputs": [], 215 | "name": "live", 216 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 217 | "payable": false, 218 | "stateMutability": "view", 219 | "type": "function" 220 | }, 221 | { 222 | "constant": false, 223 | "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }], 224 | "name": "rely", 225 | "outputs": [], 226 | "payable": false, 227 | "stateMutability": "nonpayable", 228 | "type": "function" 229 | }, 230 | { 231 | "constant": true, 232 | "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 233 | "name": "sin", 234 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 235 | "payable": false, 236 | "stateMutability": "view", 237 | "type": "function" 238 | }, 239 | { 240 | "constant": true, 241 | "inputs": [], 242 | "name": "sump", 243 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 244 | "payable": false, 245 | "stateMutability": "view", 246 | "type": "function" 247 | }, 248 | { 249 | "constant": true, 250 | "inputs": [], 251 | "name": "vat", 252 | "outputs": [ 253 | { "internalType": "contract VatLike", "name": "", "type": "address" } 254 | ], 255 | "payable": false, 256 | "stateMutability": "view", 257 | "type": "function" 258 | }, 259 | { 260 | "constant": true, 261 | "inputs": [], 262 | "name": "wait", 263 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 264 | "payable": false, 265 | "stateMutability": "view", 266 | "type": "function" 267 | }, 268 | { 269 | "constant": true, 270 | "inputs": [{ "internalType": "address", "name": "", "type": "address" }], 271 | "name": "wards", 272 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 273 | "payable": false, 274 | "stateMutability": "view", 275 | "type": "function" 276 | } 277 | ] 278 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "maker-protocol-subgraph", 3 | "version": "0.1.0", 4 | "private": true, 5 | "license": "GPL-3.0-only", 6 | "author": "Sebastián Galiano ", 7 | "scripts": { 8 | "auth": "graph auth https://api.thegraph.com/deploy/", 9 | "build": "graph build", 10 | "codegen": "graph codegen", 11 | "create-local": "graph create --node http://localhost:8020/ protofire/maker-protocol", 12 | "deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ protofire/maker-protocol", 13 | "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 protofire/maker-protocol", 14 | "remove-local": "graph remove --node http://localhost:8020/ protofire/maker-protocol" 15 | }, 16 | "dependencies": { 17 | "@graphprotocol/graph-cli": "0.19.0", 18 | "@graphprotocol/graph-ts": "0.19.0", 19 | "@protofire/subgraph-toolkit": "0.1.1" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@protofire/subgraph-toolkit/prettier.config.js') 2 | -------------------------------------------------------------------------------- /schema.graphql: -------------------------------------------------------------------------------- 1 | " Collateral auctions are used to sell collateral from Vaults that have become undercollateralized " 2 | type CollateralAuction @entity { 3 | id: ID! 4 | 5 | " Collateral type " 6 | collateral: CollateralType! 7 | 8 | # TODO 9 | } 10 | 11 | " Particular collateral type registered in the system (Ilk) " 12 | type CollateralType @entity { 13 | " Collateral type name " 14 | id: ID! 15 | 16 | # 17 | # Debt 18 | # 19 | 20 | " Debt ceiling [DAI] (line) " 21 | debtCeiling: BigDecimal! 22 | 23 | " Debt backed by this collateral type [DAI] (Art)" 24 | debtNormalized: BigDecimal! 25 | 26 | " Asset/DAI exchange rate (rate) " 27 | rate: BigDecimal! 28 | 29 | " Total assets locked as collateral" 30 | totalCollateral: BigDecimal! 31 | 32 | " Total debt backed by this collateral type [DAI] (Ilk.Art * rate)" 33 | totalDebt: BigDecimal! 34 | 35 | # 36 | # Liquidation parameters 37 | # 38 | 39 | " Maximum size of collateral that can be auctioned at once (lump) " 40 | liquidationLotSize: BigDecimal! 41 | 42 | " Liquidation penalty (chop) " 43 | liquidationPenalty: BigDecimal! 44 | 45 | " Min collateralization ratio " 46 | liquidationRatio: BigDecimal! 47 | 48 | # 49 | # Collateral auctions 50 | # 51 | 52 | " Collateral auctions for this collateral type " 53 | auctions: [CollateralAuction!] @derivedFrom(field: "collateral") 54 | 55 | " Number of collateral auctions started for this collateral type " 56 | auctionCount: BigInt! 57 | 58 | " Maximum auction duration [seconds] " 59 | auctionDuration: BigInt! 60 | 61 | " Max bid duration in a collateral auction [seconds] " 62 | bidDuration: BigInt! 63 | 64 | " Minimum bid increase in a collateral auction " 65 | minimumBidIncrease: BigDecimal! 66 | 67 | # 68 | # Stability rates 69 | # 70 | 71 | " Stability fee rate per second " 72 | stabilityFee: BigDecimal! 73 | 74 | # 75 | # Vaults 76 | # 77 | 78 | " Collateral auctions for this collateral type " 79 | vaults: [Vault!] @derivedFrom(field: "collateralType") 80 | 81 | " Min debt per vault [DAI] (dust) " 82 | vaultDebtFloor: BigDecimal! 83 | 84 | " Number of vaults opened through the manager (CdpManager) " 85 | vaultCount: BigInt! 86 | 87 | " Number of vaults NOT opened through the manager (CdpManager) " 88 | unmanagedVaultCount: BigInt! 89 | 90 | # 91 | # Asset price 92 | # 93 | 94 | " Current market price [USD] " 95 | price: CollateralPrice 96 | 97 | " Price history " 98 | prices: [CollateralPrice!] @derivedFrom(field: "collateral") 99 | 100 | # 101 | # Status fields 102 | # 103 | 104 | " Timestamp of the block in which this collateral type was added [seconds] " 105 | addedAt: BigInt! 106 | 107 | " Block number in which this collateral type was added " 108 | addedAtBlock: BigInt! 109 | 110 | " Transaction hash in which this collateral type was added " 111 | addedAtTransaction: Bytes! 112 | 113 | " Timestamp of the block in which this collateral type was last modified [seconds] " 114 | modifiedAt: BigInt 115 | 116 | " Block number in which this collateral type was last modified " 117 | modifiedAtBlock: BigInt 118 | 119 | " Transaction hash in which this collateral type was last modified " 120 | modifiedAtTransaction: Bytes 121 | } 122 | 123 | " Collateral market price at a given block " 124 | type CollateralPrice @entity { 125 | " Equals to: -" 126 | id: ID! 127 | 128 | " Block number " 129 | block: BigInt! 130 | 131 | " Collateral type " 132 | collateral: CollateralType! 133 | 134 | " Market price with safety margin (current price less liquidation ratio) [USD] (spot) " 135 | spotPrice: BigDecimal! 136 | 137 | " Timestamp in seconds " 138 | timestamp: BigInt! 139 | 140 | " Price value " 141 | value: BigDecimal! 142 | } 143 | 144 | " Vault owner " 145 | type User @entity { 146 | " Equals to account address " 147 | id: ID! 148 | 149 | " Account address " 150 | address: Bytes! 151 | 152 | " Number of user proxies associated to the user " 153 | proxyCount: BigInt! 154 | 155 | " Number of vaults opened by the user " 156 | vaultCount: BigInt! 157 | 158 | " User proxies. Up to one per collateral type " 159 | proxies: [UserProxy!] @derivedFrom(field: "owner") 160 | 161 | " User's vaults " 162 | vaults: [Vault!] @derivedFrom(field: "owner") 163 | } 164 | 165 | " Contract used to execute transactions and sequences of transactions on behalf of a user " 166 | type UserProxy @entity { 167 | " Proxy address " 168 | id: ID! 169 | 170 | " Proxy contract address " 171 | address: Bytes! 172 | 173 | " Cache contract address " 174 | cache: Bytes! 175 | 176 | " User reference " 177 | owner: User! 178 | } 179 | 180 | " Provide information about the current system state and parameters " 181 | type SystemState @entity { 182 | " Singleton entity. Equals to 'current' " 183 | id: ID! 184 | 185 | # 186 | # General protocol stats 187 | # 188 | 189 | " Total debt issued [DAI] (Vat.debt)" 190 | totalDebt: BigDecimal! 191 | 192 | # 193 | # About number of entities registered system-wide 194 | # 195 | 196 | " Number of collateral types registered " 197 | collateralCount: BigInt! 198 | 199 | " Number of collateral auctions started " 200 | collateralAuctionCount: BigInt! 201 | 202 | " Number of user proxies created " 203 | userProxyCount: BigInt! 204 | 205 | " Number of vaults NOT opened through the manager (CdpManager) " 206 | unmanagedVaultCount: BigInt! 207 | 208 | " Number of vaults opened through the manager (CdpManager) " 209 | vaultCount: BigInt! 210 | 211 | # 212 | # General system parameters 213 | # 214 | 215 | " Base rate for stability fee per second " 216 | baseStabilityFee: BigDecimal! 217 | 218 | " Dai Savings Rate " 219 | savingsRate: BigDecimal! 220 | 221 | " Total Debt Ceiling " 222 | totalDebtCeiling: BigDecimal! 223 | 224 | # 225 | # Debt auction parameters (flop) 226 | # 227 | 228 | " Max bid duration / single bid lifetime [seconds] " 229 | debtAuctionBidDuration: BigInt 230 | 231 | " The fixed debt quantity to be covered by any one debt auction [DAI] " 232 | debtAuctionBidSize: BigDecimal 233 | 234 | " Debt auction delay [seconds] " 235 | debtAuctionDelay: BigInt 236 | 237 | " Maximum auction duration [seconds] " 238 | debtAuctionDuration: BigInt 239 | 240 | " The starting amount of MKR offered to cover the lot [MKR] " 241 | debtAuctionInitialLotSize: BigDecimal 242 | 243 | " Lot size increase " 244 | debtAuctionLotSizeIncrease: BigDecimal 245 | 246 | " Minimum bid increase " 247 | debtAuctionMinimumBidIncrease: BigDecimal 248 | 249 | # 250 | # Surplus auction parameters (flap) 251 | # 252 | 253 | " Max bid duration / bid lifetime [seconds] " 254 | surplusAuctionBidDuration: BigInt 255 | 256 | " Surplus buffer, must be exceeded before surplus auctions are possible [DAI] " 257 | surplusAuctionBuffer: BigDecimal 258 | 259 | " Maximum auction duration [seconds] " 260 | surplusAuctionDuration: BigInt 261 | 262 | " The fixed surplus quantity to be sold by any one surplus auction [DAI] " 263 | surplusAuctionLotSize: BigDecimal 264 | 265 | " Minimum bid increase " 266 | surplusAuctionMinimumBidIncrease: BigDecimal 267 | 268 | # 269 | # Status fields 270 | # 271 | 272 | " The latest block in which a system parameters was modified " 273 | block: BigInt! 274 | 275 | " The latest timestamp in which a system parameters was modified " 276 | timestamp: BigInt! 277 | 278 | " The latest transaction hash in which a system parameters was modified " 279 | transaction: Bytes! 280 | } 281 | 282 | " Maker Vault (formerly collateralized debt position or CDPs) " 283 | type Vault @entity { 284 | " Equals to: -" 285 | id: ID! 286 | 287 | " CDP ID if this vault was created through the manager (CdpManager) " 288 | cdpId: BigInt 289 | 290 | " Collateral type associated to this vault (ilk) " 291 | collateralType: CollateralType! 292 | 293 | " Assets locked as collateral (ink) " 294 | collateral: BigDecimal! 295 | 296 | " Outstanding debt (art) [DAI] " 297 | debt: BigDecimal! 298 | 299 | " Address of this vault's UrnHandler instance " 300 | handler: Bytes! 301 | 302 | " Address of vault's owner " 303 | owner: User! 304 | 305 | " Timestamp of the block in which this vault was opened [seconds] " 306 | openedAt: BigInt! 307 | 308 | " Block number in which this vault was opened " 309 | openedAtBlock: BigInt! 310 | 311 | " Transaction hash in which this vault was opened " 312 | openedAtTransaction: Bytes! 313 | 314 | " Timestamp of the block in which this vault was last modified [seconds] " 315 | modifiedAt: BigInt 316 | 317 | " Block number in which this vault was last modified " 318 | modifiedAtBlock: BigInt 319 | 320 | " Transaction hash in which this vault was last modified " 321 | modifiedAtTransaction: Bytes 322 | 323 | " Vault action history " 324 | logs: [VaultLog!] @derivedFrom(field: "vault") 325 | } 326 | 327 | interface VaultLog { 328 | vault: Vault! 329 | block: BigInt! 330 | timestamp: BigInt! 331 | transaction: Bytes! 332 | } 333 | 334 | type VaultCreationLog implements VaultLog @entity { 335 | id: ID! 336 | vault: Vault! 337 | block: BigInt! 338 | timestamp: BigInt! 339 | transaction: Bytes! 340 | } 341 | 342 | type VaultCollateralChangeLog implements VaultLog @entity { 343 | id: ID! 344 | vault: Vault! 345 | collateralBefore: BigDecimal! 346 | collateralAfter: BigDecimal! 347 | collateralDiff: BigDecimal! 348 | block: BigInt! 349 | timestamp: BigInt! 350 | transaction: Bytes! 351 | } 352 | 353 | type VaultDebtChangeLog implements VaultLog @entity { 354 | id: ID! 355 | vault: Vault! 356 | debtBefore: BigDecimal! 357 | debtAfter: BigDecimal! 358 | debtDiff: BigDecimal! 359 | block: BigInt! 360 | timestamp: BigInt! 361 | transaction: Bytes! 362 | } 363 | 364 | type VaultSplitChangeLog 365 | @entity { # implements VaultLog @entity { 366 | id: ID! 367 | #vault: Vault! 368 | src: Bytes! 369 | dst: Bytes! 370 | collateralToMove: BigDecimal! 371 | debtToMove: BigDecimal! 372 | block: BigInt! 373 | timestamp: BigInt! 374 | transaction: Bytes! 375 | } 376 | 377 | type VaultTransferChangeLog implements VaultLog @entity { 378 | id: ID! 379 | vault: Vault! 380 | previousOwner: User! 381 | nextOwner: User! 382 | block: BigInt! 383 | timestamp: BigInt! 384 | transaction: Bytes! 385 | } 386 | -------------------------------------------------------------------------------- /src/entities/index.ts: -------------------------------------------------------------------------------- 1 | export * from '../../generated/schema' 2 | 3 | export { getSystemState } from './system' 4 | export { getOrCreateUser } from './user' 5 | -------------------------------------------------------------------------------- /src/entities/system.ts: -------------------------------------------------------------------------------- 1 | import { ethereum, Address } from '@graphprotocol/graph-ts' 2 | import { decimal, integer, units } from '@protofire/subgraph-toolkit' 3 | 4 | import { SystemState } from '../../generated/schema' 5 | import { Vat } from '../../generated/Vat/Vat' 6 | 7 | export function getSystemState(event: ethereum.Event): SystemState { 8 | let vatContract = Vat.bind(Address.fromString('0x35d1b3f3d7966a1dfe207aa4514c12a259a0492b')); 9 | let state = SystemState.load('current') 10 | 11 | if (state == null) { 12 | state = new SystemState('current') 13 | 14 | state.totalDebt = decimal.ZERO 15 | 16 | // Entities counters 17 | state.collateralCount = integer.ZERO 18 | state.collateralAuctionCount = integer.ZERO 19 | state.userProxyCount = integer.ZERO 20 | state.unmanagedVaultCount = integer.ZERO 21 | state.vaultCount = integer.ZERO 22 | 23 | // System parameters 24 | state.baseStabilityFee = decimal.ONE 25 | state.savingsRate = decimal.ONE 26 | state.totalDebtCeiling = decimal.ZERO 27 | } 28 | 29 | // Hotfix for totalDebt 30 | let debt = vatContract.try_debt(); 31 | state.totalDebt = debt.reverted ? state.totalDebt : units.fromRad(debt.value); 32 | state.block = event.block.number 33 | state.timestamp = event.block.timestamp 34 | state.transaction = event.transaction.hash 35 | 36 | return state as SystemState 37 | } 38 | -------------------------------------------------------------------------------- /src/entities/user.ts: -------------------------------------------------------------------------------- 1 | import { Address } from '@graphprotocol/graph-ts' 2 | import { integer } from '@protofire/subgraph-toolkit' 3 | 4 | import { User, UserProxy } from '../../generated/schema' 5 | 6 | export function getOrCreateUser(address: Address): User { 7 | let user = User.load(address.toHexString()) 8 | 9 | if (user == null) { 10 | let proxy = UserProxy.load(address.toHexString()) 11 | 12 | if (proxy != null) { 13 | user = User.load(proxy.owner) 14 | } else { 15 | user = new User(address.toHexString()) 16 | user.address = address 17 | user.proxyCount = integer.ZERO 18 | user.vaultCount = integer.ZERO 19 | } 20 | } 21 | 22 | return user as User 23 | } 24 | -------------------------------------------------------------------------------- /src/mappings/modules/collateral/flip.ts: -------------------------------------------------------------------------------- 1 | import { dataSource } from '@graphprotocol/graph-ts' 2 | import { bytes, integer, units } from '@protofire/subgraph-toolkit' 3 | 4 | import { Kick, LogNote } from '../../../../generated/templates/Flip/Flipper' 5 | 6 | import { CollateralAuction, CollateralType, getSystemState } from '../../../entities' 7 | 8 | export function handleFile(event: LogNote): void { 9 | let ilk = dataSource.context().getString('collateral') 10 | let collateral = CollateralType.load(ilk) 11 | 12 | if (collateral != null) { 13 | let what = event.params.arg1.toString() 14 | let data = bytes.toUnsignedInt(event.params.arg2) 15 | 16 | if (what == 'beg') { 17 | collateral.minimumBidIncrease = units.fromWad(data) 18 | } else if (what == 'ttl') { 19 | collateral.bidDuration = data 20 | } else if (what == 'tau') { 21 | collateral.auctionDuration = data 22 | } 23 | 24 | collateral.save() 25 | } 26 | } 27 | 28 | export function handleKick(event: Kick): void { 29 | let ilk = dataSource.context().getString('collateral') 30 | let collateral = CollateralType.load(ilk) 31 | 32 | if (collateral != null) { 33 | // TODO: Save new auction data 34 | let bid = new CollateralAuction(event.params.id.toString()) 35 | bid.collateral = collateral.id 36 | 37 | collateral.auctionCount = collateral.auctionCount.plus(integer.ONE) 38 | 39 | bid.save() 40 | collateral.save() 41 | 42 | // Update system state 43 | let state = getSystemState(event) 44 | state.collateralAuctionCount = state.collateralAuctionCount.plus(integer.ONE) 45 | state.save() 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/mappings/modules/core/cat.ts: -------------------------------------------------------------------------------- 1 | import { Bytes, DataSourceContext } from '@graphprotocol/graph-ts' 2 | import { bytes, decimal, units } from '@protofire/subgraph-toolkit' 3 | 4 | import { Bite, LogNote } from '../../../../generated/Cat/Cat' 5 | import { Flip } from '../../../../generated/templates' 6 | 7 | import { CollateralType } from '../../../entities' 8 | 9 | export function handleFile(event: LogNote): void { 10 | let ilk = event.params.arg1.toString() 11 | let what = event.params.arg2.toString() 12 | let signature = event.params.sig.toHexString() 13 | 14 | if (signature == '0x1a0b287e') { 15 | let collateral = CollateralType.load(ilk) 16 | 17 | if (collateral != null) { 18 | let data = bytes.toUnsignedInt(event.params.data.subarray(68, 100)) 19 | 20 | if (what == 'chop') { 21 | collateral.liquidationPenalty = units.fromRay(data) 22 | } else if (what == 'lump') { 23 | collateral.liquidationLotSize = units.fromWad(data) 24 | } 25 | 26 | collateral.save() 27 | } 28 | } else if (signature == '0xebecb39d') { 29 | let flip = bytes.toAddress(event.params.data.subarray(68, 100)) 30 | 31 | // Create dynamic data source for collateral liquidator 32 | let context = new DataSourceContext() 33 | context.setString('collateral', ilk) 34 | 35 | Flip.createWithContext(flip, context) 36 | } 37 | } 38 | 39 | export function handleBite(event: Bite): void { 40 | // TODO 41 | } 42 | -------------------------------------------------------------------------------- /src/mappings/modules/core/spot.ts: -------------------------------------------------------------------------------- 1 | import { Bytes } from '@graphprotocol/graph-ts' 2 | import { bytes, units } from '@protofire/subgraph-toolkit' 3 | 4 | import { LogNote, Poke } from '../../../../generated/Spot/Spotter' 5 | import { CollateralPrice, CollateralType } from '../../../../generated/schema' 6 | 7 | import { getSystemState } from '../../../entities' 8 | 9 | export function handleFile(event: LogNote): void { 10 | let ilk = event.params.arg1.toString() 11 | let what = event.params.arg2.toString() 12 | let data = bytes.toUnsignedInt(event.params.data.subarray(68, 100)) 13 | 14 | if (what == 'mat') { 15 | let collateral = CollateralType.load(ilk) 16 | 17 | if (collateral != null) { 18 | collateral.liquidationRatio = units.fromRay(data) 19 | 20 | collateral.modifiedAt = event.block.timestamp 21 | collateral.modifiedAtBlock = event.block.number 22 | collateral.modifiedAtTransaction = event.transaction.hash 23 | 24 | collateral.save() 25 | 26 | let state = getSystemState(event) 27 | state.save() 28 | } 29 | } 30 | } 31 | 32 | export function handlePoke(event: Poke): void { 33 | let ilk = event.params.ilk.toString() 34 | let val = bytes.toUnsignedInt(event.params.val) 35 | 36 | let collateral = CollateralType.load(ilk) 37 | 38 | if (collateral != null) { 39 | let price = new CollateralPrice(event.block.number.toString() + '-' + ilk) 40 | price.block = event.block.number 41 | price.collateral = collateral.id 42 | price.spotPrice = units.fromRay(event.params.spot) 43 | price.timestamp = event.block.timestamp 44 | price.value = units.fromWad(val) 45 | price.save() 46 | 47 | collateral.price = price.id 48 | collateral.save() 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/mappings/modules/core/vat.ts: -------------------------------------------------------------------------------- 1 | import { Bytes } from '@graphprotocol/graph-ts' 2 | import { bytes, integer, decimal, units } from '@protofire/subgraph-toolkit' 3 | 4 | import { LogNote } from '../../../../generated/Vat/Vat' 5 | 6 | import { 7 | CollateralType, 8 | Vault, 9 | VaultCreationLog, 10 | VaultCollateralChangeLog, 11 | VaultDebtChangeLog, 12 | VaultSplitChangeLog, 13 | } from '../../../../generated/schema' 14 | 15 | import { getOrCreateUser, getSystemState } from '../../../entities' 16 | 17 | // Register a new collateral type 18 | export function handleInit(event: LogNote): void { 19 | let collateral = new CollateralType(event.params.arg1.toString()) 20 | collateral.debtCeiling = decimal.ZERO 21 | collateral.vaultDebtFloor = decimal.ZERO 22 | collateral.totalCollateral = decimal.ZERO 23 | collateral.totalDebt = decimal.ZERO 24 | collateral.debtNormalized = decimal.ZERO 25 | 26 | collateral.auctionCount = integer.ZERO 27 | collateral.auctionDuration = integer.fromNumber(172800) // 2 days 28 | collateral.bidDuration = integer.fromNumber(10800) // 3 hours 29 | collateral.minimumBidIncrease = decimal.fromNumber(1.05) // 5% minimum bid increase 30 | 31 | collateral.liquidationLotSize = decimal.ZERO 32 | collateral.liquidationPenalty = decimal.ZERO 33 | collateral.liquidationRatio = decimal.ZERO 34 | 35 | collateral.rate = decimal.ONE 36 | 37 | collateral.stabilityFee = decimal.ONE 38 | 39 | collateral.unmanagedVaultCount = integer.ZERO 40 | collateral.vaultCount = integer.ZERO 41 | 42 | collateral.addedAt = event.block.timestamp 43 | collateral.addedAtBlock = event.block.number 44 | collateral.addedAtTransaction = event.transaction.hash 45 | 46 | collateral.save() 47 | 48 | // Update system state 49 | let state = getSystemState(event) 50 | state.collateralCount = state.collateralCount.plus(integer.ONE) 51 | state.save() 52 | } 53 | 54 | // Modify collateral type parameters 55 | export function handleFile(event: LogNote): void { 56 | let signature = event.params.sig.toHexString() 57 | let system = getSystemState(event) 58 | 59 | if (signature == '0x29ae8114') { 60 | let what = event.params.arg1.toString() 61 | let data = bytes.toUnsignedInt(event.params.arg2) 62 | 63 | if (what == 'Line') { 64 | system.totalDebtCeiling = units.fromRad(data) 65 | } 66 | } else if (signature == '0x1a0b287e') { 67 | let ilk = event.params.arg1.toString() 68 | let what = event.params.arg2.toString() 69 | let data = bytes.toUnsignedInt(event.params.arg3) 70 | 71 | let collateral = CollateralType.load(ilk) 72 | 73 | if (collateral != null) { 74 | if (what == 'spot') { 75 | // Spot price is stored on the current price object 76 | } else if (what == 'line') { 77 | collateral.debtCeiling = units.fromRad(data) 78 | } else if (what == 'dust') { 79 | collateral.vaultDebtFloor = units.fromRad(data) 80 | } 81 | 82 | collateral.modifiedAt = event.block.timestamp 83 | collateral.modifiedAtBlock = event.block.number 84 | collateral.modifiedAtTransaction = event.transaction.hash 85 | 86 | collateral.save() 87 | } 88 | } 89 | 90 | system.save() 91 | } 92 | 93 | // Modify a user's collateral balance 94 | export function handleSlip(event: LogNote): void { 95 | // TODO 96 | } 97 | 98 | // Transfer collateral between users 99 | export function handleFlux(event: LogNote): void { 100 | // TODO 101 | } 102 | 103 | // Transfer stablecoin between users 104 | export function handleMove(event: LogNote): void { 105 | // TODO 106 | } 107 | 108 | // Create or modify a Vault 109 | export function handleFrob(event: LogNote): void { 110 | let ilk = event.params.arg1.toString() 111 | let urn = bytes.toAddress(event.params.arg2) 112 | let dink = bytes.toSignedInt(event.params.data.subarray(132, 164)) 113 | let dart = bytes.toSignedInt(event.params.data.subarray(164, 196)) 114 | 115 | let collateral = CollateralType.load(ilk) 116 | 117 | if (collateral != null) { 118 | let system = getSystemState(event) 119 | 120 | let Δdebt = units.fromWad(dart) 121 | let Δcollateral = units.fromWad(dink) 122 | 123 | let vault = Vault.load(urn.toHexString() + '-' + collateral.id) 124 | 125 | if (vault == null) { 126 | let owner = getOrCreateUser(urn) 127 | owner.vaultCount = owner.vaultCount.plus(integer.ONE) 128 | owner.save() 129 | 130 | // Register new unmanaged vault 131 | vault = new Vault(urn.toHexString() + '-' + collateral.id) 132 | vault.collateralType = collateral.id 133 | vault.collateral = decimal.ZERO 134 | vault.debt = decimal.ZERO 135 | vault.handler = urn 136 | vault.owner = owner.id 137 | 138 | vault.openedAt = event.block.timestamp 139 | vault.openedAtBlock = event.block.number 140 | vault.openedAtTransaction = event.transaction.hash 141 | 142 | collateral.unmanagedVaultCount = collateral.unmanagedVaultCount.plus(integer.ONE) 143 | 144 | system.unmanagedVaultCount = system.unmanagedVaultCount.plus(integer.ONE) 145 | 146 | // Log vault creation 147 | let log = new VaultCreationLog(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + '-0') 148 | log.vault = vault.id 149 | 150 | log.block = event.block.number 151 | log.timestamp = event.block.timestamp 152 | log.transaction = event.transaction.hash 153 | 154 | log.save() 155 | } else { 156 | let previousCollateral = vault.collateral 157 | let previousDebt = vault.debt 158 | 159 | // Update existing Vault 160 | vault.collateral = vault.collateral.plus(Δcollateral) 161 | 162 | // We are adding normalized debt values. Not sure whether multiplying by rate works here. 163 | vault.debt = vault.debt.plus(Δdebt) 164 | 165 | vault.modifiedAt = event.block.timestamp 166 | vault.modifiedAtBlock = event.block.number 167 | vault.modifiedAtTransaction = event.transaction.hash 168 | 169 | if (!Δcollateral.equals(decimal.ZERO)) { 170 | let log = new VaultCollateralChangeLog(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + '-1') 171 | log.vault = vault.id 172 | log.collateralBefore = previousCollateral 173 | log.collateralAfter = vault.collateral 174 | log.collateralDiff = Δcollateral 175 | 176 | log.block = event.block.number 177 | log.timestamp = event.block.timestamp 178 | log.transaction = event.transaction.hash 179 | 180 | log.save() 181 | } 182 | 183 | if (!Δdebt.equals(decimal.ZERO)) { 184 | let log = new VaultDebtChangeLog(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + '-2') 185 | log.vault = vault.id 186 | log.debtBefore = previousDebt 187 | log.debtAfter = vault.debt 188 | log.debtDiff = Δdebt 189 | 190 | log.block = event.block.number 191 | log.timestamp = event.block.timestamp 192 | log.transaction = event.transaction.hash 193 | 194 | log.save() 195 | } 196 | } 197 | 198 | // Track total collateral 199 | collateral.totalCollateral = collateral.totalCollateral + Δcollateral 200 | 201 | // Debt normalized should coincide with Ilk.Art 202 | collateral.debtNormalized = collateral.debtNormalized + Δdebt 203 | 204 | // Total debt is Art * rate (like on DAIStats) 205 | collateral.totalDebt = collateral.debtNormalized * collateral.rate 206 | 207 | collateral.modifiedAt = event.block.timestamp 208 | collateral.modifiedAtBlock = event.block.number 209 | collateral.modifiedAtTransaction = event.transaction.hash 210 | 211 | vault.save() 212 | collateral.save() 213 | system.save() 214 | } 215 | } 216 | 217 | // Split a Vault - binary approval or splitting/merging Vaults 218 | export function handleFork(event: LogNote): void { 219 | let ilk = event.params.arg1.toString() 220 | let src = bytes.toAddress(event.params.arg2) 221 | let dst = bytes.toAddress(event.params.arg3) 222 | let dink = bytes.toSignedInt(event.params.data.subarray(100, 132)) 223 | let dart = bytes.toSignedInt(event.params.data.subarray(132, 164)) 224 | 225 | let log = new VaultSplitChangeLog(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + '-3') 226 | log.src = src 227 | log.dst = dst 228 | log.collateralToMove = units.fromWad(dink) 229 | log.debtToMove = units.fromWad(dart) 230 | 231 | log.block = event.block.number 232 | log.timestamp = event.block.timestamp 233 | log.transaction = event.transaction.hash 234 | 235 | log.save() 236 | } 237 | 238 | // Liquidate a Vault 239 | export function handleGrab(event: LogNote): void { 240 | let ilk = event.params.arg1.toString() 241 | // let urn = bytes.toAddress(event.params.arg2) 242 | // let dink = bytes.toSignedInt(event.params.data.subarray(132, 164)) 243 | let dart = bytes.toSignedInt(event.params.data.subarray(164, 196)) 244 | 245 | let collateral = CollateralType.load(ilk) 246 | 247 | // TODO: Reset Vault 248 | 249 | if (collateral != null) { 250 | let Δdebt = units.fromWad(dart) 251 | 252 | // Debt normalized should coincide with Ilk.Art 253 | collateral.debtNormalized = collateral.debtNormalized.plus(Δdebt) 254 | 255 | // Total debt is Art * rate (like on DAIStats) 256 | collateral.totalDebt = collateral.debtNormalized * collateral.rate 257 | 258 | collateral.save() 259 | } 260 | } 261 | 262 | // Create/destroy equal quantities of stablecoin and system debt 263 | export function handleHeal(event: LogNote): void { 264 | let rad = units.fromRad(bytes.toUnsignedInt(event.params.arg1)) 265 | 266 | let system = getSystemState(event) 267 | //system.totalDebt = system.totalDebt.minus(rad) 268 | system.save() 269 | } 270 | 271 | // Mint unbacked stablecoin 272 | export function handleSuck(event: LogNote): void { 273 | let rad = units.fromRad(bytes.toUnsignedInt(event.params.arg3)) 274 | 275 | let system = getSystemState(event) 276 | //system.totalDebt = system.totalDebt.plus(rad) 277 | system.save() 278 | } 279 | 280 | // Modify the debt multiplier, creating/destroying corresponding debt 281 | export function handleFold(event: LogNote): void { 282 | let ilk = event.params.arg1.toString() 283 | let rate = units.fromRay(bytes.toSignedInt(event.params.arg3)) 284 | 285 | let collateral = CollateralType.load(ilk) 286 | 287 | if (collateral != null) { 288 | let rad = collateral.totalDebt.times(rate) 289 | 290 | collateral.rate = collateral.rate.plus(rate) 291 | collateral.save() 292 | 293 | let system = getSystemState(event) 294 | //system.totalDebt = system.totalDebt.plus(rad) 295 | system.save() 296 | } 297 | } 298 | -------------------------------------------------------------------------------- /src/mappings/modules/proxy/cdp-manager.ts: -------------------------------------------------------------------------------- 1 | import { Address } from '@graphprotocol/graph-ts' 2 | import { bytes, integer, decimal } from '@protofire/subgraph-toolkit' 3 | 4 | import { DssCdpManager, NewCdp, LogNote } from '../../../../generated/CdpManager/DssCdpManager' 5 | import { CollateralType, Vault, VaultCreationLog, VaultTransferChangeLog } from '../../../../generated/schema' 6 | 7 | import { getOrCreateUser, getSystemState } from '../../../entities' 8 | 9 | // Open a new CDP for a given user 10 | export function handleOpen(event: NewCdp): void { 11 | let manager = DssCdpManager.bind(event.address) 12 | let ilk = manager.ilks(event.params.cdp) 13 | let urn = manager.urns(event.params.cdp) 14 | 15 | let collateral = CollateralType.load(ilk.toString()) 16 | 17 | if (collateral != null) { 18 | let owner = getOrCreateUser(event.params.own) 19 | owner.vaultCount = owner.vaultCount.plus(integer.ONE) 20 | owner.save() 21 | 22 | // Register new vault 23 | let vault = new Vault(urn.toHexString() + '-' + collateral.id) 24 | vault.cdpId = event.params.cdp 25 | vault.collateralType = collateral.id 26 | vault.collateral = decimal.ZERO 27 | vault.debt = decimal.ZERO 28 | vault.handler = urn 29 | vault.owner = owner.id 30 | 31 | vault.openedAt = event.block.timestamp 32 | vault.openedAtBlock = event.block.number 33 | vault.openedAtTransaction = event.transaction.hash 34 | 35 | // Update vault counter 36 | collateral.vaultCount = collateral.vaultCount.plus(integer.ONE) 37 | 38 | vault.save() 39 | collateral.save() 40 | 41 | // Log vault creation 42 | let log = new VaultCreationLog(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + '-0') 43 | log.vault = vault.id 44 | 45 | log.block = event.block.number 46 | log.timestamp = event.block.timestamp 47 | log.transaction = event.transaction.hash 48 | 49 | log.save() 50 | } 51 | 52 | // Update system state 53 | let system = getSystemState(event) 54 | system.vaultCount = system.vaultCount.plus(integer.ONE) 55 | system.save() 56 | } 57 | 58 | // Give the CDP ownership to a another address 59 | export function handleGive(event: LogNote): void { 60 | let cdp = bytes.toUnsignedInt(event.params.arg1) 61 | let dst = bytes.toAddress(event.params.arg2) 62 | 63 | let manager = DssCdpManager.bind(event.address) 64 | let ilk = manager.ilks(cdp) 65 | let urn = manager.urns(cdp) 66 | 67 | let vault = Vault.load(urn.toHexString() + '-' + ilk.toString()) 68 | 69 | if (vault != null) { 70 | let previousOwner = getOrCreateUser(Address.fromString(vault.owner)) 71 | let nextOwner = getOrCreateUser(dst) 72 | 73 | // Transfer ownership 74 | vault.owner = nextOwner.id 75 | vault.save() 76 | 77 | previousOwner.vaultCount = previousOwner.vaultCount.minus(integer.ONE) 78 | previousOwner.save() 79 | 80 | nextOwner.vaultCount = nextOwner.vaultCount.plus(integer.ONE) 81 | nextOwner.save() 82 | 83 | // Log vault transfer 84 | let log = new VaultTransferChangeLog(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + '-3') 85 | log.vault = vault.id 86 | log.previousOwner = previousOwner.id 87 | log.nextOwner = nextOwner.id 88 | 89 | log.block = event.block.number 90 | log.timestamp = event.block.timestamp 91 | log.transaction = event.transaction.hash 92 | 93 | log.save() 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/mappings/modules/proxy/proxy-factory.ts: -------------------------------------------------------------------------------- 1 | import { integer } from '@protofire/subgraph-toolkit' 2 | 3 | import { Created } from '../../../../generated/ProxyFactory/DSProxyFactory' 4 | import { UserProxy } from '../../../../generated/schema' 5 | 6 | import { getOrCreateUser, getSystemState } from '../../../entities' 7 | 8 | export function handleCreated(event: Created): void { 9 | let user = getOrCreateUser(event.params.owner) 10 | user.proxyCount = user.proxyCount.plus(integer.ONE) 11 | user.save() 12 | 13 | // Register new user proxy 14 | let proxy = new UserProxy(event.params.proxy.toHexString()) 15 | proxy.address = event.params.proxy 16 | proxy.cache = event.params.cache 17 | proxy.owner = user.id 18 | proxy.save() 19 | 20 | // Update system state 21 | let system = getSystemState(event) 22 | system.userProxyCount = system.userProxyCount.plus(integer.ONE) 23 | system.save() 24 | } 25 | -------------------------------------------------------------------------------- /src/mappings/modules/rates/jug.ts: -------------------------------------------------------------------------------- 1 | import { Bytes } from '@graphprotocol/graph-ts' 2 | import { bytes, decimal, units } from '@protofire/subgraph-toolkit' 3 | 4 | import { LogNote } from '../../../../generated/Jug/Jug' 5 | import { CollateralType } from '../../../../generated/schema' 6 | 7 | import { getSystemState } from '../../../entities' 8 | 9 | // Start stability fee collection for a particular collateral type 10 | export function handleInit(event: LogNote): void { 11 | let ilk = event.params.arg1.toString() 12 | let system = getSystemState(event) 13 | let collateral = CollateralType.load(ilk) 14 | 15 | if (collateral) { 16 | collateral.stabilityFee = decimal.ONE 17 | 18 | collateral.save() 19 | system.save() 20 | } 21 | } 22 | 23 | export function handleFile(event: LogNote): void { 24 | let signature = event.params.sig.toHexString() 25 | let system = getSystemState(event) 26 | 27 | if (signature == '0x1a0b287e') { 28 | let ilk = event.params.arg1.toString() 29 | let what = event.params.arg2.toString() 30 | let data = bytes.toUnsignedInt(event.params.data.subarray(68, 100)) 31 | 32 | if (what == 'duty') { 33 | let collateral = CollateralType.load(ilk) 34 | 35 | if (collateral) { 36 | collateral.stabilityFee = units.fromRay(data) 37 | 38 | collateral.save() 39 | system.save() 40 | } 41 | } 42 | } else if (signature == '0x29ae8114') { 43 | let what = event.params.arg1.toString() 44 | let data = bytes.toUnsignedInt(event.params.arg2) 45 | 46 | if (what == 'base') { 47 | system.baseStabilityFee = units.fromRay(data) 48 | system.save() 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/mappings/modules/rates/pot.ts: -------------------------------------------------------------------------------- 1 | import { bytes, units } from '@protofire/subgraph-toolkit' 2 | 3 | import { LogNote } from '../../../../generated/Pot/Pot' 4 | 5 | import { getSystemState } from '../../../entities' 6 | 7 | export function handleFile(event: LogNote): void { 8 | let what = event.params.arg1.toString() 9 | let data = bytes.toUnsignedInt(event.params.arg2) 10 | 11 | if (what == 'dsr') { 12 | let system = getSystemState(event) 13 | system.savingsRate = units.fromRay(data) 14 | system.save() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/mappings/modules/system-stabilizer/flap.ts: -------------------------------------------------------------------------------- 1 | import { bytes, units } from '@protofire/subgraph-toolkit' 2 | 3 | import { LogNote } from '../../../../generated/Flap/Flapper' 4 | 5 | import { getSystemState } from '../../../entities' 6 | 7 | export function handleFile(event: LogNote): void { 8 | let what = event.params.arg1.toString() 9 | let data = bytes.toUnsignedInt(event.params.arg2) 10 | 11 | let system = getSystemState(event) 12 | 13 | if (what == 'beg') { 14 | system.surplusAuctionMinimumBidIncrease = units.fromWad(data) 15 | } else if (what == 'ttl') { 16 | system.surplusAuctionBidDuration = data 17 | } else if (what == 'tau') { 18 | system.surplusAuctionDuration = data 19 | } 20 | 21 | system.save() 22 | } 23 | -------------------------------------------------------------------------------- /src/mappings/modules/system-stabilizer/flop.ts: -------------------------------------------------------------------------------- 1 | import { bytes, units } from '@protofire/subgraph-toolkit' 2 | 3 | import { LogNote } from '../../../../generated/Flop/Flopper' 4 | 5 | import { getSystemState } from '../../../entities' 6 | 7 | export function handleFile(event: LogNote): void { 8 | let what = event.params.arg1.toString() 9 | let data = bytes.toUnsignedInt(event.params.arg2) 10 | 11 | let system = getSystemState(event) 12 | 13 | if (what == 'beg') { 14 | system.debtAuctionMinimumBidIncrease = units.fromWad(data) 15 | } else if (what == 'pad') { 16 | system.debtAuctionLotSizeIncrease = units.fromWad(data) 17 | } else if (what == 'ttl') { 18 | system.debtAuctionBidDuration = data 19 | } else if (what == 'tau') { 20 | system.debtAuctionDuration = data 21 | } 22 | 23 | system.save() 24 | } 25 | -------------------------------------------------------------------------------- /src/mappings/modules/system-stabilizer/vow.ts: -------------------------------------------------------------------------------- 1 | import { bytes, units } from '@protofire/subgraph-toolkit' 2 | 3 | import { LogNote } from '../../../../generated/Vow/Vow' 4 | 5 | import { getSystemState } from '../../../entities' 6 | 7 | export function handleFile(event: LogNote): void { 8 | let what = event.params.arg1.toString() 9 | let data = bytes.toUnsignedInt(event.params.arg2) 10 | 11 | let system = getSystemState(event) 12 | 13 | if (what == 'wait') { 14 | system.debtAuctionDelay = data 15 | } else if (what == 'bump') { 16 | system.surplusAuctionLotSize = units.fromRad(data) 17 | } else if (what == 'sump') { 18 | system.debtAuctionBidSize = units.fromRad(data) 19 | } else if (what == 'dump') { 20 | system.debtAuctionInitialLotSize = units.fromWad(data) 21 | } else if (what == 'hump') { 22 | system.surplusAuctionBuffer = units.fromRad(data) 23 | } 24 | 25 | system.save() 26 | } 27 | -------------------------------------------------------------------------------- /subgraph.yaml: -------------------------------------------------------------------------------- 1 | description: Multi Collateral Dai (MCD) 2 | specVersion: 0.0.2 3 | 4 | schema: 5 | file: ./schema.graphql 6 | 7 | dataSources: 8 | # 9 | # Core Module 10 | # 11 | 12 | # Vault Engine 13 | - name: Vat 14 | kind: ethereum/contract 15 | network: mainnet 16 | source: 17 | abi: Vat 18 | address: '0x35d1b3f3d7966a1dfe207aa4514c12a259a0492b' 19 | startBlock: 8928152 20 | mapping: 21 | kind: ethereum/events 22 | apiVersion: 0.0.4 23 | language: wasm/assemblyscript 24 | file: ./src/mappings/modules/core/vat.ts 25 | abis: 26 | - name: Vat 27 | file: ./abis/Vat.json 28 | entities: 29 | - CollateralType 30 | - SystemState 31 | - UserProxy 32 | - Vault 33 | eventHandlers: 34 | ### Administration ### 35 | 36 | # function init(bytes32 ilk) 37 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 38 | topic0: '0x3b66319500000000000000000000000000000000000000000000000000000000' 39 | handler: handleInit 40 | 41 | # function file(bytes32 what, uint256 data) 42 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 43 | topic0: '0x29ae811400000000000000000000000000000000000000000000000000000000' 44 | handler: handleFile 45 | 46 | # function file(bytes32 ilk, bytes32 what, uint256 data) 47 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 48 | topic0: '0x1a0b287e00000000000000000000000000000000000000000000000000000000' 49 | handler: handleFile 50 | 51 | ### Fungibility ### 52 | 53 | # function slip(bytes32 ilk, address usr, int256 wad) 54 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 55 | topic0: '0x7cdd3fde00000000000000000000000000000000000000000000000000000000' 56 | handler: handleSlip 57 | 58 | # function flux(bytes32 ilk, address src, address dst, uint256 rad) 59 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 60 | topic0: '0x6111be2e00000000000000000000000000000000000000000000000000000000' 61 | handler: handleFlux 62 | 63 | # function move(address src, address dst, uint256 rad) 64 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 65 | topic0: '0xbb35783b00000000000000000000000000000000000000000000000000000000' 66 | handler: handleMove 67 | 68 | ### CDP Manipulation ### 69 | 70 | # function frob(bytes32 i, address u, address v, address w, int256 dink, int256 dart) 71 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 72 | topic0: '0x7608870300000000000000000000000000000000000000000000000000000000' 73 | handler: handleFrob 74 | 75 | ### CDP Fungibility ### 76 | 77 | # function fork(bytes32 ilk, address src, address dst, int256 dink, int256 dart) 78 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 79 | topic0: '0x870c616d00000000000000000000000000000000000000000000000000000000' 80 | handler: handleFork 81 | 82 | ### CDP Confiscation ### 83 | 84 | # function grab(bytes32 i, address u, address v, address w, int256 dink, int256 dart) 85 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 86 | topic0: '0x7bab3f4000000000000000000000000000000000000000000000000000000000' 87 | handler: handleGrab 88 | 89 | ### Settlement ### 90 | 91 | # function heal(uint256 rad) 92 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 93 | topic0: '0xf37ac61c00000000000000000000000000000000000000000000000000000000' 94 | handler: handleHeal 95 | 96 | # function suck(address u, address v, uint256 rad) 97 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 98 | topic0: '0xf24e23eb00000000000000000000000000000000000000000000000000000000' 99 | handler: handleSuck 100 | 101 | ### Rates ### 102 | 103 | # function fold(bytes32 i, address u, int256 rate) 104 | - event: LogNote(indexed bytes4,indexed bytes32,indexed bytes32,indexed bytes32,bytes) 105 | topic0: '0xb65337df00000000000000000000000000000000000000000000000000000000' 106 | handler: handleFold 107 | 108 | # Liaison between the oracles and core contracts 109 | - name: Spot 110 | kind: ethereum/contract 111 | network: mainnet 112 | source: 113 | abi: Spotter 114 | address: '0x65c79fcb50ca1594b025960e539ed7a9a6d434a3' 115 | startBlock: 8928152 116 | mapping: 117 | kind: ethereum/events 118 | apiVersion: 0.0.4 119 | language: wasm/assemblyscript 120 | file: ./src/mappings/modules/core/spot.ts 121 | abis: 122 | - name: Spotter 123 | file: ./abis/Spotter.json 124 | - name: Vat 125 | file: ./abis/Vat.json 126 | entities: 127 | - CollateralPrice 128 | - CollateralType 129 | - SystemState 130 | eventHandlers: 131 | ### Administration ### 132 | 133 | # TODO: file(bytes32 ilk, bytes32 what, address pip_) 134 | 135 | # TODO: file(bytes32 what, uint256 data) 136 | 137 | # file(bytes32 ilk, bytes32 what, uint256 data) 138 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 139 | topic0: '0x1a0b287e00000000000000000000000000000000000000000000000000000000' 140 | handler: handleFile 141 | 142 | ### Update value ### 143 | 144 | # event Poke(bytes32 ilk, bytes32 val, uint256 spot) 145 | - event: Poke(bytes32,bytes32,uint256) 146 | handler: handlePoke 147 | 148 | # Liquidation Agent 149 | - name: Cat 150 | kind: ethereum/contract 151 | network: mainnet 152 | source: 153 | abi: Cat 154 | address: '0x78f2c2af65126834c51822f56be0d7469d7a523e' 155 | startBlock: 8928165 156 | mapping: 157 | kind: ethereum/events 158 | apiVersion: 0.0.4 159 | language: wasm/assemblyscript 160 | file: ./src/mappings/modules/core/cat.ts 161 | abis: 162 | - name: Cat 163 | file: ./abis/Cat.json 164 | - name: Vat 165 | file: ./abis/Vat.json 166 | entities: 167 | - CollateralType 168 | - SystemState 169 | eventHandlers: 170 | ### Administration ### 171 | 172 | # function file(bytes32 ilk, bytes32 what, uint256 data) 173 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 174 | topic0: '0x1a0b287e00000000000000000000000000000000000000000000000000000000' 175 | handler: handleFile 176 | 177 | # function file(bytes32 ilk, bytes32 what, address flip) 178 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 179 | topic0: '0xebecb39d00000000000000000000000000000000000000000000000000000000' 180 | handler: handleFile 181 | 182 | ### CDP Liquidation ### 183 | 184 | # function bite(bytes32 ilk, address urn) 185 | - event: Bite(indexed bytes32,indexed address,uint256,uint256,uint256,address,uint256) 186 | handler: handleBite 187 | 188 | # 189 | # System Stabilizer Module 190 | # 191 | 192 | # Surplus Auction 193 | - name: Flap 194 | kind: ethereum/contract 195 | network: mainnet 196 | source: 197 | abi: Flapper 198 | address: '0xdfe0fb1be2a52cdbf8fb962d5701d7fd0902db9f' 199 | startBlock: 8928163 200 | mapping: 201 | kind: ethereum/events 202 | apiVersion: 0.0.4 203 | language: wasm/assemblyscript 204 | file: ./src/mappings/modules/system-stabilizer/flap.ts 205 | abis: 206 | - name: Flapper 207 | file: ./abis/Flapper.json 208 | - name: Vat 209 | file: ./abis/Vat.json 210 | entities: 211 | - SystemState 212 | eventHandlers: 213 | ### Admin ### 214 | 215 | # function file(bytes32 what, uint256 data) 216 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 217 | topic0: '0x29ae811400000000000000000000000000000000000000000000000000000000' 218 | handler: handleFile 219 | 220 | # Debt Auction 221 | - name: Flop 222 | kind: ethereum/contract 223 | network: mainnet 224 | source: 225 | abi: Flopper 226 | address: '0x4d95a049d5b0b7d32058cd3f2163015747522e99' 227 | startBlock: 9006717 228 | mapping: 229 | kind: ethereum/events 230 | apiVersion: 0.0.4 231 | language: wasm/assemblyscript 232 | file: ./src/mappings/modules/system-stabilizer/flop.ts 233 | abis: 234 | - name: Flopper 235 | file: ./abis/Flopper.json 236 | - name: Vat 237 | file: ./abis/Vat.json 238 | entities: 239 | - SystemState 240 | eventHandlers: 241 | ### Admin ### 242 | 243 | # function file(bytes32 what, uint256 data) 244 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 245 | topic0: '0x29ae811400000000000000000000000000000000000000000000000000000000' 246 | handler: handleFile 247 | 248 | # Balance Sheet 249 | - name: Vow 250 | kind: ethereum/contract 251 | network: mainnet 252 | source: 253 | abi: Vow 254 | address: '0xa950524441892a31ebddf91d3ceefa04bf454466' 255 | startBlock: 8928163 256 | mapping: 257 | kind: ethereum/events 258 | apiVersion: 0.0.4 259 | language: wasm/assemblyscript 260 | file: ./src/mappings/modules/system-stabilizer/vow.ts 261 | abis: 262 | - name: Vow 263 | file: ./abis/Vow.json 264 | - name: Vat 265 | file: ./abis/Vat.json 266 | entities: 267 | - SystemState 268 | eventHandlers: 269 | ### Administration ### 270 | 271 | # function file(bytes32 what, uint256 data) 272 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 273 | topic0: '0x29ae811400000000000000000000000000000000000000000000000000000000' 274 | handler: handleFile 275 | 276 | # 277 | # Rates Module 278 | # 279 | 280 | # Accumulation of Stability Fees for collateral types 281 | - name: Jug 282 | kind: ethereum/contract 283 | network: mainnet 284 | source: 285 | abi: Jug 286 | address: '0x19c0976f590d67707e62397c87829d896dc0f1f1' 287 | startBlock: 8928160 288 | mapping: 289 | kind: ethereum/events 290 | apiVersion: 0.0.4 291 | language: wasm/assemblyscript 292 | file: ./src/mappings/modules/rates/jug.ts 293 | abis: 294 | - name: Jug 295 | file: ./abis/Jug.json 296 | - name: Vat 297 | file: ./abis/Vat.json 298 | entities: 299 | - CollateralType 300 | - SystemState 301 | eventHandlers: 302 | ### Administration ### 303 | 304 | # init(bytes32 ilk) 305 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 306 | topic0: '0x3b66319500000000000000000000000000000000000000000000000000000000' 307 | handler: handleInit 308 | 309 | # function file(bytes32 ilk, bytes32 what, uint256 data) 310 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 311 | topic0: '0x1a0b287e00000000000000000000000000000000000000000000000000000000' 312 | handler: handleFile 313 | 314 | # function file(bytes32 what, uint256 data) 315 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 316 | topic0: '0x29ae811400000000000000000000000000000000000000000000000000000000' 317 | handler: handleFile 318 | 319 | # Dai Savings Rate 320 | - name: Pot 321 | kind: ethereum/contract 322 | network: mainnet 323 | source: 324 | abi: Pot 325 | address: '0x197e90f9fad81970ba7976f33cbd77088e5d7cf7' 326 | startBlock: 8928160 327 | mapping: 328 | kind: ethereum/events 329 | apiVersion: 0.0.4 330 | language: wasm/assemblyscript 331 | file: ./src/mappings/modules/rates/pot.ts 332 | abis: 333 | - name: Pot 334 | file: ./abis/Pot.json 335 | - name: Vat 336 | file: ./abis/Vat.json 337 | entities: 338 | - SystemState 339 | eventHandlers: 340 | ### Administration ### 341 | 342 | # function file(bytes32 what, uint256 data) 343 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 344 | topic0: '0x29ae811400000000000000000000000000000000000000000000000000000000' 345 | handler: handleFile 346 | 347 | # 348 | # Proxy Module 349 | # 350 | 351 | # Used to deploy new user proxy instances 352 | - name: ProxyFactory 353 | kind: ethereum/contract 354 | network: mainnet 355 | source: 356 | abi: DSProxyFactory 357 | address: '0xa26e15c895efc0616177b7c1e7270a4c7d51c997' 358 | startBlock: 5834580 359 | mapping: 360 | kind: ethereum/events 361 | apiVersion: 0.0.4 362 | language: wasm/assemblyscript 363 | file: ./src/mappings/modules/proxy/proxy-factory.ts 364 | abis: 365 | - name: DSProxyFactory 366 | file: ./abis/DSProxyFactory.json 367 | - name: Vat 368 | file: ./abis/Vat.json 369 | entities: 370 | - SystemState 371 | - User 372 | - UserProxy 373 | eventHandlers: 374 | - event: Created(indexed address,indexed address,address,address) 375 | handler: handleCreated 376 | 377 | # Allow users to interact with their Vaults in an easy way, treating them as non-fungible tokens (NFTs) 378 | - name: CdpManager 379 | kind: ethereum/contract 380 | network: mainnet 381 | source: 382 | abi: DssCdpManager 383 | address: '0x5ef30b9986345249bc32d8928b7ee64de9435e39' 384 | startBlock: 8928198 385 | mapping: 386 | kind: ethereum/events 387 | apiVersion: 0.0.4 388 | language: wasm/assemblyscript 389 | file: ./src/mappings/modules/proxy/cdp-manager.ts 390 | abis: 391 | - name: DssCdpManager 392 | file: ./abis/DssCdpManager.json 393 | - name: Vat 394 | file: ./abis/Vat.json 395 | entities: 396 | - CollateralType 397 | - SystemState 398 | - UserProxy 399 | - Vault 400 | eventHandlers: 401 | # function open(bytes32 ilk, address usr) 402 | - event: NewCdp(indexed address,indexed address,indexed uint256) 403 | handler: handleOpen 404 | 405 | # function give(uint cdp, address dst) 406 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 407 | topic0: '0xfcafcc6800000000000000000000000000000000000000000000000000000000' 408 | handler: handleGive 409 | 410 | templates: 411 | # Collateral Auction 412 | - name: Flip 413 | kind: ethereum/contract 414 | network: mainnet 415 | source: 416 | abi: Flipper 417 | mapping: 418 | kind: ethereum/events 419 | apiVersion: 0.0.4 420 | language: wasm/assemblyscript 421 | file: ./src/mappings/modules/collateral/flip.ts 422 | abis: 423 | - name: Flipper 424 | file: ./abis/Flipper.json 425 | - name: Vat 426 | file: ./abis/Vat.json 427 | entities: 428 | - CollateralAuction 429 | - CollateralType 430 | eventHandlers: 431 | ### Admin ### 432 | 433 | # function file(bytes32 what, uint256 data) 434 | - event: LogNote(indexed bytes4,indexed address,indexed bytes32,indexed bytes32,bytes) 435 | topic0: '0x29ae811400000000000000000000000000000000000000000000000000000000' 436 | handler: handleFile 437 | 438 | ### Auction ### 439 | 440 | - event: Kick(uint256,uint256,uint256,uint256,indexed address,indexed address) 441 | handler: handleKick 442 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./node_modules/assemblyscript/src/tsconfig.json" 3 | } 4 | --------------------------------------------------------------------------------