Update contracts to support Solidity 0.8.x (#2442)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
Andre Korol
2021-01-14 22:38:53 +00:00
committed by GitHub
parent 6be0b410dc
commit 974c534210
159 changed files with 338 additions and 509 deletions

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma solidity ^0.8.0;
import "./Proxy.sol";
import "../utils/Address.sol";
@ -30,7 +30,7 @@ contract BeaconProxy is Proxy {
*
* - `beacon` must be a contract with the interface {IBeacon}.
*/
constructor(address beacon, bytes memory data) public payable {
constructor(address beacon, bytes memory data) payable {
assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1));
_setBeacon(beacon, data);
}

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;
pragma solidity ^0.8.0;
/**

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma solidity ^0.8.0;
/**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma solidity ^0.8.0;
import "../access/Ownable.sol";
import "./TransparentUpgradeableProxy.sol";

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma solidity ^0.8.0;
import "./UpgradeableProxy.sol";
@ -30,7 +30,7 @@ contract TransparentUpgradeableProxy is UpgradeableProxy {
* @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
* optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.
*/
constructor(address _logic, address admin_, bytes memory _data) public payable UpgradeableProxy(_logic, _data) {
constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) {
assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
_setAdmin(admin_);
}

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma solidity ^0.8.0;
import "./IBeacon.sol";
import "../access/Ownable.sol";
@ -24,7 +24,7 @@ contract UpgradeableBeacon is IBeacon, Ownable {
* @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the
* beacon.
*/
constructor(address implementation_) public {
constructor(address implementation_) {
_setImplementation(implementation_);
}

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma solidity ^0.8.0;
import "./Proxy.sol";
import "../utils/Address.sol";
@ -21,7 +21,7 @@ contract UpgradeableProxy is Proxy {
* If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
* function call, and allows initializating the storage of the proxy like a Solidity constructor.
*/
constructor(address _logic, bytes memory _data) public payable {
constructor(address _logic, bytes memory _data) payable {
assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
_setImplementation(_logic);
if(_data.length > 0) {