Skip to content

Commit

Permalink
completely removes any mention of user registry from contracts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ckartik committed Dec 22, 2023
1 parent 251dd4b commit 806ff59
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 579 deletions.
14 changes: 0 additions & 14 deletions contracts/PreConfirmations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ 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 {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

/**
Expand Down Expand Up @@ -45,8 +44,6 @@ contract PreConfCommitmentStore is Ownable {
/// @dev Address of provider registry
IProviderRegistry public providerRegistry;

/// @dev Address of userRegistry
IUserRegistry public userRegistry;

IERC20 public nativeToken;

Expand Down Expand Up @@ -110,20 +107,17 @@ contract PreConfCommitmentStore is Ownable {
/**
* @dev Initializes the contract with the specified registry addresses, oracle, name, and version.
* @param _providerRegistry The address of the provider registry.
* @param _userRegistry The address of the user registry.
* @param _oracle The address of the oracle.
* @param _owner Owner of the contract, explicitly needed since contract is deployed w/ create2 factory.
*/
constructor(
address _providerRegistry,
address _userRegistry,
address _oracle,
address _owner,
address _nativeToken
) {
oracle = _oracle;
providerRegistry = IProviderRegistry(_providerRegistry);
userRegistry = IUserRegistry(_userRegistry);
nativeToken = IERC20(_nativeToken);
_transferOwnership(_owner);

Expand Down Expand Up @@ -448,14 +442,6 @@ contract PreConfCommitmentStore is Ownable {
providerRegistry = IProviderRegistry(newProviderRegistry);
}

/**
* @dev Updates the address of the user registry.
* @param newUserRegistry The new user registry address.
*/
function updateUserRegistry(address newUserRegistry) external onlyOwner {
userRegistry = IUserRegistry(newUserRegistry);
}

/**
* @dev Internal Function to convert bytes32 to hex string without 0x
* @param _bytes32 the byte array to convert to string
Expand Down
227 changes: 0 additions & 227 deletions contracts/UserRegistry.sol

This file was deleted.

1 change: 0 additions & 1 deletion contracts/interfaces/IPreConfirmations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ interface IPreConfCommitmentStore {

function updateProviderRegistry(address newProviderRegistry) external;

function updateUserRegistry(address newUserRegistry) external;

// Public functions that can be included if they are meant to be called from other contracts

Expand Down
24 changes: 0 additions & 24 deletions contracts/interfaces/IUserRegistry.sol

This file was deleted.

8 changes: 1 addition & 7 deletions scripts/DeployScripts.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
import "forge-std/Script.sol";
import "contracts/UserRegistry.sol";
import "contracts/ProviderRegistry.sol";
import "contracts/PreConfirmations.sol";
import "contracts/Oracle.sol";
Expand Down Expand Up @@ -48,21 +47,16 @@ contract DeployScript is Script, Create2Deployer {
// Forge deploy with salt uses create2 proxy from https://github.com/primevprotocol/deterministic-deployment-proxy
bytes32 salt = 0x8989000000000000000000000000000000000000000000000000000000000000;

UserRegistry userRegistry = new UserRegistry{salt: salt}(minStake, feeRecipient, feePercent, msg.sender);
console.log("UserRegistry deployed to:", address(userRegistry));

ProviderRegistry providerRegistry = new ProviderRegistry{salt: salt}(minStake, feeRecipient, feePercent, msg.sender);
console.log("ProviderRegistry deployed to:", address(providerRegistry));

PreConfCommitmentStore preConfCommitmentStore = new PreConfCommitmentStore{salt: salt}(address(providerRegistry), address(userRegistry), feeRecipient, msg.sender);
PreConfCommitmentStore preConfCommitmentStore = new PreConfCommitmentStore{salt: salt}(address(providerRegistry), feeRecipient, msg.sender);
console.log("PreConfCommitmentStore deployed to:", address(preConfCommitmentStore));

providerRegistry.setPreconfirmationsContract(address(preConfCommitmentStore));
console.log("ProviderRegistry updated with PreConfCommitmentStore address:", address(preConfCommitmentStore));

userRegistry.setPreconfirmationsContract(address(preConfCommitmentStore));
console.log("UserRegistry updated with PreConfCommitmentStore address:", address(preConfCommitmentStore));

Oracle oracle = new Oracle{salt: salt}(address(preConfCommitmentStore), nextRequestedBlockNumber, msg.sender);
console.log("Oracle deployed to:", address(oracle));

Expand Down
Loading

0 comments on commit 806ff59

Please sign in to comment.