Skip to content

Commit

Permalink
Merge branch 'main' into feature--update-rewards-facet
Browse files Browse the repository at this point in the history
  • Loading branch information
george-openformat authored May 30, 2024
2 parents b232e31 + 6c25efc commit 6aaa086
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.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 \
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 6aaa086

Please sign in to comment.