Skip to content

Commit b90ee7e

Browse files
committed
add script for nft deployment
1 parent 19c3516 commit b90ee7e

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PRIVATE_KEY_DEPLOYER=1234567890123456789012345678901234567890123456789012345678901234
2-
PRIVATE_KEY_DEV=1234567890123456789012345678901234567890123456789012345678901234
1+
PRIVATE_KEY_DEPLOYER=12345...
2+
PRIVATE_KEY_DEV=12345...
33
ETHERSCAN_API_KEY=
44
BASE_API_KEY=
55
BASE_SEPOLIA_RPC_URL=

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ endif
4141

4242
deploy:
4343
@forge clean && forge script script/DeployContracts.s.sol:DeployContracts $(NETWORK_ARGS)
44+
45+
deploy-nft:
46+
@forge clean && forge script script/DeployNft.s.sol:DeployNft $(NETWORK_ARGS)

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,18 @@ make test
325325
make coverage
326326
```
327327

328+
7. Deploy the contracts on the base sepolia network by running
329+
330+
```shell
331+
make deploy ARGS="--network basesepolia"
332+
```
333+
334+
8. Deploy the nft contract on the base sepolia network by running
335+
336+
```shell
337+
make deploy-nft ARGS="--network basesepolia"
338+
```
339+
328340
## References
329341

330342
### Mathematical Formula and tables

script/DeployNft.s.sol

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
// DeployNft.s.sol
22
// SPDX-License-Identifier: MIT
3-
43
pragma solidity 0.8.24;
54

6-
import {console, Script} from "forge-std/Script.sol";
5+
import {Script, console} from "forge-std/Script.sol";
76
import {AmbassadorNft} from "src/AmbassadorNft.sol";
87

98
contract DeployNft is Script {
109
function run() public {
11-
vm.startBroadcast();
10+
address defender = vm.envAddress("OPENZEPPELIN_DEFENDER_ADDR");
11+
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_DEPLOYER");
12+
address deployer = vm.addr(deployerPrivateKey);
13+
address admin = deployer;
14+
address minter = defender;
15+
address burner = defender;
16+
address uriSetter = defender;
17+
18+
vm.startBroadcast(deployerPrivateKey);
19+
20+
AmbassadorNft nft = new AmbassadorNft(
21+
admin,
22+
minter,
23+
burner,
24+
uriSetter
25+
);
26+
27+
console.log("Deployer:", deployer);
28+
console.log("AmbassadorNft deployed at:", address(nft));
1229

1330
vm.stopBroadcast();
1431
}

src/AmbassadorNft.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ contract AmbassadorNft is ERC1155, AccessControl, ERC1155Burnable {
6969
_burn(account, id, amount);
7070
}
7171

72-
/// @notice Batch burning is not supported.
72+
/// @notice Batch burning is supported only by the BURNER_ROLE.
7373
function burnBatch(address account, uint256[] memory ids, uint256[] memory values)
7474
public
7575
virtual

0 commit comments

Comments
 (0)