Skip to content

Commit

Permalink
Create script to set token URI
Browse files Browse the repository at this point in the history
  • Loading branch information
geovgy committed Nov 8, 2024
1 parent 15cef63 commit 8552583
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ out/
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
/broadcast/

# Docs
docs/

# Dotenv file
.env

# metadata
metadata/
19 changes: 19 additions & 0 deletions script/SetURI.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Script} from "forge-std/Script.sol";
import {EIPAuthorReward} from "../src/EIPAuthorReward.sol";

contract SetURI is Script {
function run() external returns (uint256 tokenId, string memory uri) {
EIPAuthorReward nft = EIPAuthorReward(vm.envAddress("NFT_ADDRESS"));
tokenId = uint256(keccak256(abi.encodePacked(vm.envString("UPGRADE_NAME"))));
uri = vm.envString("IPFS_URI");

uint256 ownerPrivateKey = vm.envUint("OWNER_PRIVATE_KEY");

vm.startBroadcast(ownerPrivateKey);
nft.setUri(tokenId, uri);
vm.stopBroadcast();
}
}

0 comments on commit 8552583

Please sign in to comment.