Skip to content

Commit

Permalink
Merge pull request #125 from open-format/feature--mintTo-script-for-E…
Browse files Browse the repository at this point in the history
…RC721Base

feature: add mint to script for ERC721Base
  • Loading branch information
george-openformat authored May 30, 2024
2 parents cda19c9 + 958a513 commit 6c25efc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ ERC721Badge.setBaseURI:; forge script \
--rpc-url $(rpc) --broadcast $(verbose) $(legacy) $(slow) \
$(word 1, $(args)) $(word 2, $(args))

# example: make ERC721Base.setBaseURI args="0xaf4c80136581212185f37c5e8809120d8fbf6224 sometokenuri"
ERC721Base.mintTo:; forge script \
scripts/tokens/ERC721Base.s.sol:MintTo \
--sig "run(address,string)" \
--rpc-url $(rpc) --broadcast $(verbose) $(legacy) $(slow) \
$(word 1, $(args)) $(word 2, $(args))

# Run all update scripts
update:; make \
update-ERC721FactoryFacet \
Expand Down
13 changes: 13 additions & 0 deletions scripts/tokens/ERC721Base.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,16 @@ contract Deploy is Script, Utils {
exportContractDeployment(CONTRACT_NAME, address(erc721base), block.number);
}
}

contract MintTo is Script, Utils {
function run(address _contractAddress, string memory _tokenURI) external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
address deployerAddress = vm.addr(deployerPrivateKey);
vm.startBroadcast(deployerPrivateKey);

ERC721Base erc721Badge = ERC721Base(_contractAddress);
erc721Badge.mintTo(deployerAddress, _tokenURI);

vm.stopBroadcast();
}
}

0 comments on commit 6c25efc

Please sign in to comment.