forked from crytic/properties
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBadShareInflation.sol
31 lines (24 loc) · 1.16 KB
/
BadShareInflation.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.0;
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {ERC4626} from "solmate/src/mixins/ERC4626.sol";
import {CryticERC4626PropertyTests} from "../../ERC4626PropertyTests.sol";
import {TestERC20Token} from "../../util/TestERC20Token.sol";
import {CryticERC4626SecurityProps} from "../../properties/SecurityProps.sol";
/// @notice Basic solmate 4626 impl for property validation/testing.
contract BadShareInflation is ERC4626 {
uint256 private _totalAssets;
constructor(ERC20 _asset) ERC4626(_asset, "Test Vault", _asset.symbol()) {}
function totalAssets() public view virtual override returns (uint256) {
return asset.balanceOf(address(this));
}
function beforeWithdraw(uint256 assets, uint256) internal override {}
function afterDeposit(uint256 assets, uint256) internal override {}
}
contract TestHarness is CryticERC4626SecurityProps {
constructor() {
TestERC20Token _asset = new TestERC20Token("Test Token", "TT", 18);
ERC4626 _vault = new BadShareInflation(ERC20(address(_asset)));
initialize(address(_vault), address(_asset), false);
}
}