diff --git a/.gitignore b/.gitignore index a9f0d3a5..9d827283 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,7 @@ coverage # echidna crytic-export/ -/test/echidna/_corpus/ \ No newline at end of file +/test/echidna/_corpus/ + +# slither +slither.db.json \ No newline at end of file diff --git a/slither.db.json b/slither.db.json deleted file mode 100644 index f2681a9f..00000000 --- a/slither.db.json +++ /dev/null @@ -1 +0,0 @@ -[{"elements": [{"type": "function", "name": "adjustAllocationPoints", "source_mapping": {"start": 6633, "length": 185, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [159, 160, 161, 162, 163, 164], "starting_column": 5, "ending_column": 7}, "type_specific_fields": {"parent": {"type": "contract", "name": "EulerAggregationVault", "source_mapping": {"start": 1605, "length": 24181, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647], "starting_column": 1, "ending_column": 2}}, "signature": "adjustAllocationPoints(address,uint256)"}}, {"type": "function", "name": "use", "source_mapping": {"start": 1637, "length": 152, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [35, 36, 37, 38], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "Dispatch", "source_mapping": {"start": 722, "length": 1468, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "starting_column": 1, "ending_column": 2}}, "signature": "use(address)"}}, {"type": "node", "name": "return(uint256,uint256)(0,returndatasize()())", "source_mapping": {"start": 2143, "length": 27, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [47], "starting_column": 23, "ending_column": 50}, "type_specific_fields": {"parent": {"type": "function", "name": "_delegateToModule", "source_mapping": {"start": 1795, "length": 393, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "Dispatch", "source_mapping": {"start": 722, "length": 1468, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "starting_column": 1, "ending_column": 2}}, "signature": "_delegateToModule(address)"}}}}], "description": "EulerAggregationVault.adjustAllocationPoints(address,uint256) (src/core/EulerAggregationVault.sol#159-164) calls Dispatch.use(address) (src/core/Dispatch.sol#35-38) which halt the execution return(uint256,uint256)(0,returndatasize()()) (src/core/Dispatch.sol#47)\n", "markdown": "[EulerAggregationVault.adjustAllocationPoints(address,uint256)](src/core/EulerAggregationVault.sol#L159-L164) calls [Dispatch.use(address)](src/core/Dispatch.sol#L35-L38) which halt the execution [return(uint256,uint256)(0,returndatasize()())](src/core/Dispatch.sol#L47)\n", "first_markdown_element": "src/core/EulerAggregationVault.sol#L159-L164", "id": "d915c06d21a87c4958d56177f277f41190f95773c2fa987afbdaade478d14c2e", "check": "incorrect-return", "impact": "High", "confidence": "Medium"}, {"elements": [{"type": "function", "name": "setStrategyCap", "source_mapping": {"start": 6882, "length": 171, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [167, 168, 169, 170, 171, 172], "starting_column": 5, "ending_column": 7}, "type_specific_fields": {"parent": {"type": "contract", "name": "EulerAggregationVault", "source_mapping": {"start": 1605, "length": 24181, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647], "starting_column": 1, "ending_column": 2}}, "signature": "setStrategyCap(address,uint256)"}}, {"type": "function", "name": "use", "source_mapping": {"start": 1637, "length": 152, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [35, 36, 37, 38], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "Dispatch", "source_mapping": {"start": 722, "length": 1468, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "starting_column": 1, "ending_column": 2}}, "signature": "use(address)"}}, {"type": "node", "name": "return(uint256,uint256)(0,returndatasize()())", "source_mapping": {"start": 2143, "length": 27, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [47], "starting_column": 23, "ending_column": 50}, "type_specific_fields": {"parent": {"type": "function", "name": "_delegateToModule", "source_mapping": {"start": 1795, "length": 393, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "Dispatch", "source_mapping": {"start": 722, "length": 1468, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "starting_column": 1, "ending_column": 2}}, "signature": "_delegateToModule(address)"}}}}], "description": "EulerAggregationVault.setStrategyCap(address,uint256) (src/core/EulerAggregationVault.sol#167-172) calls Dispatch.use(address) (src/core/Dispatch.sol#35-38) which halt the execution return(uint256,uint256)(0,returndatasize()()) (src/core/Dispatch.sol#47)\n", "markdown": "[EulerAggregationVault.setStrategyCap(address,uint256)](src/core/EulerAggregationVault.sol#L167-L172) calls [Dispatch.use(address)](src/core/Dispatch.sol#L35-L38) which halt the execution [return(uint256,uint256)(0,returndatasize()())](src/core/Dispatch.sol#L47)\n", "first_markdown_element": "src/core/EulerAggregationVault.sol#L167-L172", "id": "b2a4c74b041d57efb8bc7f3e7d78a4c6bdf7879ccbdac94025aff8554d01572e", "check": "incorrect-return", "impact": "High", "confidence": "Medium"}, {"elements": [{"type": "function", "name": "addStrategy", "source_mapping": {"start": 7114, "length": 176, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [175, 176, 177, 178, 179, 180], "starting_column": 5, "ending_column": 7}, "type_specific_fields": {"parent": {"type": "contract", "name": "EulerAggregationVault", "source_mapping": {"start": 1605, "length": 24181, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647], "starting_column": 1, "ending_column": 2}}, "signature": "addStrategy(address,uint256)"}}, {"type": "function", "name": "use", "source_mapping": {"start": 1637, "length": 152, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [35, 36, 37, 38], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "Dispatch", "source_mapping": {"start": 722, "length": 1468, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "starting_column": 1, "ending_column": 2}}, "signature": "use(address)"}}, {"type": "node", "name": "return(uint256,uint256)(0,returndatasize()())", "source_mapping": {"start": 2143, "length": 27, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [47], "starting_column": 23, "ending_column": 50}, "type_specific_fields": {"parent": {"type": "function", "name": "_delegateToModule", "source_mapping": {"start": 1795, "length": 393, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "Dispatch", "source_mapping": {"start": 722, "length": 1468, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "starting_column": 1, "ending_column": 2}}, "signature": "_delegateToModule(address)"}}}}], "description": "EulerAggregationVault.addStrategy(address,uint256) (src/core/EulerAggregationVault.sol#175-180) calls Dispatch.use(address) (src/core/Dispatch.sol#35-38) which halt the execution return(uint256,uint256)(0,returndatasize()()) (src/core/Dispatch.sol#47)\n", "markdown": "[EulerAggregationVault.addStrategy(address,uint256)](src/core/EulerAggregationVault.sol#L175-L180) calls [Dispatch.use(address)](src/core/Dispatch.sol#L35-L38) which halt the execution [return(uint256,uint256)(0,returndatasize()())](src/core/Dispatch.sol#L47)\n", "first_markdown_element": "src/core/EulerAggregationVault.sol#L175-L180", "id": "bf2bcac08c1abcd15d702ab4a83ffe360e24551622cfbf61d6a35bf7b942eb08", "check": "incorrect-return", "impact": "High", "confidence": "Medium"}, {"elements": [{"type": "function", "name": "removeStrategy", "source_mapping": {"start": 7354, "length": 154, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [183, 184, 185, 186, 187, 188], "starting_column": 5, "ending_column": 7}, "type_specific_fields": {"parent": {"type": "contract", "name": "EulerAggregationVault", "source_mapping": {"start": 1605, "length": 24181, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647], "starting_column": 1, "ending_column": 2}}, "signature": "removeStrategy(address)"}}, {"type": "function", "name": "use", "source_mapping": {"start": 1637, "length": 152, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [35, 36, 37, 38], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "Dispatch", "source_mapping": {"start": 722, "length": 1468, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "starting_column": 1, "ending_column": 2}}, "signature": "use(address)"}}, {"type": "node", "name": "return(uint256,uint256)(0,returndatasize()())", "source_mapping": {"start": 2143, "length": 27, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [47], "starting_column": 23, "ending_column": 50}, "type_specific_fields": {"parent": {"type": "function", "name": "_delegateToModule", "source_mapping": {"start": 1795, "length": 393, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], "starting_column": 5, "ending_column": 6}, "type_specific_fields": {"parent": {"type": "contract", "name": "Dispatch", "source_mapping": {"start": 722, "length": 1468, "filename_relative": "src/core/Dispatch.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/Dispatch.sol", "filename_short": "src/core/Dispatch.sol", "is_dependency": false, "lines": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], "starting_column": 1, "ending_column": 2}}, "signature": "_delegateToModule(address)"}}}}], "description": "EulerAggregationVault.removeStrategy(address) (src/core/EulerAggregationVault.sol#183-188) calls Dispatch.use(address) (src/core/Dispatch.sol#35-38) which halt the execution return(uint256,uint256)(0,returndatasize()()) (src/core/Dispatch.sol#47)\n", "markdown": "[EulerAggregationVault.removeStrategy(address)](src/core/EulerAggregationVault.sol#L183-L188) calls [Dispatch.use(address)](src/core/Dispatch.sol#L35-L38) which halt the execution [return(uint256,uint256)(0,returndatasize()())](src/core/Dispatch.sol#L47)\n", "first_markdown_element": "src/core/EulerAggregationVault.sol#L183-L188", "id": "e3279bf2e5ce035b66fdd50f126381ed98ed968aa9fb3c061ceeb021c3d07fef", "check": "incorrect-return", "impact": "High", "confidence": "Medium"}, {"elements": [{"type": "variable", "name": "MAX_PERFORMANCE_FEE", "source_mapping": {"start": 810, "length": 54, "filename_relative": "src/core/module/Fee.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/module/Fee.sol", "filename_short": "src/core/module/Fee.sol", "is_dependency": false, "lines": [19], "starting_column": 5, "ending_column": 59}, "type_specific_fields": {"parent": {"type": "contract", "name": "FeeModule", "source_mapping": {"start": 710, "length": 1355, "filename_relative": "src/core/module/Fee.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/module/Fee.sol", "filename_short": "src/core/module/Fee.sol", "is_dependency": false, "lines": [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49], "starting_column": 1, "ending_column": 2}}}}, {"type": "contract", "name": "EulerAggregationVault", "source_mapping": {"start": 1605, "length": 24181, "filename_relative": "src/core/EulerAggregationVault.sol", "filename_absolute": "/Users/haythem/Projects/Euler/Lending/euler-aggregation-layer/src/core/EulerAggregationVault.sol", "filename_short": "src/core/EulerAggregationVault.sol", "is_dependency": false, "lines": [34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647], "starting_column": 1, "ending_column": 2}}], "description": "FeeModule.MAX_PERFORMANCE_FEE (src/core/module/Fee.sol#19) is never used in EulerAggregationVault (src/core/EulerAggregationVault.sol#34-647)\n", "markdown": "[FeeModule.MAX_PERFORMANCE_FEE](src/core/module/Fee.sol#L19) is never used in [EulerAggregationVault](src/core/EulerAggregationVault.sol#L34-L647)\n", "first_markdown_element": "src/core/module/Fee.sol#L19", "id": "31623f8c0d896943238d363dd1794d3cccb3e27d799a7f20b4df426e8a14ba17", "check": "unused-state", "impact": "Informational", "confidence": "High"}] \ No newline at end of file diff --git a/src/core/EulerAggregationVault.sol b/src/core/EulerAggregationVault.sol index eafeb63b..8cd9d520 100644 --- a/src/core/EulerAggregationVault.sol +++ b/src/core/EulerAggregationVault.sol @@ -21,7 +21,7 @@ import {ContextUpgradeable} from "@openzeppelin-upgradeable/utils/ContextUpgrade import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; -import {StorageLib, AggregationVaultStorage} from "./lib/StorageLib.sol"; +import {StorageLib as Storage, AggregationVaultStorage} from "./lib/StorageLib.sol"; import {ErrorsLib as Errors} from "./lib/ErrorsLib.sol"; import {EventsLib as Events} from "./lib/EventsLib.sol"; @@ -47,8 +47,8 @@ contract EulerAggregationVault is bytes32 public constant STRATEGY_ADDER_ADMIN = keccak256("STRATEGY_ADDER_ADMIN"); bytes32 public constant STRATEGY_REMOVER = keccak256("STRATEGY_REMOVER"); bytes32 public constant STRATEGY_REMOVER_ADMIN = keccak256("STRATEGY_REMOVER_ADMIN"); - bytes32 public constant AGGREGATION_LAYER_MANAGER = keccak256("AGGREGATION_LAYER_MANAGER"); - bytes32 public constant AGGREGATION_LAYER_MANAGER_ADMIN = keccak256("AGGREGATION_LAYER_MANAGER_ADMIN"); + bytes32 public constant AGGREGATION_VAULT_MANAGER = keccak256("AGGREGATION_VAULT_MANAGER"); + bytes32 public constant AGGREGATION_VAULT_MANAGER_ADMIN = keccak256("AGGREGATION_VAULT_MANAGER_ADMIN"); /// @dev Interest rate smearing period uint256 public constant INTEREST_SMEAR = 2 weeks; @@ -73,10 +73,11 @@ contract EulerAggregationVault is if (_initParams.initialCashAllocationPoints == 0) revert Errors.InitialAllocationPointsZero(); - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); $.locked = REENTRANCYLOCK__UNLOCKED; $.withdrawalQueue = _initParams.withdrawalQueuePlugin; $.rebalancer = _initParams.rebalancerPlugin; + $.balanceTracker = _initParams.balanceTracker; $.strategies[address(0)] = IEulerAggregationVault.Strategy({ allocated: 0, allocationPoints: _initParams.initialCashAllocationPoints.toUint120(), @@ -84,7 +85,6 @@ contract EulerAggregationVault is cap: 0 }); $.totalAllocationPoints = _initParams.initialCashAllocationPoints; - $.balanceTracker = _initParams.balanceTracker; // Setup DEFAULT_ADMIN _grantRole(DEFAULT_ADMIN_ROLE, _initParams.aggregationVaultOwner); @@ -93,25 +93,25 @@ contract EulerAggregationVault is _setRoleAdmin(ALLOCATIONS_MANAGER, ALLOCATIONS_MANAGER_ADMIN); _setRoleAdmin(STRATEGY_ADDER, STRATEGY_ADDER_ADMIN); _setRoleAdmin(STRATEGY_REMOVER, STRATEGY_REMOVER_ADMIN); - _setRoleAdmin(AGGREGATION_LAYER_MANAGER, AGGREGATION_LAYER_MANAGER_ADMIN); + _setRoleAdmin(AGGREGATION_VAULT_MANAGER, AGGREGATION_VAULT_MANAGER_ADMIN); } /// @dev See {FeeModule-setFeeRecipient}. function setFeeRecipient(address _newFeeRecipient) external override - onlyRole(AGGREGATION_LAYER_MANAGER) + onlyRole(AGGREGATION_VAULT_MANAGER) use(feeModule) {} /// @dev See {FeeModule-setPerformanceFee}. - function setPerformanceFee(uint256 _newFee) external override onlyRole(AGGREGATION_LAYER_MANAGER) use(feeModule) {} + function setPerformanceFee(uint256 _newFee) external override onlyRole(AGGREGATION_VAULT_MANAGER) use(feeModule) {} /// @dev See {RewardsModule-optInStrategyRewards}. function optInStrategyRewards(address _strategy) external override - onlyRole(AGGREGATION_LAYER_MANAGER) + onlyRole(AGGREGATION_VAULT_MANAGER) use(rewardsModule) {} @@ -119,7 +119,7 @@ contract EulerAggregationVault is function optOutStrategyRewards(address _strategy) external override - onlyRole(AGGREGATION_LAYER_MANAGER) + onlyRole(AGGREGATION_VAULT_MANAGER) use(rewardsModule) {} @@ -127,7 +127,7 @@ contract EulerAggregationVault is function enableRewardForStrategy(address _strategy, address _reward) external override - onlyRole(AGGREGATION_LAYER_MANAGER) + onlyRole(AGGREGATION_VAULT_MANAGER) use(rewardsModule) {} @@ -135,7 +135,7 @@ contract EulerAggregationVault is function disableRewardForStrategy(address _strategy, address _reward, bool _forfeitRecentReward) external override - onlyRole(AGGREGATION_LAYER_MANAGER) + onlyRole(AGGREGATION_VAULT_MANAGER) use(rewardsModule) {} @@ -143,7 +143,7 @@ contract EulerAggregationVault is function claimStrategyReward(address _strategy, address _reward, address _recipient, bool _forfeitRecentReward) external override - onlyRole(AGGREGATION_LAYER_MANAGER) + onlyRole(AGGREGATION_VAULT_MANAGER) use(rewardsModule) {} @@ -151,7 +151,7 @@ contract EulerAggregationVault is function setHooksConfig(address _hooksTarget, uint32 _hookedFns) external override - onlyRole(AGGREGATION_LAYER_MANAGER) + onlyRole(AGGREGATION_VAULT_MANAGER) use(hooksModule) {} @@ -194,12 +194,12 @@ contract EulerAggregationVault is function disableBalanceForwarder() external override use(rewardsModule) {} /// @notice Set a new address for Rebalancer plugin. - /// @dev Can only be called by an address with the `AGGREGATION_LAYER_MANAGER` role. + /// @dev Can only be called by an address with the `AGGREGATION_VAULT_MANAGER` role. /// @param _rebalancer New Rebalancer contract address. - function setRebalancer(address _rebalancer) external onlyRole(AGGREGATION_LAYER_MANAGER) { + function setRebalancer(address _rebalancer) external onlyRole(AGGREGATION_VAULT_MANAGER) { if (_rebalancer == address(0)) revert Errors.InvalidRebalancerPlugin(); - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); emit Events.SetRebalancer($.rebalancer, _rebalancer); @@ -212,7 +212,7 @@ contract EulerAggregationVault is /// @param _amountToRebalance Amount to deposit or withdraw. /// @param _isDeposit bool to indicate if it is a deposit or a withdraw. function rebalance(address _strategy, uint256 _amountToRebalance, bool _isDeposit) external nonReentrant { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); if (_msgSender() != $.rebalancer) revert Errors.NotRebalancer(); @@ -259,7 +259,7 @@ contract EulerAggregationVault is function executeStrategyWithdraw(address _strategy, uint256 _withdrawAmount) external { _isCallerWithdrawalQueue(); - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); // Update allocated assets $.strategies[_strategy].allocated -= uint120(_withdrawAmount); @@ -271,24 +271,24 @@ contract EulerAggregationVault is /// @notice Execute a withdraw from the AggregationVault /// @dev This function should be called and can only be called by the WithdrawalQueue. - /// @param caller Withdraw call initiator. - /// @param receiver Receiver of the withdrawn asset. - /// @param owner Owner of shares to withdraw against. - /// @param assets Amount of asset to withdraw. - /// @param shares Amount of shares to withdraw against. + /// @param _caller Withdraw call initiator. + /// @param _receiver Receiver of the withdrawn asset. + /// @param _owner Owner of shares to withdraw against. + /// @param _assets Amount of asset to withdraw. + /// @param _shares Amount of shares to withdraw against. function executeAggregationVaultWithdraw( - address caller, - address receiver, - address owner, - uint256 assets, - uint256 shares + address _caller, + address _receiver, + address _owner, + uint256 _assets, + uint256 _shares ) external { _isCallerWithdrawalQueue(); - super._withdraw(caller, receiver, owner, assets, shares); + super._withdraw(_caller, _receiver, _owner, _assets, _shares); - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); - $.totalAssetsDeposited -= assets; + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); + $.totalAssetsDeposited -= _assets; _gulp(); } @@ -297,7 +297,7 @@ contract EulerAggregationVault is /// @param _strategy strategy's address /// @return Strategy struct function getStrategy(address _strategy) external view returns (IEulerAggregationVault.Strategy memory) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return $.strategies[_strategy]; } @@ -311,7 +311,7 @@ contract EulerAggregationVault is /// @notice Get saving rate data. /// @return avsr AggregationVaultSavingRate struct. function getAggregationVaultSavingRate() external view returns (AggregationVaultSavingRate memory) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); AggregationVaultSavingRate memory avsr = AggregationVaultSavingRate({ lastInterestUpdate: $.lastInterestUpdate, interestSmearEnd: $.interestSmearEnd, @@ -325,7 +325,7 @@ contract EulerAggregationVault is /// @notice Get the total allocated amount. /// @return uint256 Total allocated. function totalAllocated() external view returns (uint256) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return $.totalAllocated; } @@ -333,15 +333,15 @@ contract EulerAggregationVault is /// @notice Get the total allocation points. /// @return uint256 Total allocation points. function totalAllocationPoints() external view returns (uint256) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return $.totalAllocationPoints; } - /// @notice Get the total assets deposited into the aggregation layer. + /// @notice Get the total assets deposited into the aggregation vault. /// @return uint256 Total assets deposited. function totalAssetsDeposited() external view returns (uint256) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return $.totalAssetsDeposited; } @@ -349,7 +349,7 @@ contract EulerAggregationVault is /// @notice Get the WithdrawalQueue plugin address. /// @return address Withdrawal queue address. function withdrawalQueue() external view returns (address) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return $.withdrawalQueue; } @@ -357,7 +357,7 @@ contract EulerAggregationVault is /// @notice Get the Rebalancer plugin address. /// @return address Rebalancer address. function rebalancer() external view returns (address) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return $.rebalancer; } @@ -366,7 +366,7 @@ contract EulerAggregationVault is /// @return adddress Fee recipient. /// @return uint256 Fee percentage. function performanceFeeConfig() external view returns (address, uint256) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return ($.feeRecipient, $.performanceFee); } @@ -426,7 +426,7 @@ contract EulerAggregationVault is /// @notice Return the total amount of assets deposited, plus the accrued interest. /// @return uint256 total amount function totalAssets() public view override returns (uint256) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return $.totalAssetsDeposited + _interestAccruedFromCache(); } @@ -435,7 +435,7 @@ contract EulerAggregationVault is /// @dev the total assets allocatable is the amount of assets deposited into the aggregator + assets already deposited into strategies /// @return uint256 total assets function totalAssetsAllocatable() public view returns (uint256) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); return IERC20(asset()).balanceOf(address(this)) + $.totalAllocated; } @@ -445,7 +445,7 @@ contract EulerAggregationVault is function _deposit(address _caller, address _receiver, uint256 _assets, uint256 _shares) internal override { super._deposit(_caller, _receiver, _assets, _shares); - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); $.totalAssetsDeposited += _assets; } @@ -455,7 +455,7 @@ contract EulerAggregationVault is internal override { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); uint256 assetsRetrieved = IERC20(asset()).balanceOf(address(this)); IWithdrawalQueue($.withdrawalQueue).callWithdrawalQueue( @@ -467,7 +467,7 @@ contract EulerAggregationVault is function _updateInterestAccrued() internal { uint256 accruedInterest = _interestAccruedFromCache(); - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); // it's safe to down-cast because the accrued interest is a fraction of interest left $.interestLeft -= uint168(accruedInterest); $.lastInterestUpdate = uint40(block.timestamp); @@ -480,7 +480,7 @@ contract EulerAggregationVault is function _gulp() internal { _updateInterestAccrued(); - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); // Do not gulp if total supply is too low if (totalSupply() < MIN_SHARES_FOR_GULP) return; @@ -500,7 +500,7 @@ contract EulerAggregationVault is /// @dev Loop through stratgies, aggregate positive yield and loss and account for net amount. /// @dev Loss socialization will be taken out from interest left first, if not enough, sozialize on deposits. function _harvest() internal { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); (address[] memory withdrawalQueueArray, uint256 length) = IWithdrawalQueue($.withdrawalQueue).getWithdrawalQueueArray(); @@ -538,10 +538,10 @@ contract EulerAggregationVault is /// @dev Execute harvest on a single strategy. /// @param _strategy Strategy address. - /// @return yiled Amount of yield if any, else 0. + /// @return yield Amount of yield if any, else 0. /// @return loss Amount of loss if any, else 0. function _executeHarvest(address _strategy) internal returns (uint256, uint256) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); uint120 strategyAllocatedAmount = $.strategies[_strategy].allocated; @@ -577,7 +577,7 @@ contract EulerAggregationVault is /// @param _yield Amount of yield harvested. /// @return feeAssets Amount of performance fee taken. function _accruePerformanceFee(address _strategy, uint256 _yield) internal returns (uint120) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); address cachedFeeRecipient = $.feeRecipient; uint256 cachedPerformanceFee = $.performanceFee; @@ -619,7 +619,7 @@ contract EulerAggregationVault is /// @dev Get accrued interest without updating it. /// @return uint256 Accrued interest. function _interestAccruedFromCache() internal view returns (uint256) { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); // If distribution ended, full amount is accrued if (block.timestamp >= $.interestSmearEnd) { @@ -640,7 +640,7 @@ contract EulerAggregationVault is /// @dev Check if caller is WithdrawalQueue address, if not revert. function _isCallerWithdrawalQueue() internal view { - AggregationVaultStorage storage $ = StorageLib._getAggregationVaultStorage(); + AggregationVaultStorage storage $ = Storage._getAggregationVaultStorage(); if (_msgSender() != $.withdrawalQueue) revert Errors.NotWithdrawaQueue(); } diff --git a/src/core/EulerAggregationVaultFactory.sol b/src/core/EulerAggregationVaultFactory.sol index 18f9f9e3..36401fb4 100644 --- a/src/core/EulerAggregationVaultFactory.sol +++ b/src/core/EulerAggregationVaultFactory.sol @@ -77,15 +77,15 @@ contract EulerAggregationVaultFactory is Ownable { emit WhitelistWithdrawalQueueImpl(_withdrawalQueuImpl); } - /// @notice Deploy a new aggregation layer vault. - /// @dev This will clone a new WithdrawalQueue plugin instance for the aggregation layer vault. + /// @notice Deploy a new aggregation vault. + /// @dev This will clone a new WithdrawalQueue plugin instance for the aggregation vault. /// @dev This will use the defaut Rebalancer plugin configured in this factory. - /// @dev Both plugins are possible to change by the aggregation layer vault manager. - /// @param _asset Aggreation layer vault' asset address. + /// @dev Both plugins are possible to change by the aggregation vault manager. + /// @param _asset Aggreation vault' asset address. /// @param _name Vaut name. /// @param _symbol Vault symbol. /// @param _initialCashAllocationPoints The amount of points to initally allocate for cash reserve. - /// @return eulerAggregationVault The address of the new deployed aggregation layer vault. + /// @return eulerAggregationVault The address of the new deployed aggregation vault. function deployEulerAggregationVault( address _withdrawalQueueImpl, address _asset, diff --git a/src/core/lib/ErrorsLib.sol b/src/core/lib/ErrorsLib.sol index e17e65a8..753a9df6 100644 --- a/src/core/lib/ErrorsLib.sol +++ b/src/core/lib/ErrorsLib.sol @@ -24,4 +24,5 @@ library ErrorsLib { error NotRebalancer(); error InvalidAllocationPoints(); error CanNotRemoveStartegyWithAllocatedAmount(); + error NoCapOnCashReserveStrategy(); } diff --git a/src/core/module/AllocationPoints.sol b/src/core/module/AllocationPoints.sol index 7ac8f4cc..7c9bec6b 100644 --- a/src/core/module/AllocationPoints.sol +++ b/src/core/module/AllocationPoints.sol @@ -50,6 +50,10 @@ abstract contract AllocationPointsModule is Shared { revert Errors.InactiveStrategy(); } + if (_strategy == address(0)) { + revert Errors.NoCapOnCashReserveStrategy(); + } + $.strategies[_strategy].cap = _cap.toUint120(); emit Events.SetStrategyCap(_strategy, _cap); diff --git a/src/core/module/Rewards.sol b/src/core/module/Rewards.sol index ca0ee81f..780fbdc0 100644 --- a/src/core/module/Rewards.sol +++ b/src/core/module/Rewards.sol @@ -39,7 +39,7 @@ abstract contract RewardsModule is IBalanceForwarder, Shared { emit Events.OptOutStrategyRewards(_strategy); } - /// @notice Enable aggregation layer vault rewards for specific strategy's reward token. + /// @notice Enable aggregation vault rewards for specific strategy's reward token. /// @param _strategy Strategy address. /// @param _reward Reward token address. function enableRewardForStrategy(address _strategy, address _reward) external virtual nonReentrant { @@ -52,7 +52,7 @@ abstract contract RewardsModule is IBalanceForwarder, Shared { emit Events.EnableRewardForStrategy(_strategy, _reward); } - /// @notice Disable aggregation layer vault rewards for specific strategy's reward token. + /// @notice Disable aggregation vault rewards for specific strategy's reward token. /// @param _strategy Strategy address. /// @param _reward Reward token address. /// @param _forfeitRecentReward Whether to forfeit the recent rewards or not. diff --git a/src/plugin/Rebalancer.sol b/src/plugin/Rebalancer.sol index 506639d8..c9e37879 100644 --- a/src/plugin/Rebalancer.sol +++ b/src/plugin/Rebalancer.sol @@ -19,7 +19,7 @@ contract Rebalancer { ); /// @notice Rebalance strategies allocation for a specific curated vault. - /// @param _aggregationVault Aggregation layer vault address. + /// @param _aggregationVault Aggregation vault address. /// @param _strategies Strategies addresses. function executeRebalance(address _aggregationVault, address[] calldata _strategies) external { IEulerAggregationVault(_aggregationVault).gulp(); @@ -33,7 +33,7 @@ contract Rebalancer { /// If current allocation is less than target allocation, the aggregator will: /// - Try to deposit the delta, if the cash is not sufficient, deposit all the available cash /// - If all the available cash is greater than the max deposit, deposit the max deposit - /// @param _aggregationVault Aggregation layer vault address. + /// @param _aggregationVault Aggregation vault address. /// @param _strategy Strategy address. function _rebalance(address _aggregationVault, address _strategy) private { if (_strategy == address(0)) { diff --git a/src/plugin/WithdrawalQueue.sol b/src/plugin/WithdrawalQueue.sol index efda5995..07fbeba2 100644 --- a/src/plugin/WithdrawalQueue.sol +++ b/src/plugin/WithdrawalQueue.sol @@ -37,8 +37,8 @@ contract WithdrawalQueue is AccessControlEnumerableUpgradeable, IWithdrawalQueue event ReorderWithdrawalQueue(uint8 index1, uint8 index2); /// @notice Initialize WithdrawalQueue. - /// @param _owner Aggregation layer vault owner. - /// @param _eulerAggregationVault Address of aggregation layer vault. + /// @param _owner Aggregation vault owner. + /// @param _eulerAggregationVault Address of aggregation vault. function init(address _owner, address _eulerAggregationVault) external initializer { WithdrawalQueueStorage storage $ = _getWithdrawalQueueStorage(); $.eulerAggregationVault = _eulerAggregationVault; @@ -49,7 +49,7 @@ contract WithdrawalQueue is AccessControlEnumerableUpgradeable, IWithdrawalQueue } /// @notice Add a strategy to withdrawal queue array. - /// @dev Can only be called by the aggregation layer vault's address. + /// @dev Can only be called by the aggregation vault's address. /// @param _strategy Strategy address to add function addStrategyToWithdrawalQueue(address _strategy) external { _isCallerAggregationVault(); @@ -60,7 +60,7 @@ contract WithdrawalQueue is AccessControlEnumerableUpgradeable, IWithdrawalQueue } /// @notice Remove a strategy from withdrawal queue array. - /// @dev Can only be called by the aggregation layer vault's address. + /// @dev Can only be called by the aggregation vault's address. /// @param _strategy Strategy address to add. function removeStrategyFromWithdrawalQueue(address _strategy) external { _isCallerAggregationVault(); @@ -102,14 +102,14 @@ contract WithdrawalQueue is AccessControlEnumerableUpgradeable, IWithdrawalQueue emit ReorderWithdrawalQueue(_index1, _index2); } - /// @notice Execute the withdraw initiated in the aggregation layer vault. - /// @dev Can only be called by the aggregation layer vault's address. + /// @notice Execute the withdraw initiated in the aggregation vault. + /// @dev Can only be called by the aggregation vault's address. /// @param _caller Initiator's address of withdraw. /// @param _receiver Withdraw receiver address. /// @param _owner Shares's owner to burn. /// @param _assets Amount of asset to withdraw. /// @param _shares Amount of shares to burn. - /// @param _availableAssets Amount of available asset in aggregation layer vault's cash reserve. + /// @param _availableAssets Amount of available asset in aggregation vault's cash reserve. function callWithdrawalQueue( address _caller, address _receiver, @@ -187,7 +187,7 @@ contract WithdrawalQueue is AccessControlEnumerableUpgradeable, IWithdrawalQueue return $.withdrawalQueue.length; } - /// @dev Check if the msg.sender is the aggregation layer vault. + /// @dev Check if the msg.sender is the aggregation vault. function _isCallerAggregationVault() private view { WithdrawalQueueStorage storage $ = _getWithdrawalQueueStorage(); diff --git a/test/common/EulerAggregationVaultBase.t.sol b/test/common/EulerAggregationVaultBase.t.sol index b4dc1333..41a99ac4 100644 --- a/test/common/EulerAggregationVaultBase.t.sol +++ b/test/common/EulerAggregationVaultBase.t.sol @@ -81,14 +81,14 @@ contract EulerAggregationVaultBase is EVaultTestBase { eulerAggregationVault.grantRole(eulerAggregationVault.ALLOCATIONS_MANAGER_ADMIN(), deployer); eulerAggregationVault.grantRole(eulerAggregationVault.STRATEGY_ADDER_ADMIN(), deployer); eulerAggregationVault.grantRole(eulerAggregationVault.STRATEGY_REMOVER_ADMIN(), deployer); - eulerAggregationVault.grantRole(eulerAggregationVault.AGGREGATION_LAYER_MANAGER_ADMIN(), deployer); + eulerAggregationVault.grantRole(eulerAggregationVault.AGGREGATION_VAULT_MANAGER_ADMIN(), deployer); withdrawalQueue.grantRole(withdrawalQueue.WITHDRAW_QUEUE_MANAGER_ADMIN(), deployer); // grant roles to manager eulerAggregationVault.grantRole(eulerAggregationVault.ALLOCATIONS_MANAGER(), manager); eulerAggregationVault.grantRole(eulerAggregationVault.STRATEGY_ADDER(), manager); eulerAggregationVault.grantRole(eulerAggregationVault.STRATEGY_REMOVER(), manager); - eulerAggregationVault.grantRole(eulerAggregationVault.AGGREGATION_LAYER_MANAGER(), manager); + eulerAggregationVault.grantRole(eulerAggregationVault.AGGREGATION_VAULT_MANAGER(), manager); withdrawalQueue.grantRole(withdrawalQueue.WITHDRAW_QUEUE_MANAGER(), manager); vm.stopPrank(); @@ -122,8 +122,8 @@ contract EulerAggregationVaultBase is EVaultTestBase { eulerAggregationVault.STRATEGY_REMOVER_ADMIN() ); assertEq( - eulerAggregationVault.getRoleAdmin(eulerAggregationVault.AGGREGATION_LAYER_MANAGER()), - eulerAggregationVault.AGGREGATION_LAYER_MANAGER_ADMIN() + eulerAggregationVault.getRoleAdmin(eulerAggregationVault.AGGREGATION_VAULT_MANAGER()), + eulerAggregationVault.AGGREGATION_VAULT_MANAGER_ADMIN() ); assertEq( withdrawalQueue.getRoleAdmin(withdrawalQueue.WITHDRAW_QUEUE_MANAGER()), @@ -133,13 +133,13 @@ contract EulerAggregationVaultBase is EVaultTestBase { assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.ALLOCATIONS_MANAGER_ADMIN(), deployer)); assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.STRATEGY_ADDER_ADMIN(), deployer)); assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.STRATEGY_REMOVER_ADMIN(), deployer)); - assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.AGGREGATION_LAYER_MANAGER_ADMIN(), deployer)); + assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.AGGREGATION_VAULT_MANAGER_ADMIN(), deployer)); assertTrue(withdrawalQueue.hasRole(withdrawalQueue.WITHDRAW_QUEUE_MANAGER_ADMIN(), deployer)); assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.ALLOCATIONS_MANAGER(), manager)); assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.STRATEGY_ADDER(), manager)); assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.STRATEGY_REMOVER(), manager)); - assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.AGGREGATION_LAYER_MANAGER(), manager)); + assertTrue(eulerAggregationVault.hasRole(eulerAggregationVault.AGGREGATION_VAULT_MANAGER(), manager)); assertTrue(withdrawalQueue.hasRole(withdrawalQueue.WITHDRAW_QUEUE_MANAGER(), manager)); assertEq(eulerAggregationVaultFactory.getWithdrawalQueueImplsListLength(), 1); diff --git a/test/e2e/BalanceForwarderE2ETest.t.sol b/test/e2e/BalanceForwarderE2ETest.t.sol index 3432d4d6..e4455ca5 100644 --- a/test/e2e/BalanceForwarderE2ETest.t.sol +++ b/test/e2e/BalanceForwarderE2ETest.t.sol @@ -51,14 +51,14 @@ contract BalanceForwarderE2ETest is EulerAggregationVaultBase { // eulerAggregationVault.grantRole(eulerAggregationVault.WITHDRAW_QUEUE_MANAGER_ADMIN(), deployer); eulerAggregationVault.grantRole(eulerAggregationVault.STRATEGY_ADDER_ADMIN(), deployer); eulerAggregationVault.grantRole(eulerAggregationVault.STRATEGY_REMOVER_ADMIN(), deployer); - eulerAggregationVault.grantRole(eulerAggregationVault.AGGREGATION_LAYER_MANAGER_ADMIN(), deployer); + eulerAggregationVault.grantRole(eulerAggregationVault.AGGREGATION_VAULT_MANAGER_ADMIN(), deployer); // grant roles to manager eulerAggregationVault.grantRole(eulerAggregationVault.ALLOCATIONS_MANAGER(), manager); // eulerAggregationVault.grantRole(eulerAggregationVault.WITHDRAW_QUEUE_MANAGER(), manager); eulerAggregationVault.grantRole(eulerAggregationVault.STRATEGY_ADDER(), manager); eulerAggregationVault.grantRole(eulerAggregationVault.STRATEGY_REMOVER(), manager); - eulerAggregationVault.grantRole(eulerAggregationVault.AGGREGATION_LAYER_MANAGER(), manager); + eulerAggregationVault.grantRole(eulerAggregationVault.AGGREGATION_VAULT_MANAGER(), manager); vm.stopPrank(); uint256 initialStrategyAllocationPoints = 500e18; diff --git a/test/invariant/EulerAggregationLayerInvariants.t.sol b/test/invariant/EulerAggregationLayerInvariants.t.sol index ac91e6a5..5d6d182a 100644 --- a/test/invariant/EulerAggregationLayerInvariants.t.sol +++ b/test/invariant/EulerAggregationLayerInvariants.t.sol @@ -46,6 +46,8 @@ contract EulerAggregationVaultInvariants is EulerAggregationVaultBase { strategyUtil.includeStrategy(address(eTSTforth)); strategyUtil.includeStrategy(address(eTSTfifth)); strategyUtil.includeStrategy(address(eTSTsixth)); + // cash reserve strategy + strategyUtil.includeStrategy(address(0)); eulerAggregationVaultHandler = new EulerAggregationVaultHandler(eulerAggregationVault, actorUtil, strategyUtil, withdrawalQueue); @@ -96,6 +98,18 @@ contract EulerAggregationVaultInvariants is EulerAggregationVaultBase { assertEq(eulerAggregationVault.totalAllocationPoints(), expectedTotalAllocationpoints); } + // Every strategy in the withdrawal queue should have an allocation points > 0. + function invariant_withdrawalQueueStrategiesAllocationPoints() public view { + address withdrawalQueueAddr = eulerAggregationVault.withdrawalQueue(); + + (address[] memory withdrawalQueueArray, uint256 withdrawalQueueLength) = + IWithdrawalQueue(withdrawalQueueAddr).getWithdrawalQueueArray(); + + for (uint256 i; i < withdrawalQueueLength; i++) { + assertGt(eulerAggregationVault.getStrategy(withdrawalQueueArray[i]).allocationPoints, 0); + } + } + // If `total allocation points - cash reserve allocation points == 0`(no strategy added), the withdrawal queue length should be zero. // Else, the length should be greater than zero. function invariant_withdrawalQueue() public view { @@ -147,6 +161,10 @@ contract EulerAggregationVaultInvariants is EulerAggregationVaultBase { assertGe(aggregationVaultSavingRate.interestLeft, accruedInterest); } + function invariant_cashReserveStrategyCap() public view { + assertEq(eulerAggregationVault.getStrategy(address(0)).cap, 0); + } + function _deployOtherStrategies() private { eTSTsecond = IEVault( factory.createProxy(address(0), true, abi.encodePacked(address(assetTST), address(oracle), unitOfAccount))