Skip to content

Commit 3f2baa0

Browse files
committed
chore: randomizer rng does not need to be upgradable
1 parent 2866a7a commit 3f2baa0

File tree

5 files changed

+6
-74
lines changed

5 files changed

+6
-74
lines changed

contracts/deploy/00-home-chain-arbitration-neo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
3636
log: true,
3737
});
3838

39-
const rng = await deployUpgradable(deployments, "RandomizerRNG", {
39+
const rng = await deploy("RandomizerRNG", {
4040
from: deployer,
4141
args: [deployer, ZeroAddress, randomizerOracle.target], // The SortitionModule is configured later
4242
log: true,

contracts/deploy/00-home-chain-arbitration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
3636
log: true,
3737
});
3838

39-
const randomizerRng = await getContractOrDeployUpgradable(hre, "RandomizerRNG", {
39+
const randomizerRng = await getContractOrDeploy(hre, "RandomizerRNG", {
4040
from: deployer,
4141
args: [deployer, ZeroAddress, randomizerOracle.target], // The SortitionModule is configured later
4242
log: true,

contracts/deploy/00-rng.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
2424
log: true,
2525
});
2626

27-
const rng1 = await deployUpgradable(deployments, "RandomizerRNG", {
27+
const rng1 = await deploy("RandomizerRNG", {
2828
from: deployer,
2929
args: [deployer, sortitionModule.target, randomizerOracle.address],
3030
log: true,

contracts/src/rng/RandomizerRNG.sol

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ pragma solidity 0.8.24;
44

55
import "./RNG.sol";
66
import "./IRandomizer.sol";
7-
import "../proxy/UUPSProxiable.sol";
8-
import "../proxy/Initializable.sol";
97

108
/// @title Random Number Generator that uses Randomizer.ai
119
/// https://randomizer.ai/
12-
contract RandomizerRNG is RNG, UUPSProxiable, Initializable {
10+
contract RandomizerRNG is RNG {
1311
// ************************************* //
1412
// * Storage * //
1513
// ************************************* //
@@ -52,19 +50,10 @@ contract RandomizerRNG is RNG, UUPSProxiable, Initializable {
5250
// * Constructor * //
5351
// ************************************* //
5452

55-
/// @dev Constructor, initializing the implementation to reduce attack surface.
56-
constructor() {
57-
_disableInitializers();
58-
}
59-
60-
/// @dev Initializer
53+
/// @dev Constructor
6154
/// @param _randomizer Randomizer contract.
6255
/// @param _governor Governor of the contract.
63-
function initialize(
64-
address _governor,
65-
address _sortitionModule,
66-
IRandomizer _randomizer
67-
) external reinitializer(1) {
56+
constructor(address _governor, address _sortitionModule, IRandomizer _randomizer) {
6857
governor = _governor;
6958
sortitionModule = _sortitionModule;
7059
randomizer = _randomizer;
@@ -75,14 +64,6 @@ contract RandomizerRNG is RNG, UUPSProxiable, Initializable {
7564
// * Governance * //
7665
// ************************ //
7766

78-
/**
79-
* @dev Access Control to perform implementation upgrades (UUPS Proxiable)
80-
* @dev Only the governor can perform upgrades (`onlyByGovernor`)
81-
*/
82-
function _authorizeUpgrade(address) internal view override onlyByGovernor {
83-
// NOP
84-
}
85-
8667
/// @dev Changes the governor of the contract.
8768
/// @param _governor The new governor.
8869
function changeGovernor(address _governor) external onlyByGovernor {

contracts/src/rng/mock/ChainlinkVRFCoordinatorMock.sol

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -108,55 +108,6 @@ contract ChainlinkVRFCoordinatorV2Mock is IVRFCoordinatorV2Plus {
108108
revert("not implemented");
109109
}
110110

111-
function getRequestConfig() external pure returns (uint16, uint32, bytes32[] memory) {
112-
return (3, 2000000, new bytes32[](0));
113-
}
114-
115-
function getConfig()
116-
external
117-
pure
118-
returns (
119-
uint16 minimumRequestConfirmations,
120-
uint32 maxGasLimit,
121-
uint32 stalenessSeconds,
122-
uint32 gasAfterPaymentCalculation
123-
)
124-
{
125-
return (4, 2_500_000, 2_700, 33285);
126-
}
127-
128-
function getFeeConfig()
129-
external
130-
pure
131-
returns (
132-
uint32 fulfillmentFlatFeeLinkPPMTier1,
133-
uint32 fulfillmentFlatFeeLinkPPMTier2,
134-
uint32 fulfillmentFlatFeeLinkPPMTier3,
135-
uint32 fulfillmentFlatFeeLinkPPMTier4,
136-
uint32 fulfillmentFlatFeeLinkPPMTier5,
137-
uint24 reqsForTier2,
138-
uint24 reqsForTier3,
139-
uint24 reqsForTier4,
140-
uint24 reqsForTier5
141-
)
142-
{
143-
return (
144-
100000, // 0.1 LINK
145-
100000, // 0.1 LINK
146-
100000, // 0.1 LINK
147-
100000, // 0.1 LINK
148-
100000, // 0.1 LINK
149-
0,
150-
0,
151-
0,
152-
0
153-
);
154-
}
155-
156-
function getFallbackWeiPerUnitLink() external pure returns (int256) {
157-
return 4000000000000000; // 0.004 Ether
158-
}
159-
160111
function requestSubscriptionOwnerTransfer(uint256, address) external pure {
161112
revert("not implemented");
162113
}

0 commit comments

Comments
 (0)