Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider removing initial mint functionality from synthetic warp routes #4013

Open
yorhodes opened this issue Jun 19, 2024 · 1 comment
Open
Labels

Comments

@yorhodes
Copy link
Member

yorhodes commented Jun 19, 2024

Problem

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

@nambrot
Copy link
Contributor

nambrot commented Jun 19, 2024

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.

github-merge-queue bot pushed a commit that referenced this issue Jun 19, 2024
### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants