-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1dedb7c
Showing
9 changed files
with
27,026 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
|
||
#Hardhat files | ||
cache | ||
artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# steps to compile and deploy | ||
|
||
1. npx hardhat compile | ||
2. npx hardhat run scripts/deploy.js --network rinkeby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//SPDX-License-Identifier: Unlicense | ||
pragma solidity ^0.8.0; | ||
|
||
contract Whitelist { | ||
uint8 public maxWhitelistedAddresses; | ||
|
||
uint8 public numAddressesWhitelisted; | ||
|
||
mapping(address => bool) public whitelistedAddresses; | ||
|
||
constructor(uint8 _maxWhitelistedAddresses) { | ||
maxWhitelistedAddresses = _maxWhitelistedAddresses; | ||
} | ||
|
||
function addToWhitelist() public { | ||
require( | ||
!whitelistedAddresses[msg.sender], | ||
"Sender has already been whitelisted" | ||
); | ||
require( | ||
numAddressesWhitelisted < maxWhitelistedAddresses, | ||
"More addresses cant be added, limit reached" | ||
); | ||
whitelistedAddresses[msg.sender] = true; | ||
numAddressesWhitelisted += 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require("@nomiclabs/hardhat-waffle"); | ||
|
||
require("dotenv").config({ path: ".env" }); | ||
|
||
const ALCHEMY_API_KEY_URL = process.env.ALCHEMY_API_KEY_URL; | ||
|
||
const RINKEBY_PRIVATE_KEY = process.env.RINKEBY_PRIVATE_KEY; | ||
|
||
module.exports = { | ||
solidity: "0.8.4", | ||
networks: { | ||
rinkeby: { | ||
url: ALCHEMY_API_KEY_URL, | ||
accounts: [RINKEBY_PRIVATE_KEY], | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.