diff --git a/Makefile b/Makefile index d62a117..fd52c4c 100644 --- a/Makefile +++ b/Makefile @@ -107,6 +107,13 @@ ERC721Badge.setBaseURI:; forge script \ --rpc-url $(rpc) --broadcast $(verbose) $(legacy) $(slow) \ $(word 1, $(args)) $(word 2, $(args)) +# example: make ERC721Base.mintTo 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)) + # pass the badge contract address as an argument # example: make RewardFacet.mintBadge args="0xaf4c80136581212185f37c5e8809120d8fbf6224" RewardsFacet.mintBadge:; forge script \ diff --git a/scripts/tokens/ERC721Base.s.sol b/scripts/tokens/ERC721Base.s.sol index 529bb9a..0d256c4 100644 --- a/scripts/tokens/ERC721Base.s.sol +++ b/scripts/tokens/ERC721Base.s.sol @@ -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(); + } +}