-
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 branch 'development' of https://github.com/DistributedCollectiv…
…e/Sovryn-smart-contracts into development
- Loading branch information
Showing
13 changed files
with
450 additions
and
102 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
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,24 @@ | ||
pragma solidity 0.5.17; | ||
|
||
/** | ||
* @title Used to get and set mock block number. | ||
*/ | ||
contract BlockMockUp { | ||
uint256 public blockNum; | ||
|
||
/** | ||
* @notice To get the `blockNum`. | ||
* @return _blockNum The block number. | ||
*/ | ||
function getBlockNum() public view returns (uint256 _blockNum) { | ||
return blockNum; | ||
} | ||
|
||
/** | ||
* @notice To set the `blockNum`. | ||
* @param _blockNum The block number. | ||
*/ | ||
function setBlockNum(uint256 _blockNum) public { | ||
blockNum = _blockNum; | ||
} | ||
} |
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,25 @@ | ||
pragma solidity ^0.5.17; | ||
|
||
import "../governance/Staking/Staking.sol"; | ||
import "./BlockMockUp.sol"; | ||
|
||
contract StakingMock is Staking { | ||
///@notice the block mock up contract | ||
BlockMockUp public blockMockUp; | ||
|
||
/** | ||
* @notice gets block number from BlockMockUp | ||
* @param _blockMockUp the address of BlockMockUp | ||
*/ | ||
function setBlockMockUpAddr(address _blockMockUp) public onlyOwner { | ||
require(_blockMockUp != address(0), "block mockup address invalid"); | ||
blockMockUp = BlockMockUp(_blockMockUp); | ||
} | ||
|
||
/** | ||
* @notice Determine the current Block Number from BlockMockUp | ||
* */ | ||
function _getCurrentBlockNumber() internal view returns (uint256) { | ||
return blockMockUp.getBlockNum(); | ||
} | ||
} |
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,31 @@ | ||
pragma solidity ^0.5.17; | ||
|
||
import "../governance/StakingRewards/StakingRewards.sol"; | ||
import "./BlockMockUp.sol"; | ||
|
||
/** | ||
* @title Staking Rewards Contract MockUp | ||
* @notice This is used for Testing | ||
* */ | ||
contract StakingRewardsMockUp is StakingRewards { | ||
///@notice the block mock up contract | ||
BlockMockUp public blockMockUp; | ||
|
||
using SafeMath for uint256; | ||
|
||
/** | ||
* @notice gets block number from BlockMockUp | ||
* @param _blockMockUp the address of BlockMockUp | ||
*/ | ||
function setBlockMockUpAddr(address _blockMockUp) public onlyOwner { | ||
require(_blockMockUp != address(0), "block mockup address invalid"); | ||
blockMockUp = BlockMockUp(_blockMockUp); | ||
} | ||
|
||
/** | ||
* @notice Determine the current Block Number from BlockMockUp | ||
* */ | ||
function _getCurrentBlockNumber() internal view returns (uint256) { | ||
return blockMockUp.getBlockNum(); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -28,4 +28,3 @@ def main(): | |
conf.loadConfig() | ||
|
||
#call the function you want here | ||
|
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
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
Oops, something went wrong.