BasicShareManager
Overview
BasicShareManager is a concrete implementation of the abstract ShareManager, designed to provide native ERC20 style share accounting within a modular vault system. It handles minting, burning, locking, and balance accounting of vault shares directly through a local ERC20 compatible storage layout, without exposing standard ERC20 interfaces.
This contract is intended for setups where shares are not tokenized on-chain as ERC20s but are still tracked internally using the ERC20Upgradeable storage schema.
Key Features
- Uses
ShareManagerfor permissioning, allocation, and whitelisting logic. - Maintains balances and total supply using
ERC20Upgradeable.ERC20Storage. - Internal mint and burn logic emits
IERC20.Transferevents (for transparency or compatibility). - Fully decoupled from standard
ERC20interface. Share movements use vault queues and the internal mint, burn, and lock paths.
Configuration and State
Storage
ERC20 style balances and supply are stored at a fixed storage slot allowing for migrations between BasicShareManager and TokenizedShareManager:
bytes32 private constant ERC20StorageLocation = 0x52c6...ce00;
Initialization
function initialize(bytes calldata data) external initializer
- Expects a single
bytes32 whitelistMerkleRoot(used byShareManager).
Functions
View Functions
activeShares(): Returns_totalSupplyfrom ERC20 storage.activeSharesOf(account): Returns balance ofaccount.
Internal Logic
_mintShares(address, uint256)
- Checks if minting is allowed via
updateChecks. - Increments total supply and receiver's balance.
- Emits
IERC20.Transfer(address(0), account, value).
Reverts if:
account == address(0).- Minting is paused, or the account fails the whitelist or blacklist checks. The global lockup does not block minting.
_burnShares(address, uint256)
- Checks if burning is allowed via
updateChecks. - Decreases sender's balance and total supply.
- Emits
IERC20.Transfer(account, address(0), value).
Reverts if:
account == address(0).value > account balance.- Burning is paused or blocked.
_lockShares(address, uint256)
Applies burn checks to the account, then moves its shares to the manager without changing total supply. It emits IERC20.Transfer(account, address(this), value). The account must be non-zero and its balance must cover the amount.
Invariants and Limitations
Design Notes
- This module deliberately avoids exposing the ERC20 interface, preventing unintended external transfers or integrations.
- It is intended for internal share accounting within vault systems, where shares are tracked but not tokenized on-chain.
- All permissioning logic, including minting, burning, whitelisting, and lockup enforcement, is delegated to the inherited
ShareManager. - This implementation is ideal when the vault owner requires non-transferable shares for internal logic, without compliance to ERC20 or ERC4626 standards.
- It is not appropriate for setups where shares must be externally transferable, interoperable with third-party protocols, or conform to token standards.