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

feat(system-contracts): remove unecessary methods from L2BaseToken.sol #509

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

thomas-nguy
Copy link
Member

@thomas-nguy thomas-nguy commented Jun 7, 2024

What ❔

Remove Name, Symbol and Decimal from L2BaseToken.sol

Why ❔

Multiple issues with those methods :

1- For hyperchains that does not use ETH as base token, the values returned by those methods are wrong so it should not be hardcoded. I couldnt find a good way to make them variable without heavy changes on the initialisation process

2- L2BaseToken IS not an ERC20 as it does not implement IERC20 interface (no approval or allowance) but it looks like it which confuse some explorers

One example is on https://era.zksync.network/

The value of ETH is counted twices as it is also recorded as an ERC20
https://era.zksync.network/address/0xd0c511bdbf219e3d5793e47b9ad559c9f69b3404

We should remove all confusion and make "symbol" and "name" agnostics as it is done on Ethereum

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.

@@ -3,49 +3,49 @@
"contractName": "AccountCodeStorage",
"bytecodePath": "artifacts-zk/contracts-preprocessed/AccountCodeStorage.sol/AccountCodeStorage.json",
"sourceCodePath": "contracts-preprocessed/AccountCodeStorage.sol",
"bytecodeHash": "0x0100005db7d0621192834d201f8bcd14c6ac987b95f422ca8bb28d500748f1fa",
"bytecodeHash": "0x0100005d2738cecf77ecb3272d04276e7f9585db5afadd4f33eb8e943b5a07cf",
Copy link
Member Author

Choose a reason for hiding this comment

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

For some reasons I am having a lot of diffs in bytecodeHash while nothing has been changed.

Is the dev branch updated?

@thomas-nguy thomas-nguy changed the title feat(system-contrats): remove unecessary methods from L2BaseToken.sol feat(system-contracts): remove unecessary methods from L2BaseToken.sol Jun 7, 2024
@@ -128,21 +128,4 @@ contract L2BaseToken is IBaseToken, ISystemContract {
return abi.encodePacked(IMailbox.finalizeEthWithdrawal.selector, _to, _amount, _sender, _additionalData);
}

/// @dev This method has not been stabilized and might be
/// removed later on.
function name() external pure override returns (string memory) {
Copy link
Member

Choose a reason for hiding this comment

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

What is the motivation for removing these?

Copy link
Member Author

@thomas-nguy thomas-nguy Jun 7, 2024

Choose a reason for hiding this comment

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

It is in the description of this PR but in a nutshell

  • incompatibility with chain not using ETH as base token
  • confuse some explorers

@thomas-nguy thomas-nguy force-pushed the thomas/remove-unecessary-method-base-token branch from aeb6efa to ba92b7f Compare June 18, 2024 09:05
@thomas-nguy
Copy link
Member Author

@vladbochok any additional info you need ?

@thomas-nguy
Copy link
Member Author

@vladbochok any advices on how to update the SystemContractsHashes file properly?

@koloz193
Copy link
Contributor

koloz193 commented Oct 3, 2024

@vladbochok any advices on how to update the SystemContractsHashes file properly?

@thomas-nguy you should be able to merge in dev, take any of the changes (this will be overwritten), and then run yarn sc build && yarn sc calculate-hashes:fix from the root folder

@thomas-nguy thomas-nguy force-pushed the thomas/remove-unecessary-method-base-token branch from f1256fe to 749da2d Compare October 4, 2024 06:22
@thomas-nguy
Copy link
Member Author

@koloz193 Thanks, I have rebased and updated the file

I am ending having a lot of differences, perhaps the file in the dev branch is outdated?

@thomas-nguy thomas-nguy force-pushed the thomas/remove-unecessary-method-base-token branch from 749da2d to a19bfdb Compare October 18, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants