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

chore: refactor using a unique symbol per token #115

Merged
merged 4 commits into from
Nov 22, 2023
Merged

Conversation

JDawg287
Copy link
Member

@JDawg287 JDawg287 commented Nov 17, 2023

Description

This PR prevents users from deploying tokens with the same symbols.

Behaviour before:

  • The same user cannot deploy multiple tokens with the same symbol
  • Different users can deploy tokens with the same symbol

Behaviour after:

  • The same user cannot deploy multiple tokens with the same symbol
  • Different users cannot deploy tokens with the same symbol

Fixes TP-781

Breaking changes

  • Changes the TokenSent event to emit the token symbol along with the token address
  • The following changes were made to some external functions of the ERC20Messaging contract, as tokens are now referred to by their symbols:
    • sendToken(SubnetId targetSubnetId, address tokenAddress -> sendToken(SubnetId targetSubnetId, string calldata symbol
    • getTokenByAddress(address tokenAddress) -> getTokenBySymbol(string calldata symbol)
    • tokenDailyMintAmount(address tokenAddress) -> tokenDailyMintAmount(string memory symbol)
    • tokenDailyMintLimit(address tokenAddress) -> tokenDailyMintLimit(string memory symbol)

PR Checklist:

  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added or updated tests that comprehensively prove my change is effective or that my feature works

@JDawg287 JDawg287 self-assigned this Nov 17, 2023
@JDawg287 JDawg287 merged commit 551d376 into main Nov 22, 2023
8 of 9 checks passed
@JDawg287 JDawg287 deleted the feature/TP-781 branch November 22, 2023 15:09
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.

3 participants