The HypERC20 contract has a feature which allows mints initial supply to the deployer (in the initialize). This is somewhat of a footgun, and can grant the deployer unintended power on the warp route.
Additional context
Discord developer @lyfsen
Hey, I tried to deploy a new wrap Router, and I deployed an ERC20 token in the collateral chain (collateral mode) using this. It pre-minted 1M tokens.
But I found that in the synthetic chain (synthetic mode), the contract also pre-minted 1M to the sender address.
I think it's abnormal because the synthetic chain token should need minting rather than pre-minting.
So, is it normal to pre-mint in the synthetic chain? It should not premint I want
Solution
Remove initialize minting and rely exclusively on messages to mint initial supply
I'm fine with having this in the initializer, i would just call it initialBalances so that from the function signature, you can tell the purpose of the parameter is to mint that.
Problem
The
HypERC20
contract has a feature which allows mints initial supply to the deployer (in theinitialize
). This is somewhat of a footgun, and can grant the deployer unintended power on the warp route.Additional context Discord developer @lyfsen
Solution
Remove initialize minting and rely exclusively on messages to mint initial supply