You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
### Description
Token deployer should always derive token metadata's total supply to 0,
otherwise the collateral token's total supply will be minted initially
on the synthetic, creating 2x the desired total supply.
### Related issues
- Regression introduced by
#3820
- opens #4013
### Backward compatibility
Yes
### Testing
Unit Tests
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
The text was updated successfully, but these errors were encountered: