Submitted by asui
Integration issues with BUIDL, in the case blackrock decides to set a minimum amount of BUIDL tokens that should be held by its holders.
Blackrock implements a minUSTokens; variable where it sets a minimum amount to be held by the whitelisted addresses at all times. This check is done at every transfer. Currently, this is set to 0; but this could be set by blackrock at anytime.
This is the code from the BUIDL token's contracts/compliance/ComplianceConfigurationService.Sol where the admin could set values for minUSTokens.
Also the line 238 in the contracts/compliance/Compliance/ServiceRegulated.sol is called when transferring token.
This essentially checks that the sender has at least the minimum amount of tokens after the transfer.
The problem is the ousgInstantManager doesnt require that it always has this much amount of BUIDL. When redeeming, suppose it has 300k BUIDL and the minimum is say 10k BUIDL and an investor in Ondo wants to redeem 300k BUIDL tokens. It would still revert even though the contract has it, which could unexpectedly revert; violating one the main functionalities for Ondo (i.e. the instant redeem).
Create a new test file and paste this code below:
Run forge test --mt testBUILDHolderTransfer which will pass but run forge test --mt testMinTokensUS -vvv, i.e. with the same amount after owner sets minUSTokens to 10 million, it will revert.
Note: 10 million is a very large amount and not realistic, it is just to show for the test because the holder 1 has more than 90 million BUIDL. I just set to 10 million to show it will revert. The real value set could be significantly lower than this.
Here in our example, when holder1 tries to transfer the code checks and notice that after transfer the holder will have less than the minimum, i.e. 10 million, so it reverts.
Foundry
Import IDSComplianceConfigurationService or create an interface just for the getMinUSTokens() function and consider replacing the require statement in the _redeemBUIDL function with:
The contract will never try to redeem more than its minimum allowed to hold and appropriately reverts with our error message: OUSGInstantManager::_redeemBUIDL: Insufficient BUIDL balance
We get the address 0x1dc378568cefD4596C5F9f9A14256D8250b56369 of the complianceConfigurationService proxy by querying the BUIDL contract in etherscan using the function no.27 getDSService with 256 as the argument.
This minimum amount required may not be set currently but could be set by the admin in the future. So, implementing it now should be more compatible with BUIDL, even if in the future blackrock decides to set it.
Invalid Validation
cameronclifton (Ondo) acknowledged, but disagreed with severity and commented:
Note: For full discussion, see here.
