-
Notifications
You must be signed in to change notification settings - Fork 13
Multiple stake improvements #80
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
base: staging
Are you sure you want to change the base?
Conversation
scammi
commented
Jul 14, 2023
- Using ERC20 interface with decimals.
- Base multiplier per staking token.
IERC20 token = ERC20(_programData.rewardToken); | ||
token.safeTransferFrom(msg.sender, address(this), amount); | ||
IERC20Detailed token = IERC20Detailed(_programData.rewardToken); | ||
token.transferFrom(msg.sender, address(this), amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be "safeTransferFrom"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safeTransferFrom is not in the base ERC20 standard.
The token needs to implement the safe token library, and the IONX token does not implement it.
@@ -364,14 +369,17 @@ contract RewardProgram is | |||
// Update Asset Stake | |||
assetStake.claimableRewards = 0; | |||
// Transfer Available Rewards to Receiver | |||
ERC20(_programData.rewardToken).safeTransfer(receiver, totalReward); | |||
IERC20Detailed(_programData.rewardToken).transfer(receiver, totalReward); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be "safeTransfer"
TODO: Implement ERC721 Receiver contract. |