Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Improvment. #3

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion hardhat/smart-contracts/AuctionDemo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contract auctionDemo is Ownable {
_;
}

constructor (address _minter, address _gencore, address _adminsContract) public {
constructor (address _minter, address _gencore, address _adminsContract) {
minter = IMinterContract(_minter);
gencore = _gencore;
adminsContract = INextGenAdmins(_adminsContract);
Expand Down
2 changes: 1 addition & 1 deletion hardhat/smart-contracts/IMinterContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.19;
interface IMinterContract {

// retrieve if the contract is minter contract
function isMinterContract() external view returns (bool);
function isMinterContract() external pure returns (bool);

// retrieve the public end time of a sale
function getEndTime(uint256 _collectionID) external view returns (uint);
Expand Down
2 changes: 1 addition & 1 deletion hardhat/smart-contracts/MinterContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ contract NextGenMinterContract is Ownable {

// get minter contract status

function isMinterContract() external view returns (bool) {
function isMinterContract() external pure returns (bool) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion hardhat/smart-contracts/NextGenAdmins.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ contract NextGenAdmins is Ownable{

// get admin contract status

function isAdminContract() external view returns (bool) {
function isAdminContract() external pure returns (bool) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion hardhat/smart-contracts/RandomizerNXT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract NextGenRandomizerNXT {
}

// get randomizer contract status
function isRandomizerContract() external view returns (bool) {
function isRandomizerContract() external pure returns (bool) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion hardhat/smart-contracts/RandomizerRNG.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ contract NextGenRandomizerRNG is ArrngConsumer, Ownable {
receive() external payable {}

// get randomizer contract status
function isRandomizerContract() external view returns (bool) {
function isRandomizerContract() external pure returns (bool) {
return true;
}
}
2 changes: 1 addition & 1 deletion hardhat/smart-contracts/RandomizerVRF.sol
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ contract NextGenRandomizerVRF is VRFConsumerBaseV2, Ownable {
}

// get randomizer contract status
function isRandomizerContract() external view returns (bool) {
function isRandomizerContract() external pure returns (bool) {
return true;
}

Expand Down
17 changes: 6 additions & 11 deletions hardhat/smart-contracts/XRandoms.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ pragma solidity ^0.8.19;

contract randomPool {

function getWord(uint256 id) private pure returns (string memory) {

// array storing the words list
string[100] memory wordsList = ["Acai", "Ackee", "Apple", "Apricot", "Avocado", "Babaco", "Banana", "Bilberry", "Blackberry", "Blackcurrant", "Blood Orange",
// wordsList is a pre-defined array containing 100 unique words.
string[100] private wordsList = ["Acai", "Ackee", "Apple", "Apricot", "Avocado", "Babaco", "Banana", "Bilberry", "Blackberry", "Blackcurrant", "Blood Orange",
"Blueberry", "Boysenberry", "Breadfruit", "Brush Cherry", "Canary Melon", "Cantaloupe", "Carambola", "Casaba Melon", "Cherimoya", "Cherry", "Clementine",
"Cloudberry", "Coconut", "Cranberry", "Crenshaw Melon", "Cucumber", "Currant", "Curry Berry", "Custard Apple", "Damson Plum", "Date", "Dragonfruit", "Durian",
"Eggplant", "Elderberry", "Feijoa", "Finger Lime", "Fig", "Gooseberry", "Grapes", "Grapefruit", "Guava", "Honeydew Melon", "Huckleberry", "Italian Prune Plum",
Expand All @@ -24,13 +22,10 @@ contract randomPool {
"Plantain", "Plum", "Pomegranate", "Pomelo", "Prickly Pear", "Pulasan", "Quine", "Rambutan", "Raspberries", "Rhubarb", "Rose Apple", "Sapodilla", "Satsuma",
"Soursop", "Star Apple", "Star Fruit", "Strawberry", "Sugar Apple", "Tamarillo", "Tamarind", "Tangelo", "Tangerine", "Ugli", "Velvet Apple", "Watermelon"];

// returns a word based on index
if (id==0) {
return wordsList[id];
} else {
return wordsList[id - 1];
}
}
function getWord(uint256 id) public view returns (string memory) {
require(id > 0 && id <= wordsList.length, "Invalid word ID");
return wordsList[id - 1];
}

function randomNumber() public view returns (uint256){
uint256 randomNum = uint(keccak256(abi.encodePacked(block.prevrandao, blockhash(block.number - 1), block.timestamp))) % 1000;
Expand Down