Skip to content

Commit

Permalink
Merge 290a4f3 into f4943bc
Browse files Browse the repository at this point in the history
  • Loading branch information
themandalore committed Aug 1, 2021
2 parents f4943bc + 290a4f3 commit 7b42362
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/TellorStake.sol
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ contract TellorStake is TellorTransfer {
uint256 _id;
require(disp.disputeUintVars[_PAID] == 0, "already paid out");
require(!disp.isPropFork, "function not callable fork fork proposals");
require(disp.disputeUintVars[_TALLY_DATE] > 0, "vote needs to be tallied");
require(last.disputeUintVars[_TALLY_DATE] > 0, "vote needs to be tallied");
require(
block.timestamp - last.disputeUintVars[_TALLY_DATE] > 1 days,
"Time for a follow up dispute hasn't elapsed"
Expand Down
8 changes: 4 additions & 4 deletions test/attack.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@
// // Make sure that impersonated address has some tokens
// expect(await tellor.balanceOf(await devWallet.getAddress())).not.equal(expandTo18Decimals(0));
// // Check iniitial zero balance
// expect(await tellor.balanceOf(attacker.address)).equal("0");
// expect(await tellor.balanceOf(attacker.address) *1 ).equal(0);
// // Transfer 501 tokens to the attacker
// await tellor.transfer(attacker.address, expandTo18Decimals(501), {from: devWallet.address});
// expect(await tellor.balanceOf(attacker.address)).equal(expandTo18Decimals(501));
// expect(await tellor.balanceOf(attacker.address) * 1 - expandTo18Decimals(501)).equal(0);
// // Become a staker (changes currentStatus to 1)
// const userTellor = tellor.connect(attacker);
// await userTellor.depositStake();
// // Tip any requestId with 2 tokens to make the balance lower than 500
// expect(userTellor.addTip(1,expandTo18Decimals(2))).to.be.reverted;
// expect(await tellor.balanceOf(attacker.address)).equal(expandTo18Decimals(501));
// expect(await tellor.balanceOf(attacker.address) * 1 - expandTo18Decimals(501)).equal(0);
// // Transfer more than 500 tokens to underflow the balance
// expect(await tellor.balanceOf(user2.address)).equal("0");
// expect(await tellor.balanceOf(user2.address)* 1).equal(0);
// expect(userTellor.transfer (user2.address, expandTo18Decimals(1000))).to.be.reverted;
// expect(await tellor.balanceOf(user2.address)).equal(expandTo18Decimals(0));
// });
Expand Down
6 changes: 6 additions & 0 deletions test/moreDisputes.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ contract("More Dispute Tests", function(accounts) {
await master.vote(disp2.id, false, { from: accounts[6] });
await master.vote(disp2.id, false, { from: accounts[4] });
await helper.advanceTime(86400 * 5);
await helper.expectThrow(
master.unlockDisputeFee(1, { from: accounts[6] })
);
await master.tallyVotes(disp2.id);
dispInfo = await master.getAllDisputeVars(2);
assert(dispInfo[2] == false, "Dispute Vote failed");
Expand Down Expand Up @@ -218,6 +221,9 @@ contract("More Dispute Tests", function(accounts) {
await master.vote(disp2.id, true, { from: accounts[6] });
await master.vote(disp2.id, true, { from: accounts[4] });
await helper.advanceTime(86400 * 5);
await helper.expectThrow(
master.unlockDisputeFee(1, { from: accounts[6] })
);
await master.tallyVotes(disp2.id);
dispInfo = await master.getAllDisputeVars(2);
assert(dispInfo[2] == true, "Dispute Vote passed");
Expand Down

0 comments on commit 7b42362

Please sign in to comment.