Skip to content

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

Open
wants to merge 10 commits into
base: staging
Choose a base branch
from
Open

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.

@@ -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);
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