-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nfts): taikoons upgradeable v2 (#17580)
- Loading branch information
Showing
12 changed files
with
336 additions
and
164 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
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,56 @@ | ||
## MerkleWhitelist | ||
|
||
| Name | Type | Slot | Offset | Bytes | Contract | | ||
| --------- | -------------------------- | ---- | ------ | ----- | ------------------------------------------------------ | | ||
| root | bytes32 | 0 | 0 | 32 | contracts/snaefell/MerkleWhitelist.sol:MerkleWhitelist | | ||
| minted | mapping(bytes32 => bool) | 1 | 0 | 32 | contracts/snaefell/MerkleWhitelist.sol:MerkleWhitelist | | ||
| blacklist | contract IMinimalBlacklist | 2 | 0 | 20 | contracts/snaefell/MerkleWhitelist.sol:MerkleWhitelist | | ||
| \_\_gap | uint256[48] | 3 | 0 | 1536 | contracts/snaefell/MerkleWhitelist.sol:MerkleWhitelist | | ||
|
||
## TaikoonToken | ||
|
||
| Name | Type | Slot | Offset | Bytes | Contract | | ||
| ----------------- | -------------------------- | ---- | ------ | ----- | ----------------------------------------------- | | ||
| root | bytes32 | 0 | 0 | 32 | contracts/taikoon/TaikoonToken.sol:TaikoonToken | | ||
| minted | mapping(bytes32 => bool) | 1 | 0 | 32 | contracts/taikoon/TaikoonToken.sol:TaikoonToken | | ||
| blacklist | contract IMinimalBlacklist | 2 | 0 | 20 | contracts/taikoon/TaikoonToken.sol:TaikoonToken | | ||
| \_\_gap | uint256[47] | 3 | 0 | 1504 | contracts/taikoon/TaikoonToken.sol:TaikoonToken | | ||
| \_totalSupply | uint256 | 50 | 0 | 32 | contracts/taikoon/TaikoonToken.sol:TaikoonToken | | ||
| \_baseURIExtended | string | 51 | 0 | 32 | contracts/taikoon/TaikoonToken.sol:TaikoonToken | | ||
| \_\_gap | uint256[47] | 52 | 0 | 1504 | contracts/taikoon/TaikoonToken.sol:TaikoonToken | | ||
|
||
## SnaefellToken | ||
|
||
| Name | Type | Slot | Offset | Bytes | Contract | | ||
| ----------------- | -------------------------- | ---- | ------ | ----- | -------------------------------------------------- | | ||
| root | bytes32 | 0 | 0 | 32 | contracts/snaefell/SnaefellToken.sol:SnaefellToken | | ||
| minted | mapping(bytes32 => bool) | 1 | 0 | 32 | contracts/snaefell/SnaefellToken.sol:SnaefellToken | | ||
| blacklist | contract IMinimalBlacklist | 2 | 0 | 20 | contracts/snaefell/SnaefellToken.sol:SnaefellToken | | ||
| \_\_gap | uint256[48] | 3 | 0 | 1536 | contracts/snaefell/SnaefellToken.sol:SnaefellToken | | ||
| \_totalSupply | uint256 | 51 | 0 | 32 | contracts/snaefell/SnaefellToken.sol:SnaefellToken | | ||
| \_baseURIExtended | string | 52 | 0 | 32 | contracts/snaefell/SnaefellToken.sol:SnaefellToken | | ||
| \_\_gap | uint256[48] | 53 | 0 | 1536 | contracts/snaefell/SnaefellToken.sol:SnaefellToken | | ||
|
||
## ECDSAWhitelist | ||
|
||
| Name | Type | Slot | Offset | Bytes | Contract | | ||
| ---------- | -------------------------- | ---- | ------ | ----- | --------------------------------------------------------------- | | ||
| mintSigner | address | 0 | 0 | 20 | contracts/trailblazers-badges/ECDSAWhitelist.sol:ECDSAWhitelist | | ||
| minted | mapping(bytes32 => bool) | 1 | 0 | 32 | contracts/trailblazers-badges/ECDSAWhitelist.sol:ECDSAWhitelist | | ||
| blacklist | contract IMinimalBlacklist | 2 | 0 | 20 | contracts/trailblazers-badges/ECDSAWhitelist.sol:ECDSAWhitelist | | ||
| \_\_gap | uint256[47] | 3 | 0 | 1504 | contracts/trailblazers-badges/ECDSAWhitelist.sol:ECDSAWhitelist | | ||
|
||
## TrailblazersBadges | ||
|
||
| Name | Type | Slot | Offset | Bytes | Contract | | ||
| ----------------- | ----------------------------------------------- | ---- | ------ | ----- | ----------------------------------------------------------------------- | | ||
| mintSigner | address | 0 | 0 | 20 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| minted | mapping(bytes32 => bool) | 1 | 0 | 32 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| blacklist | contract IMinimalBlacklist | 2 | 0 | 20 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| \_\_gap | uint256[47] | 3 | 0 | 1504 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| \_baseURIExtended | string | 50 | 0 | 32 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| badges | mapping(uint256 => uint256) | 51 | 0 | 32 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| movements | mapping(address => uint256) | 52 | 0 | 32 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| userBadges | mapping(address => mapping(uint256 => uint256)) | 53 | 0 | 32 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| movementBadges | mapping(bytes32 => uint256[2]) | 54 | 0 | 32 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | | ||
| \_\_gap | uint256[43] | 55 | 0 | 1376 | contracts/trailblazers-badges/TrailblazersBadges.sol:TrailblazersBadges | |
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
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,25 @@ | ||
#!/bin/bash | ||
|
||
# Define the list of contracts to inspect | ||
contracts=( | ||
"MerkleWhitelist" | ||
"TaikoonToken" | ||
"SnaefellToken" | ||
"ECDSAWhitelist" | ||
"TrailblazersBadges" | ||
) | ||
|
||
# Empty the output file initially | ||
output_file="contract_layout.md" | ||
> $output_file | ||
|
||
# Loop over each contract | ||
for contract in "${contracts[@]}"; do | ||
# Run forge inspect and append to the file | ||
# Ensure correct concatenation of the command without commas | ||
echo "forge inspect ${contract} storagelayout --pretty >> $output_file" | ||
|
||
echo "## ${contract}" >> $output_file | ||
forge inspect ${contract} storagelayout --pretty >> $output_file | ||
echo "" >> $output_file | ||
done |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"MerkleRoot": "0x1c3b504b4d5640d26ad1aa3b57a9df9ec034f19239768e734b849c306d10b110", | ||
"Owner": "0xf8ff2AF0DC1D5BA4811f22aCb02936A1529fd2Be", | ||
"TaikoonToken": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9" | ||
"TaikoonToken": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853" | ||
} |
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
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
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
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
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,46 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import { UtilsScript } from "./Utils.s.sol"; | ||
import { Script, console } from "forge-std/src/Script.sol"; | ||
import { MerkleMintersScript } from "./MerkleMinters.s.sol"; | ||
import { Merkle } from "murky/Merkle.sol"; | ||
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import { TaikoonToken } from "../../../contracts/taikoon/TaikoonToken.sol"; | ||
import { IMinimalBlacklist } from "@taiko/blacklist/IMinimalBlacklist.sol"; | ||
|
||
contract UpgradeV2 is Script { | ||
UtilsScript public utils; | ||
string public jsonLocation; | ||
uint256 public deployerPrivateKey; | ||
address public deployerAddress; | ||
|
||
address tokenV1 = 0x4A045C5016B200F7E08a4caBB2cdA6E85bF53295; | ||
|
||
string baseURI = | ||
"https://taikonfts.4everland.link/ipfs/bafybeiegdqpwx3he5dvoxqklspdjekjepjcobfaakyficksratn73qbbyy"; | ||
|
||
TaikoonToken public token; | ||
|
||
function setUp() public { | ||
utils = new UtilsScript(); | ||
utils.setUp(); | ||
|
||
jsonLocation = utils.getContractJsonLocation(); | ||
deployerPrivateKey = utils.getPrivateKey(); | ||
deployerAddress = utils.getAddress(); | ||
} | ||
|
||
function run() public { | ||
token = TaikoonToken(tokenV1); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
token.upgradeToAndCall( | ||
address(new TaikoonToken()), abi.encodeCall(TaikoonToken.updateBaseURI, (baseURI)) | ||
); | ||
|
||
token = TaikoonToken(token); | ||
|
||
console.log("Upgraded TaikoonToken to:", address(token)); | ||
} | ||
} |
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
Oops, something went wrong.