Skip to content

Commit

Permalink
fix(nfts): snaefell v2 (#17613)
Browse files Browse the repository at this point in the history
  • Loading branch information
bearni95 authored Jun 17, 2024
1 parent 48ad856 commit e077e11
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
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

0 comments on commit e077e11

Please sign in to comment.