Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
update migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
jingleizhang committed Jan 31, 2021
1 parent 1ca90e7 commit 009304e
Show file tree
Hide file tree
Showing 15 changed files with 1,036 additions and 241 deletions.
24 changes: 11 additions & 13 deletions contracts/FarmMaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ contract FarmMaster is ReentrancyGuard {
// Type1: UNI-LP;
// Type2: BPT;
// Type3: XLP;
// Type4: yCrv;
uint256 lpTokenType;
uint256 lpFactor;
uint256 lpAccPerShare; // Accumulated XDEX per share, times 1e12. See below.
Expand Down Expand Up @@ -149,39 +148,38 @@ contract FarmMaster is ReentrancyGuard {
* @dev Throws if the msg.sender unauthorized.
*/
modifier onlyCore() {
require(msg.sender == core, "Not authorized, only core");
require(msg.sender == core, "Not authorized");
_;
}

/**
* @dev Throws if the pid does not point to a valid pool.
*/
modifier poolExists(uint256 _pid) {
require(_pid < poolInfo.length, "pool does not exist");
require(_pid < poolInfo.length, "pool not exist");
_;
}

constructor(
XDEX _xdex,
address _stream,
uint256 _startBlock,
address _core
) public {
constructor(XDEX _xdex, uint256 _startBlock) public {
xdex = _xdex;
stream = XdexStream(_stream);
startBlock = _startBlock;
core = _core;
core = msg.sender;
}

function poolLength() external view returns (uint256) {
return poolInfo.length;
}

// Set the voting pool id. Can only be called by the core.
// Set the voting pool id. Can only be called by core.
function setVotingPool(uint256 _pid) public onlyCore {
votingPoolId = _pid;
}

// Set the xdex stream. Can only be called by core.
function setStream(address _stream) public onlyCore {
stream = XdexStream(_stream);
}

// Add a new lp to the pool. Can only be called by the core.
// DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function addPool(
Expand Down Expand Up @@ -234,7 +232,7 @@ contract FarmMaster is ReentrancyGuard {
//check lpToken count
uint256 count = pool.LpTokenInfos.length;
require(
count >= LpTokenMinCount && count <= LpTokenMaxCount,
count >= LpTokenMinCount && count < LpTokenMaxCount,
"pool lpToken length is bad"
);

Expand Down
Loading

0 comments on commit 009304e

Please sign in to comment.