Skip to content

Commit

Permalink
update draft KYCNFT
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPilou committed Oct 17, 2023
1 parent dea181d commit ced27ee
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 24 deletions.
175 changes: 156 additions & 19 deletions forge-cache/solidity-files-cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,93 @@
]
},
"files": {
"lib/ERC721A/contracts/ERC721A.sol": {
"lastModificationDate": 1697532870140,
"contentHash": "03ff4cb0e1cc044ffca143892ef8f2b6",
"sourceName": "lib/ERC721A/contracts/ERC721A.sol",
"solcConfig": {
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata"
]
}
},
"evmVersion": "paris",
"libraries": {}
}
},
"imports": [
"lib/ERC721A/contracts/IERC721A.sol"
],
"versionRequirement": "^0.8.4",
"artifacts": {
"ERC721A": {
"0.8.19+commit.7dd6d404.Darwin.appleclang": "ERC721A.sol/ERC721A.json"
},
"ERC721A__IERC721Receiver": {
"0.8.19+commit.7dd6d404.Darwin.appleclang": "ERC721A.sol/ERC721A__IERC721Receiver.json"
}
}
},
"lib/ERC721A/contracts/IERC721A.sol": {
"lastModificationDate": 1697530473263,
"contentHash": "c31a05698ddc2f109ba8723105d854c6",
"sourceName": "lib/ERC721A/contracts/IERC721A.sol",
"solcConfig": {
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata"
]
}
},
"evmVersion": "paris",
"libraries": {}
}
},
"imports": [],
"versionRequirement": "^0.8.4",
"artifacts": {
"IERC721A": {
"0.8.19+commit.7dd6d404.Darwin.appleclang": "IERC721A.sol/IERC721A.json"
}
}
},
"lib/ERC721A-Upgradeable/contracts/ERC721AStorage.sol": {
"lastModificationDate": 1680596959844,
"contentHash": "2bebb9fb7b7e001916c833eb49ff74d3",
Expand Down Expand Up @@ -4494,7 +4581,7 @@
}
},
"script/base/deploy-implementations.s.sol": {
"lastModificationDate": 1695887535699,
"lastModificationDate": 1697526491387,
"contentHash": "7b91a7e4dd208eed116e3d6df13ec06b",
"sourceName": "script/base/deploy-implementations.s.sol",
"solcConfig": {
Expand Down Expand Up @@ -4596,7 +4683,7 @@
}
},
"script/base/deploy-platform.s.sol": {
"lastModificationDate": 1695887542037,
"lastModificationDate": 1697526491387,
"contentHash": "b249659654ea2b392c4629c74cc3f49e",
"sourceName": "script/base/deploy-platform.s.sol",
"solcConfig": {
Expand Down Expand Up @@ -4712,7 +4799,7 @@
}
},
"script/base/deploy-royalty.s.sol": {
"lastModificationDate": 1693465366217,
"lastModificationDate": 1695374870138,
"contentHash": "8f8077a3a079d877814bee151a073325",
"sourceName": "script/base/deploy-royalty.s.sol",
"solcConfig": {
Expand Down Expand Up @@ -4989,7 +5076,7 @@
}
},
"script/base-goerli/deploy-implementations.s.sol": {
"lastModificationDate": 1695887525422,
"lastModificationDate": 1697526491386,
"contentHash": "05dbd9c58bd38f549b31bb572d64d339",
"sourceName": "script/base-goerli/deploy-implementations.s.sol",
"solcConfig": {
Expand Down Expand Up @@ -5091,7 +5178,7 @@
}
},
"script/base-goerli/deploy-platform.s.sol": {
"lastModificationDate": 1695887530527,
"lastModificationDate": 1697526491386,
"contentHash": "bbc66cfe0dd45bbb847a00b608e770df",
"sourceName": "script/base-goerli/deploy-platform.s.sol",
"solcConfig": {
Expand Down Expand Up @@ -5207,7 +5294,7 @@
}
},
"script/base-goerli/deploy-royalty.s.sol": {
"lastModificationDate": 1693465366216,
"lastModificationDate": 1695374870138,
"contentHash": "8f8077a3a079d877814bee151a073325",
"sourceName": "script/base-goerli/deploy-royalty.s.sol",
"solcConfig": {
Expand Down Expand Up @@ -5383,7 +5470,7 @@
}
},
"script/op/deploy-platform.s.sol": {
"lastModificationDate": 1695887548109,
"lastModificationDate": 1697526491388,
"contentHash": "bd1558a2a1b08abdadcab46e1dc68d55",
"sourceName": "script/op/deploy-platform.s.sol",
"solcConfig": {
Expand Down Expand Up @@ -5499,7 +5586,7 @@
}
},
"script/op/deploy-royalty.s.sol": {
"lastModificationDate": 1693465366217,
"lastModificationDate": 1695374870139,
"contentHash": "bb2815d1b7297d11c82eee3952d59434",
"sourceName": "script/op/deploy-royalty.s.sol",
"solcConfig": {
Expand Down Expand Up @@ -5721,8 +5808,8 @@
}
},
"src/libraries/ABErrors.sol": {
"lastModificationDate": 1693465366218,
"contentHash": "6182110616230ba2872975119c9c13ff",
"lastModificationDate": 1697529316377,
"contentHash": "416e21946e193edd8d77d311093fb338",
"sourceName": "src/libraries/ABErrors.sol",
"solcConfig": {
"settings": {
Expand Down Expand Up @@ -5971,7 +6058,7 @@
}
},
"src/token/ERC721/ERC721AB.sol": {
"lastModificationDate": 1695988116327,
"lastModificationDate": 1697528256709,
"contentHash": "bcd226b30367a6e00094a07dca959719",
"sourceName": "src/token/ERC721/ERC721AB.sol",
"solcConfig": {
Expand Down Expand Up @@ -6090,7 +6177,7 @@
}
},
"src/token/ERC721/ERC721ABOE.sol": {
"lastModificationDate": 1696322758850,
"lastModificationDate": 1697526491390,
"contentHash": "f31648078435acf839a046f667fd03c2",
"sourceName": "src/token/ERC721/ERC721ABOE.sol",
"solcConfig": {
Expand Down Expand Up @@ -6149,6 +6236,56 @@
}
}
},
"src/token/KYC/KYCNFT.sol": {
"lastModificationDate": 1697533034183,
"contentHash": "766f1e1ea9838c43d5d5a024ce1b0256",
"sourceName": "src/token/KYC/KYCNFT.sol",
"solcConfig": {
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata"
]
}
},
"evmVersion": "paris",
"libraries": {}
}
},
"imports": [
"lib/ERC721A/contracts/ERC721A.sol",
"lib/ERC721A/contracts/IERC721A.sol",
"lib/openzeppelin-contracts/contracts/access/Ownable.sol",
"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol",
"lib/openzeppelin-contracts/contracts/utils/Context.sol",
"src/libraries/ABDataTypes.sol",
"src/libraries/ABErrors.sol",
"src/libraries/ABEvents.sol"
],
"versionRequirement": "^0.8.18",
"artifacts": {
"KYCNFT": {
"0.8.19+commit.7dd6d404.Darwin.appleclang": "KYCNFT.sol/KYCNFT.json"
}
}
},
"src/utils/ABDataRegistry.sol": {
"lastModificationDate": 1695289811280,
"contentHash": "01daae19991c3d298a84da11cea6a548",
Expand Down Expand Up @@ -6808,7 +6945,7 @@
}
},
"test/factory/AnotherCloneFactory.t.sol": {
"lastModificationDate": 1695887552259,
"lastModificationDate": 1697526491394,
"contentHash": "28aa74940b4b4cac784b2cc9b9a6d370",
"sourceName": "test/factory/AnotherCloneFactory.t.sol",
"solcConfig": {
Expand Down Expand Up @@ -6930,7 +7067,7 @@
}
},
"test/royalty/ABRoyalty.t.sol": {
"lastModificationDate": 1695887559758,
"lastModificationDate": 1697526491394,
"contentHash": "1709c4b58e65fec2eb5d4f2a98d2dab4",
"sourceName": "test/royalty/ABRoyalty.t.sol",
"solcConfig": {
Expand Down Expand Up @@ -7068,7 +7205,7 @@
}
},
"test/token/ERC1155/ERC1155AB.t.sol": {
"lastModificationDate": 1695887569562,
"lastModificationDate": 1697526491395,
"contentHash": "7e601132d94c61b0b8aea76a591768ba",
"sourceName": "test/token/ERC1155/ERC1155AB.t.sol",
"solcConfig": {
Expand Down Expand Up @@ -7214,7 +7351,7 @@
}
},
"test/token/ERC721/ERC721ABLE.t.sol": {
"lastModificationDate": 1695887446720,
"lastModificationDate": 1697526491396,
"contentHash": "c3871a4701ce436512f1844c328b512f",
"sourceName": "test/token/ERC721/ERC721ABLE.t.sol",
"solcConfig": {
Expand Down Expand Up @@ -7355,7 +7492,7 @@
}
},
"test/token/ERC721/ERC721ABOE.t.sol": {
"lastModificationDate": 1696324340850,
"lastModificationDate": 1697526491396,
"contentHash": "a7b541a46d9274042a34a4f4a02dbbde",
"sourceName": "test/token/ERC721/ERC721ABOE.t.sol",
"solcConfig": {
Expand Down Expand Up @@ -7496,7 +7633,7 @@
}
},
"test/utils/ABDataRegistry.t.sol": {
"lastModificationDate": 1695306753046,
"lastModificationDate": 1697526491397,
"contentHash": "c5537f68bf6c3c9c871bbde7e9d6c952",
"sourceName": "test/utils/ABDataRegistry.t.sol",
"solcConfig": {
Expand Down Expand Up @@ -7613,7 +7750,7 @@
}
},
"test/utils/ABVerifier.t.sol": {
"lastModificationDate": 1695290530551,
"lastModificationDate": 1697526491397,
"contentHash": "9c9577365435fdbc47bbf215a8914342",
"sourceName": "test/utils/ABVerifier.t.sol",
"solcConfig": {
Expand Down
19 changes: 14 additions & 5 deletions src/token/KYC/KYCNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
pragma solidity ^0.8.18;

/* ERC721A Contract */
import {ERC721A} from "erc721a-upgradeable/contracts/ERC721A.sol";
import {ERC721A} from "erc721a/contracts/ERC721A.sol";

/* Openzeppelin Contract */
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/* anotherblock Libraries */
import {ABDataTypes} from "src/libraries/ABDataTypes.sol";
Expand All @@ -53,6 +54,11 @@ contract KYCNFT is ERC721A, Ownable {
// ___/ / /_/ /_/ / /_/ __(__ )
// /____/\__/\__,_/\__/\___/____/

/// @dev Base Token URI
string internal baseTokenURI;

constructor(string memory _name, string memory _symbol) ERC721A(_name, _symbol) {}

// ____ __ ___ __ _
// / __ \____ / /_ __ / | ____/ /___ ___ (_)___
// / / / / __ \/ / / / / / /| |/ __ / __ `__ \/ / __ \
Expand All @@ -69,6 +75,7 @@ contract KYCNFT is ERC721A, Ownable {
*/
function mint(address _to) external onlyOwner {
if (balanceOf(_to) > 0) revert ABErrors.MAX_MINT_PER_ADDRESS();
_mint(_to, 1);
}

/**
Expand Down Expand Up @@ -127,10 +134,12 @@ contract KYCNFT is ERC721A, Ownable {
_firstTokenId = 1;
}

function _beforeTokenTransfers(address _from, address _to, uint256, /* _startTokenId */ uint256 _quantity)
internal
override(ERC721A)
{
function _beforeTokenTransfers(
address, /* _from */
address _to,
uint256, /* _startTokenId */
uint256 /* _quantity*/
) internal pure override(ERC721A) {
if (_to != address(0)) {
revert ABErrors.CANNOT_TRANSFER_SOULBOUND();
}
Expand Down

0 comments on commit ced27ee

Please sign in to comment.