fix incentive

This commit is contained in:
owen05
2021-01-06 00:26:53 +08:00
parent a7aa20c5d5
commit f380356893
2 changed files with 5 additions and 13 deletions

View File

@@ -48,13 +48,13 @@ contract DODOIncentive is InitializableOwnable {
function switchIncentive(uint256 _startBlock) public onlyOwner {
if(startBlock != 0) {
require(block.number >= startBlock);
_update();
startBlock = 0;
}else {
require(block.number <= _startBlock);
require(block.number <= _startBlock && _startBlock < uint32(-1));
startBlock = _startBlock;
lastRewardBlock = startBlock;
lastRewardBlock = uint32(_startBlock);
}
_update();
emit SetSwitch(startBlock == 0 ? false: true);
}

View File

@@ -104,19 +104,11 @@ describe("DODOProxyV2.0", () => {
describe("DODOIncentive", () => {
it("incentive-switch", async () => {
it("incentive-switch with trade", async () => {
});
it("incentive-changeBoost", async () => {
});
it("incentive-changeDefaultRate", async () => {
});
it("incentive-emptyReward", async () => {
it("incentive-changeBoost with trade", async () => {
});