Skip to content

Commit

Permalink
contracts: support solc 0.5 for some lib utils
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed Sep 2, 2019
1 parent c85d34e commit 526f925
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion contracts/common/Initializable.sol
Expand Up @@ -2,7 +2,7 @@
* SPDX-License-Identitifer: MIT
*/

pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;

import "./TimeHelpers.sol";
import "./UnstructuredStorage.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/common/IsContract.sol
Expand Up @@ -2,7 +2,7 @@
* SPDX-License-Identitifer: MIT
*/

pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;


contract IsContract {
Expand Down
12 changes: 6 additions & 6 deletions contracts/common/SafeERC20.sol
@@ -1,7 +1,7 @@
// Inspired by AdEx (https://github.com/AdExNetwork/adex-protocol-eth/blob/b9df617829661a7518ee10f4cb6c4108659dd6d5/contracts/libs/SafeERC20.sol)
// and 0x (https://github.com/0xProject/0x-monorepo/blob/737d1dc54d72872e24abce5a1dbe1b66d35fa21a/contracts/protocol/contracts/protocol/AssetProxy/ERC20Proxy.sol#L143)

pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;

import "../lib/token/ERC20.sol";

Expand Down Expand Up @@ -91,7 +91,7 @@ library SafeERC20 {
_to,
_amount
);
return invokeAndCheckSuccess(_token, transferCallData);
return invokeAndCheckSuccess(address(_token), transferCallData);
}

/**
Expand All @@ -105,7 +105,7 @@ library SafeERC20 {
_to,
_amount
);
return invokeAndCheckSuccess(_token, transferFromCallData);
return invokeAndCheckSuccess(address(_token), transferFromCallData);
}

/**
Expand All @@ -118,7 +118,7 @@ library SafeERC20 {
_spender,
_amount
);
return invokeAndCheckSuccess(_token, approveCallData);
return invokeAndCheckSuccess(address(_token), approveCallData);
}

/**
Expand All @@ -131,7 +131,7 @@ library SafeERC20 {
_owner
);

(bool success, uint256 tokenBalance) = staticInvoke(_token, balanceOfCallData);
(bool success, uint256 tokenBalance) = staticInvoke(address(_token), balanceOfCallData);
require(success, ERROR_TOKEN_BALANCE_REVERTED);

return tokenBalance;
Expand All @@ -148,7 +148,7 @@ library SafeERC20 {
_spender
);

(bool success, uint256 allowance) = staticInvoke(_token, allowanceCallData);
(bool success, uint256 allowance) = staticInvoke(address(_token), allowanceCallData);
require(success, ERROR_TOKEN_ALLOWANCE_REVERTED);

return allowance;
Expand Down
2 changes: 1 addition & 1 deletion contracts/common/TimeHelpers.sol
Expand Up @@ -2,7 +2,7 @@
* SPDX-License-Identitifer: MIT
*/

pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;

import "./Uint256Helpers.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/common/Uint256Helpers.sol
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;


library Uint256Helpers {
Expand Down
2 changes: 1 addition & 1 deletion contracts/common/UnstructuredStorage.sol
Expand Up @@ -2,7 +2,7 @@
* SPDX-License-Identitifer: MIT
*/

pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;


library UnstructuredStorage {
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/math/SafeMath.sol
@@ -1,7 +1,7 @@
// See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/d51e38758e1d985661534534d5c61e27bece5042/contracts/math/SafeMath.sol
// Adapted to use pragma ^0.4.24 and satisfy our linter rules

pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/math/SafeMath64.sol
Expand Up @@ -2,7 +2,7 @@
// Adapted for uint64, pragma ^0.4.24, and satisfying our linter rules
// Also optimized the mul() implementation, see https://github.com/aragon/aragonOS/pull/417

pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;


/**
Expand Down
11 changes: 6 additions & 5 deletions contracts/lib/misc/Migrations.sol
@@ -1,20 +1,21 @@
pragma solidity ^0.4.2;
pragma solidity >=0.4.2 <0.6.0;


contract Migrations {
address public owner;
uint public lastCompletedMigration;
uint256 public lastCompletedMigration;

modifier restricted() {
if (msg.sender == owner)
if (msg.sender == owner) {
_;
}
}

function Migrations() public {
constructor() public {
owner = msg.sender;
}

function setCompleted(uint completed) restricted public {
function setCompleted(uint256 completed) restricted public {
lastCompletedMigration = completed;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/token/ERC20.sol
@@ -1,6 +1,6 @@
// See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/a9f910d34f0ab33a1ae5e714f69f9596a02b4d91/contracts/token/ERC20/ERC20.sol

pragma solidity ^0.4.24;
pragma solidity >=0.4.24 <0.6.0;


/**
Expand Down

0 comments on commit 526f925

Please sign in to comment.