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

fix(nfts): snaefell v2 #17613

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions packages/nfts/contracts/snaefell/SnaefellToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,17 @@ contract SnaefellToken is ERC721EnumerableUpgradeable, MerkleWhitelist {
}
return super._update(to, tokenId, auth);
}

/// @notice Update the base URI
/// @param _rootURI The new base URI
/// @dev Only the owner can update the base URI
function updateBaseURI(string memory _rootURI) public onlyOwner {
_baseURIExtended = _rootURI;
}

/// @notice Get the base URI
/// @return The base URI
function baseURI() public view returns (string memory) {
return _baseURIExtended;
}
}
17 changes: 8 additions & 9 deletions packages/nfts/script/snaefell/sol/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ import { Script, console } from "forge-std/src/Script.sol";
import { Merkle } from "murky/Merkle.sol";
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import { SnaefellToken } from "../../../contracts/snaefell/SnaefellToken.sol";
import { IMinimalBlacklist } from "@taiko/blacklist/IMinimalBlacklist.sol";

contract DeployScript is Script {
UtilsScript public utils;
string public jsonLocation;
uint256 public deployerPrivateKey;
address public deployerAddress;

// Please set owner to labs.taiko.eth (0xB73b0FC4C0Cfc73cF6e034Af6f6b42Ebe6c8b49D) on Mainnnet.
address owner = vm.envAddress("OWNER");
bytes32 root = vm.envBytes32("MERKLE_ROOT");
// V2 Taiko Mainnet data
address owner = 0x7d70236E2517f5B95247AF1d806A9E3C328a7860;
bytes32 root = 0xb5edb18eeaeb9c03bde474b7dd392d0594ecc3d9066c7e3c90d611086543d01e;
string baseURI =
"https://taikonfts.4everland.link/ipfs/bafkreib2bkniueraowa23nga3cdijcx7lo4734dmkpgbeiz7hu2yfop4je";
IMinimalBlacklist blacklist = IMinimalBlacklist(0xfA5EA6f9A13532cd64e805996a941F101CCaAc9a);

function setUp() public {
utils = new UtilsScript();
Expand All @@ -33,15 +37,10 @@ contract DeployScript is Script {

vm.startBroadcast(deployerPrivateKey);

string memory baseURI = utils.getIpfsBaseURI();

address impl = address(new SnaefellToken());
address proxy = address(
new ERC1967Proxy(
impl,
abi.encodeCall(
SnaefellToken.initialize, (owner, baseURI, root, utils.getBlacklist())
)
impl, abi.encodeCall(SnaefellToken.initialize, (owner, baseURI, root, blacklist))
)
);

Expand Down