Skip to content

Commit

Permalink
update msgsender
Browse files Browse the repository at this point in the history
  • Loading branch information
tomatoishealthy committed Feb 8, 2022
1 parent ad066ef commit bfd3e31
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contracts/child/ChildToken/ChildERC20ForExchange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ contract ChildERC20ForExchange is

function swapIn(uint256 amount) public {
require(originToken != address(0x0), "origin token not set");
IERC20(originToken).transferFrom(msg.sender, address(this), amount);
_mint(msg.sender, amount);
emit SwapIn(msg.sender, amount);
IERC20(originToken).transferFrom(_msgSender(), address(this), amount);
_mint(_msgSender(), amount);
emit SwapIn(_msgSender(), amount);
}

function swapOut(uint256 amount) public {
require(originToken != address(0x0), "origin token not set");
_burn(msg.sender, amount);
IERC20(originToken).transfer(msg.sender, amount);
emit SwapOut(msg.sender, amount);
_burn(_msgSender(), amount);
IERC20(originToken).transfer(_msgSender(), amount);
emit SwapOut(_msgSender(), amount);
}

}

0 comments on commit bfd3e31

Please sign in to comment.