Skip to content

Commit

Permalink
update fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJonaseb11 committed Jun 4, 2024
1 parent 6225ac9 commit c018b84
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
1 change: 1 addition & 0 deletions smart_contract/arguments.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = [
"Meta",
"Meta",
"https://example.com/metadata/",
"50000000000000000000",
"0",
"0",
Expand Down
37 changes: 26 additions & 11 deletions smart_contract/scripts/deployToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const main = async() => {
const [deployer] = await ethers.getSigners();
const name = "Meta";
const symbol = "Meta";
const uri = "https://example.com/metadata/";
const maxSupply = ethers.parseEther("50");
const publicPrice = ethers.parseEther("0");
const initialTokenSupply = ethers.parseEther("0");
Expand All @@ -13,6 +14,7 @@ const main = async() => {
const argumentsArray = [
name,
symbol,
uri,
maxSupply.toString(),
publicPrice.toString(),
initialTokenSupply.toString(),
Expand All @@ -27,16 +29,29 @@ const main = async() => {
console.log("Deploying contract with account:", deployer.address);

const Token = await ethers.getContractFactory("NFTMintDN404");
const token = await Token.deploy(
name,
symbol,
maxSupply,
publicPrice,
initialTokenSupply,
signer
);

console.log("Fractionalized NFT deployed to:", await token.getAddress());
const token = await Token.deploy(
name,
symbol,
uri,
maxSupply,
publicPrice,
initialTokenSupply,
signer
);

console.log("Fractionalized NFT deployed to:", await token.getAddress());

// Get the base URI
const baseURI = await token.baseURI();
console.log("Contract Metadata URI:", baseURI);

// Save the contract address and base URI to a file
const contractInfo = {
address: await token.getAddress(),
baseURI: baseURI
};
fs.writeFileSync("contract-info.json", JSON.stringify(contractInfo, null, 2));
console.log("Contract information saved to contract-info.json");
}

const runMain = async() => {
Expand All @@ -49,4 +64,4 @@ const runMain = async() => {
}
}

runMain();
runMain();

0 comments on commit c018b84

Please sign in to comment.