Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
fd4de776
Commit
fd4de776
authored
Oct 04, 2018
by
Aniket
Committed by
Nicolás Venturo
Oct 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaces `amount` with `value` for consistency (#1378)
* fixes #1372 * done in ERC20Capped and ERC20Mintable
parent
ace14d3a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
ERC20.sol
contracts/token/ERC20/ERC20.sol
+16
-16
ERC20Capped.sol
contracts/token/ERC20/ERC20Capped.sol
+4
-4
ERC20Mintable.sol
contracts/token/ERC20/ERC20Mintable.sol
+3
-3
No files found.
contracts/token/ERC20/ERC20.sol
View file @
fd4de776
...
@@ -168,28 +168,28 @@ contract ERC20 is IERC20 {
...
@@ -168,28 +168,28 @@ contract ERC20 is IERC20 {
* an account. This encapsulates the modification of balances such that the
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param account The account that will receive the created tokens.
* @param
amount
The amount that will be created.
* @param
value
The amount that will be created.
*/
*/
function _mint(address account, uint256
amount
) internal {
function _mint(address account, uint256
value
) internal {
require(account != 0);
require(account != 0);
_totalSupply = _totalSupply.add(
amount
);
_totalSupply = _totalSupply.add(
value
);
_balances[account] = _balances[account].add(
amount
);
_balances[account] = _balances[account].add(
value
);
emit Transfer(address(0), account,
amount
);
emit Transfer(address(0), account,
value
);
}
}
/**
/**
* @dev Internal function that burns an amount of the token of a given
* @dev Internal function that burns an amount of the token of a given
* account.
* account.
* @param account The account whose tokens will be burnt.
* @param account The account whose tokens will be burnt.
* @param
amount
The amount that will be burnt.
* @param
value
The amount that will be burnt.
*/
*/
function _burn(address account, uint256
amount
) internal {
function _burn(address account, uint256
value
) internal {
require(account != 0);
require(account != 0);
require(
amount
<= _balances[account]);
require(
value
<= _balances[account]);
_totalSupply = _totalSupply.sub(
amount
);
_totalSupply = _totalSupply.sub(
value
);
_balances[account] = _balances[account].sub(
amount
);
_balances[account] = _balances[account].sub(
value
);
emit Transfer(account, address(0),
amount
);
emit Transfer(account, address(0),
value
);
}
}
/**
/**
...
@@ -197,15 +197,15 @@ contract ERC20 is IERC20 {
...
@@ -197,15 +197,15 @@ contract ERC20 is IERC20 {
* account, deducting from the sender's allowance for said account. Uses the
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* internal burn function.
* @param account The account whose tokens will be burnt.
* @param account The account whose tokens will be burnt.
* @param
amount
The amount that will be burnt.
* @param
value
The amount that will be burnt.
*/
*/
function _burnFrom(address account, uint256
amount
) internal {
function _burnFrom(address account, uint256
value
) internal {
require(
amount
<= _allowed[account][msg.sender]);
require(
value
<= _allowed[account][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
// this function needs to emit an event with the updated approval.
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(
amount
);
value
);
_burn(account,
amount
);
_burn(account,
value
);
}
}
}
}
contracts/token/ERC20/ERC20Capped.sol
View file @
fd4de776
...
@@ -27,19 +27,19 @@ contract ERC20Capped is ERC20Mintable {
...
@@ -27,19 +27,19 @@ contract ERC20Capped is ERC20Mintable {
/**
/**
* @dev Function to mint tokens
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param to The address that will receive the minted tokens.
* @param
amount
The amount of tokens to mint.
* @param
value
The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
* @return A boolean that indicates if the operation was successful.
*/
*/
function mint(
function mint(
address to,
address to,
uint256
amount
uint256
value
)
)
public
public
returns (bool)
returns (bool)
{
{
require(totalSupply().add(
amount
) <= _cap);
require(totalSupply().add(
value
) <= _cap);
return super.mint(to,
amount
);
return super.mint(to,
value
);
}
}
}
}
contracts/token/ERC20/ERC20Mintable.sol
View file @
fd4de776
...
@@ -11,18 +11,18 @@ contract ERC20Mintable is ERC20, MinterRole {
...
@@ -11,18 +11,18 @@ contract ERC20Mintable is ERC20, MinterRole {
/**
/**
* @dev Function to mint tokens
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param to The address that will receive the minted tokens.
* @param
amount
The amount of tokens to mint.
* @param
value
The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
* @return A boolean that indicates if the operation was successful.
*/
*/
function mint(
function mint(
address to,
address to,
uint256
amount
uint256
value
)
)
public
public
onlyMinter
onlyMinter
returns (bool)
returns (bool)
{
{
_mint(to,
amount
);
_mint(to,
value
);
return true;
return true;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment