-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #476 from DistributedCollective/fix/staking_stake
Fix/staking stake
- Loading branch information
Showing
4 changed files
with
538 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
pragma solidity ^0.5.17; | ||
pragma experimental ABIEncoderV2; | ||
|
||
import "../../governance/Staking/interfaces/IStaking.sol"; | ||
import "../../interfaces/IERC20.sol"; | ||
|
||
import "hardhat/console.sol"; | ||
|
||
contract StakingWrapperMockup { | ||
IStaking staking; | ||
IERC20 token; | ||
|
||
constructor(IStaking _staking, IERC20 _token) public { | ||
staking = _staking; | ||
token = _token; | ||
} | ||
|
||
function stake2times( | ||
uint96 amount, | ||
uint256 until, | ||
address stakeFor, | ||
address delegatee | ||
) external { | ||
require(token.transferFrom(msg.sender, address(this), amount * 2)); | ||
token.approve(address(staking), amount * 2); | ||
|
||
staking.stake(amount, until, stakeFor, delegatee); | ||
staking.stake(amount, until, stakeFor, delegatee); | ||
} | ||
} |
Oops, something went wrong.