diff --git a/contracts/SmartRoute/DODOIncentive.sol b/contracts/SmartRoute/DODOIncentive.sol index d3c865b..fc4328d 100644 --- a/contracts/SmartRoute/DODOIncentive.sol +++ b/contracts/SmartRoute/DODOIncentive.sol @@ -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); } diff --git a/test/Proxy/proxy.incentive.test.ts b/test/Proxy/proxy.incentive.test.ts index 312c092..76d840c 100644 --- a/test/Proxy/proxy.incentive.test.ts +++ b/test/Proxy/proxy.incentive.test.ts @@ -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 () => { });