Skip to content

Conversation

scammi
Copy link
Contributor

@scammi 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be "safeTransferFrom"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robsecord

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.

assetStake.claimableRewards = 0;
// Transfer Available Rewards to Receiver
ERC20(_programData.rewardToken).safeTransfer(receiver, totalReward);
IERC20Detailed(_programData.rewardToken).transfer(receiver, totalReward);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be "safeTransfer"

@scammi
Copy link
Contributor Author

scammi commented Jul 25, 2023

TODO:

Implement ERC721 Receiver contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants