// Standard OpenZeppelin ERC721 ABI (constructor: name, symbol)
export const ERC721_ABI = [
"constructor(string name, string symbol)",
"function name() view returns (string)",
"function symbol() view returns (string)",
"function owner() view returns (address)",
"function mint(address to, string tokenURI) returns (uint256)",
"function tokenURI(uint256 tokenId) view returns (string)",
"function ownerOf(uint256 tokenId) view returns (address)",
"event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)"
];
// Template for contract deployment (for reference, not used directly)
export const ERC721_CONSTRUCTOR_PARAMS = ["string", "string"];
// Optionally, add the Solidity source as a string for reference
export const HYPERION_ERC721_SOURCE = `
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";
import \"@openzeppelin/contracts/access/Ownable.sol\";
contract HyperionERC721 is ERC721URIStorage, Ownable {
uint256 private _nextTokenId;
constructor(string memory name, string memory symbol) ERC721(name, symbol) Ownable(msg.sender) {}
function mint(address to, string memory tokenURI) public onlyOwner returns (uint256) {
uint256 tokenId = _nextTokenId++;
_mint(to, tokenId);
_setTokenURI(tokenId, tokenURI);
return tokenId;
}
}
`;
import * as fs from "fs";
import * as path from "path";
// Example: Get compiled bytecode for HyperionERC721 (to be replaced with actual artifact loading in production)
export function getHyperionERC721Bytecode(): string {
try {
const artifactPath = path.resolve(
__dirname,
"../artifacts/contracts/HyperionERC721.sol/HyperionERC721.json"
);
const artifact = JSON.parse(fs.readFileSync(artifactPath, "utf8"));
return artifact.bytecode;
} catch (err) {
throw new Error("Could not load HyperionERC721 bytecode: " + err);
}
}