The TempleGold contract integrates with the LayerZero protocol to facilitate cross-chain transfers of the Temple Gold token. It inherits functionality from the OFT (Omnichain Fungible Token) standard provided by LayerZero. One key aspect is ensuring that the contract can send and receive tokens cross-chain, which involves setting appropriate approvals for the OFTAdapter
.
In the context of cross-chain transfers, the OFTAdapter contract needs to be approved as a spender of the corresponding ERC20 token. This approval is necessary for the OFTAdapter to send and receive tokens on behalf of the ERC20 contract. Failure to correctly set this approval can result in failed transactions and inability to perform cross-chain operations.
Here's the reference of the details from LayerZero integration checklists -
Make sure that you approve the OFTAdapter as a spender for the corresponding ERC20 token you plan to convert into an OFT, which will allow the OFTAdapter contract to send/receive tokens cross-chain on behalf of the ERC20.
If the OFTAdapter is not approved, any attempt to transfer tokens cross-chain will fail. Users may face disruptions in the functionality of the contract.
Manual Review
Ensure that the OFTAdapter is approved as a spender for the corresponding ERC20 token immediately after deploying the TempleGold contract. This can be done in the constructor or in an initialization function.
It can take of the following form -
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.