Fee-On-Transfer Token Will Cause Accounting Issue Within AxelarGasService
Contract
#157
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-07-axelar/blob/3729dd4aeff8dc2b8b9c3670a1c792c81fc60e7c/contracts/gas-service/AxelarGasService.sol#L12
https://github.com/code-423n4/2022-07-axelar/blob/3729dd4aeff8dc2b8b9c3670a1c792c81fc60e7c/contracts/gas-service/AxelarGasService.sol#L35
https://github.com/code-423n4/2022-07-axelar/blob/3729dd4aeff8dc2b8b9c3670a1c792c81fc60e7c/contracts/gas-service/AxelarGasService.sol#L98
Vulnerability details
The following functions within the
AxelarGasService
contract accept ERC20 tokens:If the ERC20 tokens are Fee-On-Transfer Token, it will cause an accounting issue within the
AxelarGasService
contract as the amount received by the contract is different from the amount emitted within the event.Proof-of-Concept
Consider the
AxelarGasService.addGas
function. Assume that thegasToken
is a Fee-On-Transfer token calledXYZ
that charges a5%
transfer fee.If Alice called the
addGas
function withgasToken
set toXYZ
andgasFeeAmount
set to100
, then the contract will only receive95
XYZ tokens while an event withgasFeeAmount
equal to100
is emitted.https://github.com/code-423n4/2022-07-axelar/blob/3729dd4aeff8dc2b8b9c3670a1c792c81fc60e7c/contracts/gas-service/AxelarGasService.sol#L98
Impact
This will create a discrepancy between the information in the on-chain events and the actual number of tokens received by the contract.
Axelar's microservice or third-party external services that are listening to the on-chain event will be fed with inaccurate data, thus causing accounting issues within the system.
Recommendation
Ensure that Fee-On-Transfer tokens are not used as gas token within the system.
The text was updated successfully, but these errors were encountered: