Skip to content

Commit

Permalink
- Changed msg.sender to _msgSender()
Browse files Browse the repository at this point in the history
  • Loading branch information
eboadom committed Oct 27, 2020
1 parent bb6b322 commit 87bbfb9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion contracts/mocks/tokens/MintableERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract MintableERC20 is ERC20 {
* @return A boolean that indicates if the operation was successful.
*/
function mint(uint256 value) public returns (bool) {
_mint(msg.sender, value);
_mint(_msgSender(), value);
return true;
}
}
4 changes: 2 additions & 2 deletions contracts/tokenization/AToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
bytes32 public DOMAIN_SEPARATOR;

modifier onlyLendingPool {
require(msg.sender == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
require(_msgSender() == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
_;
}

Expand Down Expand Up @@ -108,7 +108,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {

//transfer event to track balances
emit Transfer(user, address(0), amount);
emit Burn(msg.sender, receiverOfUnderlying, amount, index);
emit Burn(_msgSender(), receiverOfUnderlying, amount, index);
}

/**
Expand Down
18 changes: 9 additions & 9 deletions contracts/tokenization/IncentivizedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
}

/**
* @dev executes a transfer of tokens from msg.sender to recipient
* @dev executes a transfer of tokens from _msgSender() to recipient
* @param recipient the recipient of the tokens
* @param amount the amount of tokens being transferred
* @return true if the transfer succeeds, false otherwise
**/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
emit Transfer(msg.sender, recipient, amount);
emit Transfer(_msgSender(), recipient, amount);
return true;
}

Expand All @@ -101,8 +101,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
}

/**
* @dev allows spender to spend the tokens owned by msg.sender
* @param spender the user allowed to spend msg.sender tokens
* @dev allows spender to spend the tokens owned by _msgSender()
* @param spender the user allowed to spend _msgSender() tokens
* @return true
**/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
Expand All @@ -111,7 +111,7 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
}

/**
* @dev executes a transfer of token from sender to recipient, if msg.sender is allowed to do so
* @dev executes a transfer of token from sender to recipient, if _msgSender() is allowed to do so
* @param sender the owner of the tokens
* @param recipient the recipient of the tokens
* @param amount the amount of tokens being transferred
Expand All @@ -133,8 +133,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
}

/**
* @dev increases the allowance of spender to spend msg.sender tokens
* @param spender the user allowed to spend on behalf of msg.sender
* @dev increases the allowance of spender to spend _msgSender() tokens
* @param spender the user allowed to spend on behalf of _msgSender()
* @param addedValue the amount being added to the allowance
* @return true
**/
Expand All @@ -144,8 +144,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
}

/**
* @dev decreases the allowance of spender to spend msg.sender tokens
* @param spender the user allowed to spend on behalf of msg.sender
* @dev decreases the allowance of spender to spend _msgSender() tokens
* @param spender the user allowed to spend on behalf of _msgSender()
* @param subtractedValue the amount being subtracted to the allowance
* @return true
**/
Expand Down
2 changes: 1 addition & 1 deletion contracts/tokenization/base/DebtTokenBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract contract DebtTokenBase is IncentivizedERC20, VersionedInitializable {
* @dev Only lending pool can call functions marked by this modifier
**/
modifier onlyLendingPool {
require(msg.sender == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
require(_msgSender() == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
_;
}

Expand Down

0 comments on commit 87bbfb9

Please sign in to comment.