Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
downgrade contracts to be compatible with solidity 0.8.15
  • Loading branch information
shaspitz committed Nov 8, 2023
commit e20841ee2143d60724e2094d7c847eecc76e97ef
10 changes: 5 additions & 5 deletions contracts/PreConfirmations.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity ^0.8.15;

import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

import {IProviderRegistry} from "./interfaces/IProviderRegistry.sol";
import {IUserRegistry} from "./interfaces/IUserRegistry.sol";
import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

/**
* @title PreConfCommitmentStore - A contract for managing preconfirmation commitments and bids.
Expand Down Expand Up @@ -110,7 +110,7 @@ contract PreConfCommitmentStore is Ownable {
address _providerRegistry,
address _userRegistry,
address _oracle
) Ownable(msg.sender) {
) {
oracle = _oracle;
providerRegistry = IProviderRegistry(_providerRegistry);
userRegistry = IUserRegistry(_userRegistry);
Expand Down Expand Up @@ -146,7 +146,7 @@ contract PreConfCommitmentStore is Ownable {
uint64 _blockNumber
) public view returns (bytes32) {
return
MessageHashUtils.toTypedDataHash(
ECDSA.toTypedDataHash(
DOMAIN_SEPARATOR_BID,
keccak256(
abi.encode(
Expand Down Expand Up @@ -175,7 +175,7 @@ contract PreConfCommitmentStore is Ownable {
string memory _bidSignature
) public view returns (bytes32) {
return
MessageHashUtils.toTypedDataHash(
ECDSA.toTypedDataHash(
DOMAIN_SEPARATOR_PRECONF,
keccak256(
abi.encode(
Expand Down
6 changes: 3 additions & 3 deletions contracts/ProviderRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity ^0.8.15;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {PreConfCommitmentStore} from "./PreConfirmations.sol";
import {IProviderRegistry} from "./interfaces/IProviderRegistry.sol";

Expand Down Expand Up @@ -75,7 +75,7 @@ contract ProviderRegistry is IProviderRegistry, Ownable, ReentrancyGuard {
uint256 _minStake,
address _feeRecipient,
uint16 _feePercent
) Ownable(msg.sender) {
) {
minStake = _minStake;
feeRecipient = _feeRecipient;
feePercent = _feePercent;
Expand Down
6 changes: 3 additions & 3 deletions contracts/UserRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity ^0.8.15;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IUserRegistry} from "./interfaces/IUserRegistry.sol";

/// @title User Registry
Expand Down Expand Up @@ -71,7 +71,7 @@ contract UserRegistry is IUserRegistry, Ownable, ReentrancyGuard {
uint256 _minStake,
address _feeRecipient,
uint16 _feePercent
) Ownable(msg.sender) {
) {
minStake = _minStake;
feeRecipient = _feeRecipient;
feePercent = _feePercent;
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IProviderRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity ^0.8.15;

interface IProviderRegistry {
function registerAndStake() external payable;
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IUserRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity ^0.8.15;

interface IUserRegistry {
struct PreConfCommitment {
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require("solidity-docgen");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.20",
solidity: "0.8.15",
networks: {
localhost: {
url: "http://127.0.0.1:8545", // Ganache default port
Expand Down