The amount of minted tokens is tracked in the BToken contract by the totalSupply function. Burning tokens is only possible using an internal operation (called by BPools). However, the transfer and transferFrom methods do not restrict the address destination of address(0x0), allowing tokens to effectively be burned without decreasing the totalSupply variable.
Exploit Scenario
Alice create a pool and uses some off-chain code to manage it. A calculation results in a transfer to the null or empty address of 0x0. As a result, Alice loses her tokens.
Recommendation
Add a require condition in transfer and transferFrom that explicitly forbids burning tokens transfer them to 0x0.
Long term, use Echidna and Manticore to check that the BToken does not allow to easily burn tokens transfer them to 0x0.
Severity: Low Difficulty: Low
Description
The amount of minted tokens is tracked in the
BToken
contract by thetotalSupply
function. Burning tokens is only possible using an internal operation (called byBPools
). However, thetransfer
andtransferFrom
methods do not restrict the address destination ofaddress(0x0)
, allowing tokens to effectively be burned without decreasing thetotalSupply
variable.Exploit Scenario
Alice create a pool and uses some off-chain code to manage it. A calculation results in a transfer to the null or empty address of 0x0. As a result, Alice loses her tokens.
Recommendation
Add a require condition in
transfer
andtransferFrom
that explicitly forbids burning tokens transfer them to 0x0.Long term, use Echidna and Manticore to check that the
BToken
does not allow to easily burn tokens transfer them to 0x0.