Omniscia Optimex Audit
OptimexBTC Manual Review Findings
OptimexBTC Manual Review Findings
OBT-01M: Potential Race Condition of Mints
| Type | Severity | Location |
|---|---|---|
| Logical Fault | ![]() | OptimexBTC.sol:L62-L66, L74-L79 |
Description:
The OptimexBTC::mint function appears to reset the out-of-circulation available balance, however, it does so by burning the contract's existing balance and minting a new one.
This approach will not yield a consistent increase in the total supply of the token due to the fact that an allocation might be executed between an OptimexBTC::mint transaction's submission and its execution in the network.
Impact:
The OptimexBTC::totalSupply might be temporarily de-synchronized due to transaction ordering.
Example:
56/**57 @notice Mints the specified amount of tokens to itself58 @dev Caller must have the MINTER role59 @dev Burns the contract’s existing balance and mints the exact specified amount.60 @param amount Amount of tokens to mint61*/62function mint(uint256 amount) external onlyRole(_MINTER) {63 _burnSelf();64
65 _mint(amount);66}67
68/**69 @notice Allocates tokens to an authorized recipient70 @dev Caller must have the ALLOCATOR role71 @param to Address to transfer tokens to72 @param amount Amount of tokens to transfer73*/74function allocateTo(75 address to,76 uint256 amount77) external onlyRole(_ALLOCATOR) {78 _allocateTo(to, amount);79}Recommendation:
We advise the code to either validate the amount burned in the contract or to accept an amount delta, ensuring consistency in the result of the OptimexBTC::mint operation.
Alleviation (c11bae0aacaeb7f4e4b53c864f96917ca574182f):
The Optimex team evaluated this exhibit and clarified that a temporary increase in the expected total supply can be trivially corrected and that they wish to acknowledge this exhibit.
