Closed code423n4 closed 2 years ago
We consider the total supply to represent really the total supply of the token. The amount of tokens that are locked on the bridge contract are considered as representing the tokens on the cosmos network since they can't be used in circulation unless bridged.
Yes this is a design choice
Lines of code
https://github.com/code-423n4/2022-05-cudos/blob/de39cf3cd1f1e1cf211819b06d4acf6a043acda0/solidity/contracts/CosmosToken.sol#L4
Vulnerability details
In the current implementation,
CosmosERC20.sol#totalSupply()
will always returnMAX_UINT
, which is not the actualtotalSupply
of the token.The
totalSupply()
function should return the actual supply bridged from Cosmos in order to represent the total number of outstanding tokens on Ethereum.Recommendation
Change to: