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

bug(erc20): registerCoin deploys erc20 contract with different minimal coin denomination #200

Merged
merged 7 commits into from
Jan 7, 2022

Conversation

danburck
Copy link
Contributor

@danburck danburck commented Jan 7, 2022

Description

Closes: https://linear.app/tharsis/issue/ENG-351/registercoin-deploys-erc20-contract-with-different-minimal-coin

This PR makes sure that the deployed erc20 has the same decimals as the coin during registerCoin.

@linear
Copy link

linear bot commented Jan 7, 2022

ENG-351 `registerCoin` deploys erc20 contract with different minimal coin denomination

When you register a coin right now with decimals != 18 it will have a different decimal for the deployed ERC20 token. This can be very confusing for users as the coin and the token might use different prefixes (e.g. aPhoton). The deployed ERC20 Token has a standard of 18 decimals hardcoded.

To avoid confusion, we need to create a contract that overrides the decimals on deployment.

@codecov
Copy link

codecov bot commented Jan 7, 2022

Codecov Report

Merging #200 (bca5042) into main (350a9ad) will increase coverage by 0.10%.
The diff coverage is 100.00%.

❗ Current head bca5042 differs from pull request most recent head 6f7d210. Consider uploading reports for the commit 6f7d210 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   72.04%   72.15%   +0.10%     
==========================================
  Files          32       32              
  Lines        2168     2176       +8     
==========================================
+ Hits         1562     1570       +8     
  Misses        534      534              
  Partials       72       72              
Impacted Files Coverage Δ
x/erc20/keeper/msg_server.go 69.83% <100.00%> (+0.20%) ⬆️
x/erc20/keeper/proposals.go 91.17% <100.00%> (+0.26%) ⬆️

@danburck danburck changed the title ENG 351 add ERC20PresetMinterPauserDecimal contract registerCoin deploys erc20 contract with different minimal coin denomination Jan 7, 2022
@danburck danburck marked this pull request as ready for review January 7, 2022 18:20
@danburck danburck changed the title registerCoin deploys erc20 contract with different minimal coin denomination bug(erc20): registerCoin deploys erc20 contract with different minimal coin denomination Jan 7, 2022
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK! Can you add a bug fix changelog entry too?

x/erc20/keeper/msg_server.go Show resolved Hide resolved
@danburck danburck enabled auto-merge (squash) January 7, 2022 18:32
@danburck danburck merged commit 790a73f into main Jan 7, 2022
@danburck danburck deleted the ENG-351-add-ERC20PresetMinterPauserDecimal-contract branch January 7, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants