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

feat(taikoon): migrate Taikoon NFT smart contracts here #16849

Merged
merged 26 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1992970
brought over contracts, tests and scripts; getting everything to run now
bearni95 Apr 25, 2024
b9b56ba
refreshed gitignore
bearni95 Apr 25, 2024
570e770
removed lib from tree
bearni95 Apr 25, 2024
175e4a4
tracking pnpm-lock.yaml main
bearni95 Apr 25, 2024
2d89594
missing deps added to enable compiling
bearni95 Apr 25, 2024
d3335f1
format & mint
bearni95 Apr 25, 2024
cb4baca
cleared lint warnings
bearni95 Apr 25, 2024
d44c463
updated pnpm; passing tests and build
bearni95 Apr 25, 2024
6817f27
removed .gitmodules
bearni95 Apr 25, 2024
71eaf4c
fixed typo leafs > leaves
bearni95 Apr 25, 2024
2442adc
added build step to gha
bearni95 Apr 25, 2024
7a522a2
fixed merkle whitelist generation script under new location
bearni95 Apr 25, 2024
5f55717
localhost deployment re-enabled
bearni95 Apr 25, 2024
30ec660
added holesky deployment
bearni95 Apr 25, 2024
311d129
restored ipfs deploy script
bearni95 Apr 25, 2024
c7e5731
updated pnpm-lock.yaml
bearni95 Apr 25, 2024
3e2099f
ran linter
bearni95 Apr 25, 2024
8b42156
simplified tests for taikoonToken.t.sol
bearni95 Apr 25, 2024
ae80196
updated forge-std version
bearni95 Apr 25, 2024
9e6f6e9
added compile step to gha
bearni95 Apr 25, 2024
bacd1d1
fixed gha typo
bearni95 Apr 25, 2024
3bd7dad
upgraded foundry toolchain version on gha
bearni95 Apr 25, 2024
ae94276
upgraded foundry toolchain version on gha
bearni95 Apr 25, 2024
dee3ea0
incorporated upgradeable constructor
bearni95 Apr 25, 2024
3217861
updated test command on gha
bearni95 Apr 25, 2024
7e0753e
fixed test script
bearni95 Apr 25, 2024
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
10 changes: 6 additions & 4 deletions .github/workflows/taikoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-2cb875799419c907cc3709e586ece2559e6b340e
uses: foundry-rs/foundry-toolchain@v1.2.0

- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies
Expand All @@ -35,6 +33,10 @@ jobs:
working-directory: ./packages/taikoon
run: forge fmt --check

- name: Solidity compilation
working-directory: ./packages/taikoon
run: pnpm compile

- name: Unit Tests
working-directory: ./packages/taikoon
run: pnpm clean && pnpm test
run: pnpm clean && pnpm compile && pnpm test
11 changes: 11 additions & 0 deletions packages/taikoon/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
LOCALHOST_PRIVATE_KEY=
LOCALHOST_ADDRESS=
HOLESKY_PRIVATE_KEY=
HOLESKY_ADDRESS=
DEVNET_PRIVATE_KEY=
DEVNET_ADDRESS=
SEPOLIA_PRIVATE_KEY=
SEPOLIA_ADDRESS=
KATLA_PRIVATE_KEY=
KATLA_ADDRESS=
IPFS_BASE_URI=
10 changes: 10 additions & 0 deletions packages/taikoon/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ broadcast

#coverage
lcov.info

# Custom
broadcast
.states
coverage
data/original
data/images
data/metadata
lcov.info
lib
74 changes: 74 additions & 0 deletions packages/taikoon/contracts/MerkleWhitelist.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import { ContextUpgradeable } from
"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";

/// @title MerkleWhitelist
/// @dev Merkle Tree Whitelist
/// @custom:security-contact security@taiko.xyz
contract MerkleWhitelist is ContextUpgradeable {
bearni95 marked this conversation as resolved.
Show resolved Hide resolved
event RootUpdated(bytes32 _root);
event MintConsumed(address _minter, uint256 _mintAmount);

error MINTS_EXCEEDED();
error INVALID_PROOF();
error INVALID_TOKEN_AMOUNT();

/// @notice Merkle Tree Root
bytes32 public root;
/// @notice Tracker for minted leaves
mapping(bytes32 leaf => bool hasMinted) public minted;

uint256[48] private __gap;

/// @notice Contract initializer
/// @param _root Merkle Tree root
function initialize(bytes32 _root) external initializer {
__Context_init();
root = _root;
}

/// @notice Check if a wallet can free mint
/// @param _minter Address of the minter
/// @param _maxMints Max amount of free mints
/// @return Whether the wallet can mint
function canMint(address _minter, uint256 _maxMints) public view returns (bool) {
bytes32 _leaf = leaf(_minter, _maxMints);
return !minted[_leaf];
}

/// @notice Generate a leaf from the minter and mint counts
/// @param _minter Address of the minter
/// @param _maxMints Max amount of free mints
/// @return The leaf hash
function leaf(address _minter, uint256 _maxMints) public pure returns (bytes32) {
return keccak256(bytes.concat(keccak256(abi.encode(_minter, _maxMints))));
}

/// @notice Internal initializer
/// @param _root Merkle Tree root
function __MerkleWhitelist_init(bytes32 _root) internal initializer {
__Context_init();
root = _root;
}

/// @notice Update the merkle tree's root
/// @param _root The new root
function _updateRoot(bytes32 _root) internal {
root = _root;
emit RootUpdated(_root);
}

/// @notice Permanently consume mints from the minter
/// @param _proof Merkle proof
/// @param _maxMints Max amount of free mints
function _consumeMint(bytes32[] calldata _proof, uint256 _maxMints) internal {
if (!canMint(_msgSender(), _maxMints)) revert MINTS_EXCEEDED();
bytes32 _leaf = leaf(_msgSender(), _maxMints);
if (!MerkleProof.verify(_proof, root, _leaf)) revert INVALID_PROOF();
minted[_leaf] = true;
emit MintConsumed(_msgSender(), _maxMints);
}
}
120 changes: 117 additions & 3 deletions packages/taikoon/contracts/TaikoonToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,118 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.24;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

contract TaikoonToken { }
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { Ownable2StepUpgradeable } from
"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import { ERC721EnumerableUpgradeable } from
"@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import { UUPSUpgradeable } from
"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

import { MerkleWhitelist } from "./MerkleWhitelist.sol";

/// @title TaikoonToken
/// @dev The Taikoons ERC-721 token
/// @custom:security-contact security@taiko.xyz
contract TaikoonToken is
ERC721EnumerableUpgradeable,
UUPSUpgradeable,
Ownable2StepUpgradeable,
MerkleWhitelist
{
/// @notice The current supply
uint256 private _totalSupply;
// Base URI required to interact with IPFS
string private _baseURIExtended;

uint256[48] private __gap;

error MAX_MINTS_EXCEEDED();
error MAX_SUPPLY_REACHED();
error MINTER_NOT_WHITELISTED();
error TOKEN_NOT_MINTED();

/// @notice Contract initializer
/// @param _rootURI Base URI for the token metadata
/// @param _merkleRoot Merkle tree root for the whitelist
function initialize(string memory _rootURI, bytes32 _merkleRoot) external initializer {
__ERC721_init("Taikoon", "TKOON");
__Ownable_init(_msgSender());
__MerkleWhitelist_init(_merkleRoot);
_baseURIExtended = _rootURI;
}

/// @notice Update the whitelist's merkle root
/// @param _root New merkle root
function updateRoot(bytes32 _root) external onlyOwner {
_updateRoot(_root);
}

/// @notice Mint a token, handling the free vs paid internally
/// @param _proof Merkle proof validating the minter
/// @param _maxMints The amount of tokens to mint
/// @return tokenIds The minted token ids
function mint(
bytes32[] calldata _proof,
uint256 _maxMints
)
external
returns (uint256[] memory)
{
if (!canMint(_msgSender(), _maxMints)) revert MINTER_NOT_WHITELISTED();

_consumeMint(_proof, _maxMints);
return _batchMint(_msgSender(), _maxMints);
}

/// @notice Mint method for the owner
/// @param _to The address to mint to
/// @param _amount The amount of tokens to mint
/// @return tokenIds The minted token ids
function mint(address _to, uint256 _amount) external onlyOwner returns (uint256[] memory) {
return _batchMint(_to, _amount);
}

/// @notice Get the tokenURI of a particular tokenId
/// @param _tokenId The token ID
/// @return The token URI
function tokenURI(uint256 _tokenId) public view override returns (string memory) {
if (_tokenId > _totalSupply) revert TOKEN_NOT_MINTED();
return string.concat(_baseURI(), "/", Strings.toString(_tokenId), ".json");
}

/// @notice Get the current total supply
/// @return The total supply
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}

/// @notice Get the max supply of Taikoons
/// @return The max supply
function maxSupply() public pure returns (uint256) {
return 888;
}
/// @notice Calculate the amount of free and paid mints
/// @return The base URI for the token metadata

function _baseURI() internal view override returns (string memory) {
return _baseURIExtended;
}

/// @notice Internal method to authorize an upgrade
function _authorizeUpgrade(address) internal virtual override onlyOwner { }

/// @notice Internal method to batch mint tokens
/// @param _to The address to mint to
/// @param _amount The amount of tokens to mint
/// @return tokenIds The minted token ids
function _batchMint(address _to, uint256 _amount) private returns (uint256[] memory tokenIds) {
if (_totalSupply + _amount > maxSupply()) revert MAX_SUPPLY_REACHED();
tokenIds = new uint256[](_amount);

for (uint256 i; i < _amount; ++i) {
tokenIds[i] = ++_totalSupply;
_mint(_to, tokenIds[i]);
}
}
}
14 changes: 14 additions & 0 deletions packages/taikoon/data/taikoons-32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"blobs": [
"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA80lEQVR4nO2TTQrCMBBGZ9KlG9eCF3HlaVzpETyMeBwRylzAupAuBbtzU6k0JWhLZuokQTHwKOlPvteZBGh/rFMCfwFqS1Hdrh3RW1A54bEloC88pgi4QUkEiPFSZowYNYHMmHq2PrOZb4rnlSsB2gIWVYHJYivmNwSykeWXtAFChXMlIGQ4RwJCh/skoE8gF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CG5uE6yAHgTUKlmrsAYub0qaVWqzn9N5YxSAGQ5hqAFrHMVlYbwgyQau5tVfBGn2LubVETIHaQwugsue4JzDR/fX4wVRXg+PWyqrB8mwDAHH1VANgg+uoA/b4yQBtpNfqt33dj/9mNN7dPqyoCaAMIrj8BUIRk0DRNVFUAjlP6u6kEZEADhsNiKudVM/D7cQ7ApnK+CUCrQIQAPBiARzYAOrMQHjg+F8WHEB0QP1f3ZgsSYNFVjEY5ZBZYw3wv8Lz4YYROCEvWW1ASACoQXhW9D6ACkSrXvugE0Aa13vANk8I2dAeGiQDyuwQIIS4CMBpZuBiAhMgBOAHLN+Viam4D4AAAAABJRU5ErkJggg==",
"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAABYklEQVR4nO2UPU7EMBBGxw1bc4jQQBFNS4dSwA3SrJQLUKSGFHsARAEFl+AGnABRIN9htcdYZIuxZh0ndjLxQrGWnrRJduZ78U9Afz3v/xI4Cej/vAQAIGueUA+xBnMlUmsh1gQRJ0lQcGodxJptdheuWawhBRtM3WICG09iDArPIoCJZBeAY8wAsIZ+eFuVjrfm5gBeIxZoq7LXkO77wXMlYEr47fWlxfweE+ASYoGiKCxc4PVxHT0NSimZAAysvwlPQSyAiPu6rh1zBWISkBIekni//4iSXUApNchRBMzYqp0L5dezBXRsD3RNT4BC+bVYALxT4MI9ARokQIMExN8B+MXubhLomt6GC23MRT7FbVXat3NHjM3CIF1ja2LhowJcIijAeHnoPzM1359PMgHN9oOVCIQfzAgLT3n7JAFidXY+eu455r9ZBFYTWFwAr+6CQXTff55NQHuzcRJA4RL8AMObPCfvhEzaAAAAAElFTkSuQmCC"
]
}
6 changes: 6 additions & 0 deletions packages/taikoon/data/whitelist/hardhat.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
freeMints,address
100,0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
100,0x70997970C51812dc3A010C7d01b50e0d17dc79C8
100,0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
100,0x90F79bf6EB2c4f870365E785982E1f101E93b906
100,0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
38 changes: 38 additions & 0 deletions packages/taikoon/data/whitelist/hardhat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"format": "standard-v1",
"tree": [
"0x1c3b504b4d5640d26ad1aa3b57a9df9ec034f19239768e734b849c306d10b110",
"0x4cf915673e85b4e9ccf29a222e38d5bf700e621f8d1fa1b9dc32c5eb518e3ee9",
"0xf81b4a0419e54333847754d4d8f75b5debd786bc934fcd9a75e6a84324fcd262",
"0xb96d191e2b17e998f580dda00f309f35a73c7aa7de560cbf9512536c3bec5400",
"0xfa31eb8d65ff2307b7026df667a06a19aade0151ed701ed2307295ae4fa48364",
"0xd564c879701263dc95ed8b12a3ccc0068725c20abe9b3f974d37039d3502004a",
"0xcfa52795847379e100e5fe363a62abec587da5ae587614c82afb0af917d037c6",
"0x6a9ce9822687cfc256f353882a96be5fe95f4de311b84f737ad8a5e184a0dd4f",
"0x216e60a5ff1ea005e332f4ff55613abd29e314ea5de98b3c27162aad1428f5f4"
],
"values": [
{
"value": ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "100"],
"treeIndex": 8
},
{
"value": ["0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "100"],
"treeIndex": 7
},
{
"value": ["0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", "100"],
"treeIndex": 4
},
{
"value": ["0x90F79bf6EB2c4f870365E785982E1f101E93b906", "100"],
"treeIndex": 6
},
{
"value": ["0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", "100"],
"treeIndex": 5
}
],
"leafEncoding": ["address", "uint256"],
"root": "0x1c3b504b4d5640d26ad1aa3b57a9df9ec034f19239768e734b849c306d10b110"
}
7 changes: 7 additions & 0 deletions packages/taikoon/data/whitelist/holesky.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
freeMints,address
10,0x8f63e3cD0D14cAef993E59B4e01e3D404cF3c1B7
10,0x2E2989015f5818A256EB967940454EfE8a0B4b5d
10,0x927a146e18294efb36edCacC99D9aCEA6aB16b95
10,0x4757D97449acA795510b9f3152C6a9019A3545c3
10,0x424bFb32f78731252a6BCeDc828E38e2701DAAEf
10,0xC66fAdfFeb6DA3b9A7FA3C71130F881e3a9B13fb
10 changes: 8 additions & 2 deletions packages/taikoon/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ ffi = true
memory_limit = 2_073_741_824
solc_version = "0.8.24"
evm_version = "cancun"
ast=true
remappings = [
"@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"solady/=node_modules/solady/",
"forge-std/=node_modules/forge-std/",
"forge-std/=node_modules/forge-std/src/",
"ds-test/=node_modules/ds-test/src/",
"p256-verifier/=node_modules/p256-verifier/",
"murky/=node_modules/murky/src/",
"@openzeppelin/foundry-upgrades/=node_modules/@openzeppelin/foundry-upgrades/src/",
dantaik marked this conversation as resolved.
Show resolved Hide resolved
"solidity-stringutils/=node_modules/solidity-stringutils/",
]

# Do not change the block_gas_limit value, TaikoL2.t.sol depends on it.
Expand All @@ -27,15 +31,17 @@ block_gas_limit = 80_000_000

fs_permissions = [
{ access = "read", path = "./out" },
{ access = "read-write", path = "./deployments" },
{ access = "read-write", path = "./deployments/" },
{ access = "read", path = "./test" },
{ access = "read", path = "./genesis" },
{access = "read", path="./data/"},
]

# 2394: Transient storage warning
# 3860: Contract initcode size is xxx bytes and exceeds 49152 bytes
# 5574: Contract code size is xxx bytes and exceeds 24576 byte
ignored_error_codes = [2394, 3860, 5574]
libs = ["node_modules", "lib"]

[fuzz]
runs = 200
Expand Down
22 changes: 17 additions & 5 deletions packages/taikoon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
"eslint": "pnpm exec eslint --ignore-path .eslintignore --ext .js,.ts .",
"fmt:sol": "forge fmt",
"lint:sol": "forge fmt && pnpm solhint 'contracts/**/*.sol'",
"test": "forge test -vvv --match-path test/*.t.sol"
"test": "forge test --match-path 'test/*.t.sol' -vvv",
"node": "anvil",
"merkle": "node script/js/generate-merkle-tree.js",
"deploy:localhost": "forge clean && pnpm compile && forge script script/sol/Deploy.s.sol --rpc-url http://localhost:8545 --broadcast",
"deploy:holesky": "forge clean && pnpm compile && forge script script/sol/Deploy.s.sol --rpc-url https://l1rpc.hekla.taiko.xyz/ --broadcast --gas-estimate-multiplier 200",
"deploy:ipfs": "rm -rf data/metadata/* && node script/js/resize-images.js && node script/js/add-images-ipfs.js && echo 'IPFS Base URI:' && ipfs add -r ./data/metadata/ && echo 'Update your .env file with the new IPFS URI'"
},
"devDependencies": {
"@types/node": "^20.11.20",
Expand All @@ -28,12 +33,19 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@openzeppelin/contracts": "4.9.6",
"@openzeppelin/contracts-upgradeable": "4.9.6",
"@openzeppelin/contracts": "5.0.2",
"@openzeppelin/contracts-upgradeable": "5.0.2",
"@openzeppelin/foundry-upgrades": "github:OpenZeppelin/openzeppelin-foundry-upgrades",
"@openzeppelin/merkle-tree": "^1.0.6",
"convert-csv-to-json": "^2.46.0",
"ds-test": "github:dapphub/ds-test#e282159d5170298eb2455a6c05280ab5a73a4ef0",
"forge-std": "github:foundry-rs/forge-std#v1.7.5",
"forge-std": "github:foundry-rs/forge-std",
"ipfs-http-client": "^60.0.1",
"merkletreejs": "^0.3.11",
"murky": "github:dmfxyz/murky",
"p256-verifier": "github:taikoxyz/p256-verifier#v0.1.0",
"solady": "github:Vectorized/solady#v0.0.167"
"sharp": "^0.33.3",
"solady": "github:Vectorized/solady#v0.0.167",
"solidity-stringutils": "github:Arachnid/solidity-stringutils"
}
}
Loading