Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Solidity Version and Refactor Contracts to Remove SafeMath Redundancy #763

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/src/attacks/AlienCodexAttack.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.0;
pragma solidity ^0.8.0;

import "../levels/AlienCodex.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/attacks/HigherOrderAttack.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma solidity ^0.8.0;

contract HigherOrderAttack {
function encodedData() public pure returns (bytes memory) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/helpers/Ownable-05.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.8.0;

/**
* @dev Contract module which provides a basic access control mechanism, where
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/AlienCodex.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.0;
pragma solidity ^0.8.0;

import "../helpers/Ownable-05.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/AlienCodexFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.5.0;
pragma solidity ^0.8.0;

import "./base/Level-05.sol";
import "./AlienCodex.sol";
Expand Down
5 changes: 2 additions & 3 deletions contracts/src/levels/Fallout.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.0;

import "openzeppelin-contracts-06/math/SafeMath.sol";

contract Fallout {
using SafeMath for uint256;
Expand All @@ -21,7 +20,7 @@ contract Fallout {
}

function allocate() public payable {
allocations[msg.sender] = allocations[msg.sender].add(msg.value);
allocations[msg.sender] = allocations[msg.sender] + (msg.value);
}

function sendAllocation(address payable allocator) public {
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/FalloutFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.8.0;

import "./base/Level-06.sol";
import "./Fallout.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/HigherOrder.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma solidity ^0.8.0;

contract HigherOrder {
address public commander;
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/HigherOrderFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma solidity ^0.8.0;

import "./base/Level-06.sol";
import "./HigherOrder.sol";
Expand Down
5 changes: 2 additions & 3 deletions contracts/src/levels/Reentrance.sol
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma solidity ^0.8.0;

import "openzeppelin-contracts-06/math/SafeMath.sol";

contract Reentrance {
using SafeMath for uint256;

mapping(address => uint256) public balances;

function donate(address _to) public payable {
balances[_to] = balances[_to].add(msg.value);
balances[_to] = balances[_to] + (msg.value);
}

function balanceOf(address _who) public view returns (uint256 balance) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/ReentranceFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.8.0;

import "./base/Level-06.sol";
import "./Reentrance.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/Token.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.0;

contract Token {
mapping(address => uint256) balances;
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/TokenFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.8.0;

import "./base/Level-06.sol";
import "./Token.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/base/Level-05.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.0;
pragma solidity ^0.8.0;

import "../../helpers/Ownable-05.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/base/Level-06.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.0;

import "openzeppelin-contracts-06/access/Ownable.sol";

Expand Down