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

ERC20.sol file's 'function _transfer ' is different from github file #1966

Closed
skqksh opened this issue Oct 25, 2019 · 3 comments
Closed

ERC20.sol file's 'function _transfer ' is different from github file #1966

skqksh opened this issue Oct 25, 2019 · 3 comments

Comments

@skqksh
Copy link

skqksh commented Oct 25, 2019

ERC20.sol file's 'function _transfer ' is different from github file

  1. npm install @openzeppelin/contracts
  2. checke contracts/token/ERC20/ERC20.sol of '_transfer ' function

in my 'ERC20.sol'
_balances[sender] = _balances[sender].sub(amount);

but github
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");

@abcoathup
Copy link
Contributor

Hi @skqksh,

The difference is that with the package you are using the latest release version which is 2.3
https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v2.3.0

Whilst on GitHub you are looking at the master branch.
You should always use code from a release version.

2.3 version:
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.3.0/contracts/token/ERC20/ERC20.sol#L156

master version:
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol#L158

For questions it is best to ask in the Community Forum as anyone from the community can help.
https://forum.openzeppelin.com/

@skqksh
Copy link
Author

skqksh commented Oct 25, 2019

thank you so much

@frangio
Copy link
Contributor

frangio commented Oct 25, 2019

This particular change was introduced in #1828 and is part of the 2.4 release.

This release has been in beta for a few months (longer than normal) but will be finally released next week.

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

No branches or pull requests

4 participants