Skip to content

Commit

Permalink
move to Ownable for QuestNFT and Quest
Browse files Browse the repository at this point in the history
  • Loading branch information
waynehoover committed Jun 23, 2023
1 parent 276cab4 commit e0cfd3e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions contracts/Quest.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.16;

import {OwnableUpgradeable} from '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import {PausableUpgradeable} from '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol';
import {ReentrancyGuardUpgradeable} from '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol';
import {Ownable} from 'solady/src/auth/Ownable.sol';
import {SafeTransferLib} from 'solady/src/utils/SafeTransferLib.sol';
import {RabbitHoleReceipt} from './RabbitHoleReceipt.sol';
import {QuestFactory} from './QuestFactory.sol';
Expand All @@ -12,7 +12,7 @@ import {IQuest} from './interfaces/IQuest.sol';
/// @title Quest
/// @author RabbitHole.gg
/// @notice This contract is the Erc20Quest contract. It is a quest that is redeemable for ERC20 tokens
contract Quest is ReentrancyGuardUpgradeable, PausableUpgradeable, OwnableUpgradeable, IQuest {
contract Quest is ReentrancyGuardUpgradeable, PausableUpgradeable, Ownable, IQuest {
RabbitHoleReceipt public rabbitHoleReceiptContract;
QuestFactory public questFactoryContract;
address public rewardToken;
Expand Down Expand Up @@ -58,7 +58,7 @@ contract Quest is ReentrancyGuardUpgradeable, PausableUpgradeable, OwnableUpgrad
questFee = questFee_;
hasWithdrawn = false;
protocolFeeRecipient = protocolFeeRecipient_;
__Ownable_init();
_initializeOwner(msg.sender);
__Pausable_init();
__ReentrancyGuard_init();
}
Expand Down
6 changes: 3 additions & 3 deletions contracts/QuestNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Initializable} from '@openzeppelin/contracts-upgradeable/proxy/utils/Ini
import {ERC1155Upgradeable} from '@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol';
import {ERC1155SupplyUpgradeable} from '@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgradeable.sol';
import {PausableUpgradeable} from '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol';
import {OwnableUpgradeable} from '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import {Ownable} from 'solady/src/auth/Ownable.sol';
import {CountersUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import {IERC2981Upgradeable, IERC165Upgradeable} from '@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol';
import {Base64} from 'solady/src/utils/Base64.sol';
Expand All @@ -15,7 +15,7 @@ import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/se
/// @title QuestNFT
/// @author RabbitHole.gg
/// @notice This contract is the Erc721 Quest Completion contract. It is the NFT that can be minted after a quest is completed.
contract QuestNFT is Initializable, ERC1155Upgradeable, ERC1155SupplyUpgradeable, PausableUpgradeable, OwnableUpgradeable, IERC2981Upgradeable, ReentrancyGuardUpgradeable {
contract QuestNFT is Initializable, ERC1155Upgradeable, ERC1155SupplyUpgradeable, PausableUpgradeable, Ownable, IERC2981Upgradeable, ReentrancyGuardUpgradeable {
using CountersUpgradeable for CountersUpgradeable.Counter;

CountersUpgradeable.Counter private _tokenIdCounter;
Expand Down Expand Up @@ -49,7 +49,7 @@ contract QuestNFT is Initializable, ERC1155Upgradeable, ERC1155SupplyUpgradeable
collectionName = collectionName_;
__ERC1155_init("");
__ERC1155Supply_init();
__Ownable_init();
_initializeOwner(msg.sender);
__Pausable_init();
__ReentrancyGuard_init();
}
Expand Down
1 change: 1 addition & 0 deletions test/QuestNFT.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('QuestNFT Contract', async () => {

describe('Deployment', () => {
it('deploys and initializes the the 1155 correctly', async () => {
expect(await questNFT.owner()).to.equal(contractOwner.address)
expect(await questNFT.collectionName()).to.equal('CollectionName')
expect(await questNFT.minterAddress()).to.equal(minterAddress.address)
expect(await questNFT.protocolFeeRecipient()).to.equal(royaltyRecipient.address)
Expand Down

0 comments on commit e0cfd3e

Please sign in to comment.