fix incentive
This commit is contained in:
@@ -48,13 +48,13 @@ contract DODOIncentive is InitializableOwnable {
|
|||||||
function switchIncentive(uint256 _startBlock) public onlyOwner {
|
function switchIncentive(uint256 _startBlock) public onlyOwner {
|
||||||
if(startBlock != 0) {
|
if(startBlock != 0) {
|
||||||
require(block.number >= startBlock);
|
require(block.number >= startBlock);
|
||||||
|
_update();
|
||||||
startBlock = 0;
|
startBlock = 0;
|
||||||
}else {
|
}else {
|
||||||
require(block.number <= _startBlock);
|
require(block.number <= _startBlock && _startBlock < uint32(-1));
|
||||||
startBlock = _startBlock;
|
startBlock = _startBlock;
|
||||||
lastRewardBlock = startBlock;
|
lastRewardBlock = uint32(_startBlock);
|
||||||
}
|
}
|
||||||
_update();
|
|
||||||
emit SetSwitch(startBlock == 0 ? false: true);
|
emit SetSwitch(startBlock == 0 ? false: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,19 +104,11 @@ describe("DODOProxyV2.0", () => {
|
|||||||
|
|
||||||
describe("DODOIncentive", () => {
|
describe("DODOIncentive", () => {
|
||||||
|
|
||||||
it("incentive-switch", async () => {
|
it("incentive-switch with trade", async () => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("incentive-changeBoost", async () => {
|
it("incentive-changeBoost with trade", async () => {
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
it("incentive-changeDefaultRate", async () => {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
it("incentive-emptyReward", async () => {
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user