Guardian's review of Arbitrum MIMv2 Migration for Abracadabra Money, published February 2025. The report records 31 findings across 2 review rounds, including 3 medium and 28 low.
- Published
- Review window
- February 11 to 27, 2025
- Rounds
- Main Review, Remediation Review
- Language
- Solidity
- Chains
- Arbitrum, Ethereum
- Sector
- Stablecoins, Cross-chain
- 0 Critical
- 0 High
- 3 Medium
- 28 Low
- 0 Informational
Findings 31
Main Review
21 findings · February 11 to 17, 2025-
M-01 Medium Excess Fees Are Unrefunded Logical Error Resolved
Description
The AbraOFTUpgradeableExisting contract inherits from SenderWithFees, which overrides the default behavior of
_lzSend. Unlike the standard implementation wheremsg.valuemust match the quotedfee.nativeFee, the override allowsmsg.valueto be any amount. This introduces several issues:- Excess funds are not refunded – If a user sends more than required, the excess remains stuck in the AbraOFTUpgradeableExisting contract.
- Users can bypass fee payments – If the contract has a balance of native tokens, users can send transactions with
msg.value == 0, causing the contract to cover their fees.
Recommendation
Modify the overridden
_lzSendto validate thatmsg.value == nativeFee + protocolNativeFee.Resolution
Guardian: The
quoteNativeFeefunction accepts the_fee.nativeFeeand_fee.lzTokenFeeparameters from the user-supplied MessagingFee. However, themsgValueis disjoint from the MessagingFee since there is no validation that they must match as in LayeroZero’s default_lzSend.Depending on the FeeHandler implementation, it would be possible for a user to pass a zero’d MessagingFee so that they are not charged
protocolNativeFees, yet still pass a normal amount ofmsg.valuefor the OFT transfer to succeed, ultimately bypassing the protocol fee.Recommendation Ensure that FeeHandlers do not rely on the user-supplied MessagingFee.
-
L-01 Low Minter Role Required Warning Resolved
Description
For mint and burn functionality to be permissible on the AnyswapV5 MIM token, which is necessary for debit/credit to facilitate cross-chain transfers, the AbraOFTUpgradeableExisting OFT needs to be set as a minter such that
isMinter = true. However, callingsetMinterandapplyMinterfrom the Vault contract would not work on Kava, Base, Linea, Blast since MintableBurnableERC20 token is used instead of AnyswapV5ERC20.Furthermore, the current migration plan is to set the AbraOFTUpgradeableExisting OFT as an operator on the ElevatedMintedBurner, which would not allow bridging since the AbraOFTUpgradeableExisting contract interacts with the MIM token directly e.g.
token_.mint(_to, _amountLD);Recommendation
Modifiy AbraOFTUpgradeableExisting’s
_debitand_creditfunctions such that the ElevatedMintedBurner’smintandburnfunctions are used instead of interacting with the token directly. -
L-02 Low Incorrect Test Documentation Documentation Resolved
Description
The listed test commands such as
forge test --fork-urlhttps://arb1.arbitrum.io/rpc--mc AbraForkTestsare no longer applicable since the contract has been renamed to AbraForkTestBase.Recommendation
Adjust the testing documentation.
-
L-03 Low Unbacked Dust Due to Shared Decimal Conversion Warning Acknowledged
Description
When the newly minted Arbitrum OFT
totalSupplyis bridged to mainnet, some dust remains due to the conversion from local to shared decimals, division by 1e10 in this case. Consequently, a small amount of dust will not be bridged over and will be unbacked since slightly less is received on mainnet. Furthermore, the totalSupply of the Arbitrum OFT afterwards will be slightly greater than it was prior to the “Mint Total Arbitrum Supply” migration step.Recommendation
Clearly document this behavior or account for the dust with a privileged mint.
-
L-04 Low Unexecuted User Sends Will Not Receive their V1 Funds Warning Acknowledged
Description
User who have sent their funds before the bridges were closed are at risk of not receiving their funds. Consider the following example:
(1) Bob sends 50 MIM to Arbitrum from Mainnet, the packet is sent but unexecuted yet. (2) Abracadabra begins migration and closes the bridges by disabling minting/burning. (3) Bob’s message to transfer 50 MIM cannot be executed as
lzReceivewould revert. (4) Bob ultimately loses his funds as the LayerZeroV1 OFT’s are no longer operational and the funds will be stuck in the LayerZeroV1 Proxy on mainnet.Note that this also applies to cross-chain transfers between the other bridges.
Recommendation
Clearly document this risk to users during the migration process. Furthermore, ensure users are informed that mainnet will allow
lzSendeven if the altchain OFT’s are disabled. -
L-05 Low Total Supply Can Be Modified Before Migration Warning Acknowledged
Description
Users are able to burn their own
AnyswapV5ERC20** **tokens when_vaultOnlyis false by using functionSwapout. If the migration precalculates the supply that needs to be minted, a user can frontrun to burn some MIM. Consequently, the wrong amount of MIM would be minted and a greater amount of MIM would be extracted from the LZV1 OFT than exists on Arbitrum. However, this is not a large issue since the LZV2 adapter will still hold enough backing tokens, and the excess amount that was sent is effectively burnt.Recommendation
Consider setting
_vaultOnlyto true or clearly document this behavior. -
L-06 Low Incorrect Addresses Warning Resolved
Description
The current listed KAVA OFT address is
0x6e858b0DD9a9Dcdf710B28C236292E30ba079728but that address has no contract on Kava. In fact, that is the address of the Moonriver ElevatedMinterBurner. The proper address should be0xc7a161cfd0e133d289b13692b636b8e8b5cd8d8cThe current listed Arbitrum MinterBurner address is0x957A8Af7894E76e16DB17c2A913496a4E60B7090but that is really the OFT’s address. Instead it should be address0x26F20d6Dee51ad59AF339BEdF9f721113D01b6b3The current listed BSC MinterBurner address is
0x41D5A04B4e03dC27dC1f5C5A576Ad2187bc601Afbut that is really the OFT’s address. Instead it should be address0x79533F85479e04d2214305638B6586b724beC951(Figure. See the PDF report.)Recommendation
Ensure to update the migration document with the proper addresses.
-
L-07 Low Mint-Bridge-Disable Must Be Done Atomically Warning Acknowledged
Description
Currently Step 2 of the migration is not specified to be atomic. If this step is not atomic, the following scenario could arise:
(1) 150 AnyswapV5 MIM tokens are sitting on Arbitrum, 50 AnyswapV5 MIM tokens are sitting on Fantom, 200 MIM within ETH LzProxyOFTV2
(2) Once minting is allowed, 150 MIM are minted and bridged to ETH. ETH LzProxyOFTV2 now only holds 50 MIM and new adapter contract holds the 150 MIM.
(3) 50 MIM from FTM is received by the Arbitrum OFT, for example a prior failed message is retried. Now Arbitrum has 200 MIM, but 50 of those are backed by the LayerZero V1 contracts.
(4) Because the LayerZero V1 OFT connections are then disabled, those 50 MIM sitting within ETH LzProxyOFTV2 cannot be retrieved, and the Arbitrum MIM does not have proper backing.
(Figure. See the PDF report.)
Recommendation
Perform this step atomically for all chains and document this in the migration plan.
-
L-08 Low Other Alt-Chains Not Wired Warning Acknowledged
Description
The migration is for OFT’s across multiple altchains, however connections are only configured for the new Arbitrum OFT. This may be unexpected for users who desire to have cross-chain functionality from their new OFT’s on chains such as Fantom, Polygon, etc. (Figure. See the PDF report.)
Recommendation
Ensure pathways are configured between all new LayerZero V2 OFT’s.
-
L-09 Low Migration With Zero Supply Optimization Acknowledged
Description
Currently the migration steps would mint and bridge even if a chain has zero MIM supply. Although this is an extremely rare case, gas can be saved on not attempting these actions.
Recommendation
Consider skipping mint and bridge if there is zero supply or document this.
-
L-10 Low Transfers To MIM Contract Block Messages Validation Acknowledged
Description
The AnyswapV5ERC20 MIM contract does not allow transfers to itself (the MIM contract). However, in the AbraOFTUpgradeableExisting contract, there is no validation preventing users from initiating cross-chain composed messages which would send tokens to the destination chain MIM token contract. As a result any initiated transfers with the to address as the MIM token on the destination chain will be un-executable.
Recommendation
This may be resolved by storing the address of the MIM token contract on each corresponding dstEid in a mapping and validating that the to address is not the destination’s MIM contract by overriding the send function. Alternatively, the
_lzReceivefunction could include logic to send the bridged tokens to a trusted holding address if the to address is the MIM token contract. If no code changes should be implemented for this issue, be sure to clearly document and warn users of this risk. -
L-11 Low Zero Address Transfers Documentation Acknowledged
Description
The LzProxyOFTV2 on Mainnet performs a plain transfer to the recipient. Before bridging from altchains is disabled, a user can send a transfer to mainnet with the
address(0)recipient. This message will never execute, and consequently these funds will forever be locked in the LzProxyOFTV2 contract. Note that this isn’t an attack vector, since these funds are effectively “burnt” by the user from the altchain and hence should not be represented in the backing of the new LayerZeroV2 OFT. Also note that the latest Adapter OFT on mainnet also does not redirect zero address transfers.Recommendation
Be aware of this behavior.
-
L-12 Low Extraneous Operators Must Be Removed Warning Acknowledged
Description
During the MIM V2 migration, it is critical to lock the total supply of MIM. Throughout the altchains, MIM may have more than a single operator. For example, on altchains that use the Anyswap token, in contrast to Kava, Linea, Base and Blast which use MintableBurnableERC20, the Anyswap router should be removed as an operator during the migration process. Furthermore, the Moonriver MIM contract had duplicate minter rights granted to Multichain, therefore steps should be taken to revoke all of them.
Recommendation
For all chains remove any unnecessary operators to prevent supply changes during the migration process. Ensure only trusted contracts retain minting control during the migration process.
-
L-13 Low Minter Role Required Warning Resolved
Description
For mint and burn functionality to be permissible on the AnyswapV5 MIM token, which is necessary for debit/credit to facilitate cross-chain transfers, the AbraOFTUpgradeableExisting OFT needs to be set as a minter such that
isMinter = true. However, callingsetMinterandapplyMinterfrom the Vault contract would not work on Kava, Base, Linea, Blast since MintableBurnableERC20 token is used instead of AnyswapV5ERC20.Furthermore, the current migration plan is to set the AbraOFTUpgradeableExisting OFT as an operator on the ElevatedMintedBurner, which would not allow bridging since the AbraOFTUpgradeableExisting contract interacts with the MIM token directly e.g.
token_.mint(_to, _amountLD);Recommendation
Modifiy AbraOFTUpgradeableExisting’s
_debitand_creditfunctions such that the ElevatedMintedBurner’smintandburnfunctions are used instead of interacting with the token directly. -
L-14 Low Msg.value Is Lost With lzReceive Warning Acknowledged
Description
If users specify
msg.valuein the message execution options, this value will be passed by the executor while callinglzReceiveon the destination chain. The value will be lost as it just ends up as a balance of AbraOFTUpgradeableExisting or AbraOFTAdapterUpgradeable with no way of retrieving it.Recommendation
The balance of AbraOFTUpgradeableExisting or AbraOFTAdapterUpgradeable can be retrieved by adding an admin function to transfer the balance to the owner. Otherwise, make sure to document this behavior in the docs.
-
L-15 Low Mint-Bridge-Disable Must Be Done Atomically Warning Acknowledged
Description
Currently Step 2 of the migration is not specified to be atomic. If this step is not atomic, the following scenario could arise:
(1) 150 AnyswapV5 MIM tokens are sitting on Arbitrum, 50 AnyswapV5 MIM tokens are sitting on Fantom, 200 MIM within ETH LzProxyOFTV2
(2) Once minting is allowed, 150 MIM are minted and bridged to ETH. ETH LzProxyOFTV2 now only holds 50 MIM and new adapter contract holds the 150 MIM.
(3) 50 MIM from FTM is received by the Arbitrum OFT, for example a prior failed message is retried. Now Arbitrum has 200 MIM, but 50 of those are backed by the LayerZero V1 contracts.
(4) Because the LayerZero V1 OFT connections are then disabled, those 50 MIM sitting within ETH LzProxyOFTV2 cannot be retrieved, and the Arbitrum MIM does not have proper backing.
(Figure. See the PDF report.)
Recommendation
Perform this step atomically for all chains and document this in the migration plan.
-
L-16 Low Step 3 Should Be Completed After Successful Transfer Documentation Resolved
Description
During the migration, step 3 to activate the MIM bridges should be performed after the messages from step 2 are successfully received and the adapter properly backs the MIMV2 OFT on the altchains. This is necessary because if a user transfers their MIM from an altchain to Mainnet before step 2 messages are fulfilled, the message receipt will either revert or consume the backing of other chains such as Bera.
Recommendation
Document this in the migration plan.
-
L-17 Low Re-org Risk Warning Acknowledged
Description
Certain chains are susceptible to block re-orgs such as Polygon. In the case of a block re-org, the transaction for step 2 may end up being executed before the transaction for step 1. This may lead the total supply to be minted and bridged when pre-crime is still enabled, which is expected to be turned off according to the migration plan. Furthermore, if step 2 executes before step 1, a user may seize the opportunity to execute their pending message payload since the OFT would not be disabled as an operator yet. This could lead to too little MIM being bridged over to Mainnet when step 2 executes with a stale total supply, leaving a portion of funds unbacked from the mainnet v2 adapter.
Recommendation
Be aware of this case or consider waiting for sufficient confirmations before proceeding with the next step.
-
L-18 Low Incompatibility With Existing Protocols Documentation Acknowledged
Description
LayerZeroV1 OFT’s rely on function
sendFromfor crosschain transfers, while LayerZeroV2 OFT’s use functionsend. Consequently, any existing protocols that rely on functionsendFromwill experience reverts.Recommendation
Ensure protocols are aware of the migration, that their operations may be affected, and will need to update their calls to use
send -
L-19 Low Extraneous Operators Must Be Removed Warning Acknowledged
Description
Throughout the altchains, MIM may have more than a single operator. For example, on altchains that use the Anyswap token, in contrast to Kava, Linea, Base and Blast which use MintableBurnableERC20, the Anyswap router should be removed as an operator during the migration process.
Recommendation
For all chains remove any unnecessary operators to prevent supply changes during the migration process.
-
L-20 Low Zero Address Transfers Documentation Acknowledged
Description
The LzProxyOFTV2 on Mainnet performs a plain transfer to the recipient. Before bridging from altchains is disabled, a user can send a transfer to mainnet with the
address(0)recipient. This message will never execute, and consequently these funds will forever be locked in the LzProxyOFTV2 contract. Note that this isn’t an attack vector, since these funds are effectively “burnt” by the user from the altchain and hence should not be represented in the backing of the new LayerZeroV2 OFT. Also note that the latest Adapter OFT on mainnet also does not redirect zero address transfers.Recommendation
Be aware of this behavior and document this for users.
Remediation Review
10 findings · February 20 to 27, 2025-
M-01 Medium FeeHandler Calls Bricked DoS Resolved
Description
AbraOFTUpgradeableExisting.sol is currently set to be deployed on Arbitrum with
0xE66BE95FE4E3889a66925d996AF3E4dC173754a2as the FeeHandler. The issue is that this FeeHandler does not support the newquoteNativeFee()interface without parameters, which will lead to a revert when sending any cross-chain transfer.Recommendation
Deploy the updated FeeHandler and then update the
deploy/MIMOFT.tsscript to use the new address. -
M-02 Medium totalSupply Does Not Reflect Pending Failed LZ Messages Warning Acknowledged
Description
During the migration to the MIM v2 token standard, the
setOperator(<OFT>, false)function is called on all alternate chains (alt-chains) to revoke operator permissions. However, due to the asynchronous nature of blockchain networks, these calls cannot be executed simultaneously across all chains. This creates a timing window where cross-chain bridging fails, leading to inaccurate token supply tracking. As part of the migration process, thesetOperator(<OFT>, false)function is invoked on each alt-chain to disable operator permissions for the Omnichain Fungible Token (OFT) contract. For example:- On Arbitrum, this call occurs at timestamp 1000.
- On Optimism (and potentially other alt-chains), it’s delayed, occurring at timestamp 1020 due to network differences. If a user bridges MIM tokens from Optimism to Arbitrum at timestamp 1007, after Arbitrum’s operator is revoked but before Optimism’s, the transaction fails:
- On Optimism, the tokens are locked or burned to initiate the transfer.
- On Arbitrum, the
lzReceivefunction reverts because the operator permissions were revoked at timestamp 1000, blocking the minting of tokens. This results in:
- The transfer doesn’t complete.
- Arbitrum’s
totalSupplydoesn’t reflect the pending tokens, as they aren’t minted. - The MIM v2 Mainnet Adapter (
AbraOFTAdapterUpgradeable) fails to fully back alt-chains if these pending tokens remain unprocessed. Pending messages can be retried later, but until they are, the supply on Arbitrum (and potentially other alt-chains) remains understated.
Recommendation
When the new MIM amount to send to the MIM v2 Mainnet Adapter is calculated, do consider the MIM that is part of these failed/pending messages to guarantee that the alt chain supply is fully backed.
-
L-01 Low Token May Be Misleading Documentation Resolved
Description
With the
token_ofAbraOFTUpgradeableExistingbeing the ElevatedMinterBurner on chains using the Anyswap MIM token, thetoken()function may return misleading results to integrators.Recommendation
Clearly document this behavior.
-
L-02 Low Existing OFTs Will Not Refund Excess Native Documentation Acknowledged
Description
The live version of the Mainnet LZ adapter as well as the Berachain OFT use SenderWithFees where
msg.valuein excess of the MessagingFee is not refunded and will remain in the contract. This may lead to loss of funds for unsuspecting users who expect a typical refund or validation that they did not send too much or too little native tokens for a cross-chain transfer.Recommendation
Clearly document this behavior for the existing LayerZero V2 OFT’s.
-
L-03 Low Optimism FeeHandler Will Revert With New OFT Warning Resolved
Description
The FeeHandler on Optimism
0x0B79A169bF618bDD2a73698Fc8ec4A451182a012(deployed on February 20, 2025) does not have aquoteNativeFeefunction without parameters. Consequently, FeeHandler Calls Bricked will apply on this chain if it was set as the FeeHandler.** **Recommendation
Deploy a new FeeHandler with the updated
quoteNativeFeefunction and only then set it for the OFT. -
L-04 Low Address Verification Documentation Resolved
Description
The
0x29d2fEC890B037B2d34f061F9a50f76F85ddBcAEBERA/USD feed on Berachain is unverified. Furthermore, it has zero activity.Furthermore, safe address on Optimism is
0xCbb86ffF0F8094C370cdDb76C7F270C832a8C7C0but the address has limited activity.Recommendation
Ensure the above addresses are Abra controlled and valid.
-
L-05 Low TODO In Optimism Config Warning Acknowledged
Description
The
optimism-mainnetconfig currently has a TODO as thesafeUrlwhich may impact LayerZero wiring operations.Recommendation
Be aware of this and ensure it is updated.
-
L-06 Low Overly Conservative Confirmation Setting for Berachain Warning Acknowledged
Description
Berachain employs a "single slot finality" mechanism, as outlined in its documentation and glossary. This means that once a block is produced in a slot, it is immediately considered final and transactions within it are irrevocably settled without requiring additional confirmations. This instant finality ensures that confirmed transactions cannot be altered or reversed, providing a high level of assurance right away. However, in the LayerZero configuration script for Abracadabra's MIM token (
abracadabra-oft-v2-existing-token-oft/layerzero.mim.config.ts), the confirmation requirement for messages sent from Berachain to other chains, such as Ethereum and Arbitrum, is set to 20 blocks. This is evident in the configuration:const connections = await generateConnectionsConfig([ [ethereumContract, beraContract, [['LayerZero Labs', 'MIM'], []], [15, 20], [EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS]], [ethereumContract, arbitrumContract, [['LayerZero Labs', 'MIM'], []], [15, 20], [EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS]], [arbitrumContract, beraContract, [['LayerZero Labs', 'MIM'], []], [20, 20], [EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS]], ]) as OmniEdgeHardhat<OAppEdgeConfig>[];Here, the
[15, 20]for[ethereumContract, beraContract]indicates 15 confirmations for messages from Ethereum to Berachain and 20 confirmations for messages from Berachain to Ethereum. Similarly,[20, 20]for[arbitrumContract, beraContract]sets 20 confirmations for messages from Berachain to Arbitrum (and vice versa). This setting of 20 confirmations for messages originating from Berachain appears overly conservative given its instant finality.Recommendation
Merely informative. If higher bridging speed is required, be aware that the confirmation requirement for messages sent from Berachain to other chains can be reduced, leveraging Berachain's single slot finality.
-
L-07 Low Missing Validation in setFeeTo Function Warning Acknowledged
Description
The
setFeeTofunction in the contract is designed to set an address (feeTo) that receives protocol fees in the form of native assets (e.g., Ether) during cross-chain operations. However, it lacks proper validation to ensure the specifiedfeeToaddress can actually receive these native assets. As the protocol relies on a low-level call in the_lzSendfunction to transfer fees, if thefeeToaddress can not receive native assets (i.e. if it doesn’t implement areceivefunction) the bridging would be totally blocked:(bool success, ) = IFeeHandler(feeHandler).feeTo().call{ value: protocolNativeFees }("");Recommendation
Consider adding a check in
setFeeTofunction that performs a zero-value transfer to the proposedfeeToaddress. This ensures the address can receive native assets without requiring the contract to hold funds. -
L-08 Low Incomplete Cross-Chain Configuration for Alt-Chains Warning Acknowledged
Description
The configuration file
layerzero.mim.config.tslacks a connection definition for Optimism, and potentially other alt-chains, despite evidence in the deployment script (MIMOFT.ts) that these chains are intended to be supported. Without these connections, cross-chain bridging between Mainnet and Optimism (or other alt-chains) cannot occur, as LayerZero relies on explicitly defined pathways to facilitate messaging and token transfers.Recommendation
Update
layerzero.mim.config.tsto include Optimism and other intended alt-chains in thegenerateConnectionsConfigarray. Use appropriate confirmation numbers and options based on chain characteristics (e.g., Optimism’s finality).
No findings match.
More from Abracadabra Money
All 19 reports-
MagicGLP Upgrade
11 findings1 high 11 findings: 1 high, 10 low -
PurrSwap Aerodrome
105 findings9 high 105 findings: 9 high, 23 medium, 45 low, 28 informational -
PurrSwap ve33
74 findings5 critical · 10 high 74 findings: 5 critical, 10 high, 20 medium, 39 low -
Hyperliquid OFT Deployment
3 findings 3 findings: 1 low, 2 informational
Put your code through the same review.
This review started with a conversation about scope. Tell us what you are building and we will plan yours with you.
