Created
July 2, 2019 20:46
-
-
Save andreafspeziale/fff17d8312c2e49902e2e72019983cea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (_rewardAmount > 0) { | |
// address 0 mean reward with ETH | |
if (_rewardTokenAddress == address(0)){ | |
// reward with ETH | |
msg.sender.transfer(_rewardAmount); | |
} else { | |
// reward token | |
require( | |
_rewardTokenAddress._safeTransfer( | |
msg.sender, | |
_rewardAmount | |
), | |
"fn: forward(), msg: token transfer failed" | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment