Skip to content

Commit

Permalink
minor fixes in doc and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
smndev committed Sep 3, 2021
1 parent c321cd3 commit f3c7140
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
1 change: 0 additions & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ and then edit the keys defines is this file as described in the following table.

| Key | Description |
| ----------------------- | ----------- |
| ``DEBUG`` | If set to ``true`` the code will not be optimized |
| ``ALCHEMY_API_KEY`` | Tke [Alchemy](https://docs.alchemy.com/alchemy/introduction/getting-started) API key |
| ``RINKEBY_PRIVATE_KEY`` | The Rinkeby private key used for deployng the contract |
| ``MAINNET_PRIVATE_KEY`` | The main net private key used for deployng the contract |
Expand Down
12 changes: 12 additions & 0 deletions contracts/NFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,16 @@ contract NFT is ERC721, Ownable {
}
}

/**
* @dev Withdraw ETH from this contract (Callable by owner)
*/
function withdraw() onlyOwner() public returns (bool) {
uint balance = address(this).balance;
(bool success, ) = _msgSender().call{value:balance}("");
// no need to call throw here or handle double entry attack
// since only the owner is withdrawing all the balance
return success;
}


}
16 changes: 14 additions & 2 deletions contracts/UC1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ contract UC1 is ERC721, Ownable {
// Mapping if certain name string has already been reserved
mapping (string => bool) private _nameReserved;

// the NCT contract pointer
// the NCT contract pointder
INCT private _nct;


// Events
event NameChange (uint256 indexed maskIndex, string newName);
event NameChange (uint256 indexed tokenIdx, string newName);


/**
Expand Down Expand Up @@ -169,4 +169,16 @@ contract UC1 is ERC721, Ownable {
}
return string(bLower);
}

/**
* @dev Withdraw ETH from this contract (Callable by owner)
*/
function withdraw() onlyOwner() public returns (bool) {
uint balance = address(this).balance;
(bool success, ) = _msgSender().call{value:balance}("");
// no need to call throw here or handle double entry attack
// since only the owner is withdrawing all the balance
return success;
}

}
2 changes: 1 addition & 1 deletion contracts/UC2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract UC2 is Ownable {
INCT private _nct;

// Events
event NameChange (uint256 indexed maskIndex, string newName);
event NameChange (uint256 indexed tokenIdx, string newName);


/**
Expand Down
1 change: 0 additions & 1 deletion env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
DEBUG=false
ALCHEMY_API_KEY=KEY
RINKEBY_PRIVATE_KEY=YOUR_RINKEBY_PRIVATE_KEY
MAINNET_PRIVATE_KEY=YOUR_MAIN_NET_PRIVATE_KEY
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
solidity: {
compilers: [{
version: '0.8.0', settings: {
optimizer: {enabled: !env.DEBUG},
optimizer: {enabled: true},
},
},]
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "nctproject",
"version": "1.2.0",
"version": "1.2.1",
"description": "How to integrate Name Changing Token (NCT) to a new or existing NFT project",
"main": "index.js",
"scripts": {
"test": "npx hardhat test",
"compile": "npx hardhat compile",
"deploy-rinkeby": "npx hardhat run scripts/deploy-testing.js --network rinkeby",
"deploy-mainnet": "DEBUG=false npx hardhat run scripts/deploy-mainnet.js --network mainnet"
"deploy-mainnet": "npx hardhat run scripts/deploy-mainnet.js --network mainnet"
},
"keywords": [
"NCT",
Expand Down

0 comments on commit f3c7140

Please sign in to comment.