Skip to content

Commit

Permalink
set tests sol version to satisfy 0.8.19 (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAWM authored Sep 26, 2023
1 parent 241dacf commit 169cda6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
15 changes: 7 additions & 8 deletions tests/evm/verilog-2/Bounty.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
pragma solidity ^0.8.15;

import {IERC20} from "./interfaces/IERC20.sol";
import {IWMATIC} from "./interfaces/IWMATIC.sol";
Expand All @@ -21,10 +21,10 @@ contract Bounty {
WMATICV2 = IWMATICV2(address(0xDA3AF9c51F6953988a46C21d43A5152AFC7f389d));
}

function getBounty() payable public returns (bool) {
// if (WMATICV2.totalSupply() != WMATICV2.balance()) {
// bug();
// }
function getBounty() public payable returns (bool) {
// if (WMATICV2.totalSupply() != WMATICV2.balance()) {
// bug();
// }
uint256 delta = WMATICV2.totalSupply() >= WMATICV2.balance()
? WMATICV2.totalSupply() - WMATICV2.balance()
: WMATICV2.balance() - WMATICV2.totalSupply();
Expand All @@ -35,11 +35,10 @@ contract Bounty {

// reward the first finder
isHacked = true;
// IERC20(WMATIC).transfer(msg.sender, IERC20(WMATIC).balanceOf(address((this))));
// IERC20(WMATIC).transfer(msg.sender, IERC20(WMATIC).balanceOf(address((this))));
winner = address(msg.sender);
}

return isHacked;
return isHacked;
}

}
4 changes: 1 addition & 3 deletions tests/evm/verilog-2/WMATICV2.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
pragma solidity ^0.8.15;

import {IERC20} from "./interfaces/IERC20.sol";
import {IWMATIC} from "./interfaces/IWMATIC.sol";
Expand Down Expand Up @@ -66,7 +66,6 @@ abstract contract ReentrancyGuard {
}
}


contract WMATICV2 is IWMATICV2, ReentrancyGuard {
/*
======== Verilog CTF - Web3Dubai Conference @ 2022 ===============================
Expand Down Expand Up @@ -218,5 +217,4 @@ contract WMATICV2 is IWMATICV2, ReentrancyGuard {
function _updateBalanceOfMatic(uint256 amount, bool add) internal {
_balanceOfMatic = add ? _balanceOfMatic += amount : _balanceOfMatic -= amount;
}

}
2 changes: 1 addition & 1 deletion tests/evm/verilog-2/interfaces/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
pragma solidity ^0.8.15;
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/evm/verilog-2/interfaces/IUniswapV2Pair.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
pragma solidity ^0.8.15;

interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint256 value);
Expand Down
2 changes: 1 addition & 1 deletion tests/evm/verilog-2/interfaces/IWMATIC.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.8.15;
pragma solidity ^0.8.15;

interface IWMATIC {
function withdraw(uint256 wad) external;
Expand Down
2 changes: 1 addition & 1 deletion tests/evm/verilog-2/interfaces/IWMATICV2.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.8.15;
pragma solidity ^0.8.15;

interface IWMATICV2 {
function totalSupply() external view returns (uint256);
Expand Down

0 comments on commit 169cda6

Please sign in to comment.