Security
Upgrade protection
function _authorizeUpgrade(address) internal override {
require(factory != address(0), "No factory");
require(msg.sender == IVaultFactory(factory).owner(), "Only factory owner");
}Reentrancy protection
function buy(uint256 usdcAmount) external nonReentrant { ... }
function sell(uint256 tokens) external nonReentrant { ... }Access control
modifier onlyAdmin() {
require(msg.sender == admin, "Not admin");
_;
}
modifier onlyLeader() {
require(msg.sender == leader, "Not leader");
_;
}
modifier onlyVaultOrLeader() {
require(
msg.sender == vault ||
msg.sender == IBondingCurveVault(vault).leader() ||
apiWallets[msg.sender],
"Not authorized"
);
_;
}Fee caps
NAV manipulation protections
Liquidity protections
Last updated