Submitted by Ruhum, also found by cccz
Its not possible to initialize the accountant because of a mistake in the functions require statement.
I rate it as MED since a key part of the protocol wouldnt be available until the contract is modified and redeployed.
The issue is the following require() statement: https://github.com/Plex-Engineer/lending-market/blob/main/contracts/Accountant/AccountantDelegate.sol#L29
There, the function checks whether the accountant has received the correct amount of tokens. But, it compares the accountants balance with the _initialSupply. That value is always 0. So the require statement will always fail
When the Note contract is initialized, _initialSupply is set to 0:
After _mint_to_Accountant() mints type(uint).max tokens to the accountant: https://github.com/Plex-Engineer/lending-market/blob/main/contracts/Note.sol#L18
That increases the totalSupply but not the _initialSupply: https://github.com/Plex-Engineer/lending-market/blob/main/contracts/ERC20.sol#L242
The _initialSupply value is only modified by the ERC20 contracts constructor.
Change the require statement to
nivasan1 (Canto) confirmed
Alex the Entreprenerd (judge) increased severity to High and commented:
