Skip to content

Commit

Permalink
feat: create names deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoAcosta committed Nov 5, 2024
1 parent 56eb32c commit 8d7e7bc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions script/deploy/DeployNames.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import { Script, console } from "forge-std/Script.sol";

import { Names } from "../../src/names/Names.sol";

contract DeployNames is Script {
function setUp() external {}

function run() external {
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
uint256 superAdminPrivateKey = vm.envUint("SUPER_ADMIN_PRIVATE_KEY");

address deployer = vm.addr(deployerPrivateKey);
address superAdmin = vm.addr(superAdminPrivateKey);

console.log("Deployer address:", deployer);
console.log("Super Admin address:", superAdmin);

vm.startBroadcast(deployerPrivateKey);

Names names = new Names(superAdmin);
console.log("Names contract address:", address(names));

vm.stopBroadcast();

vm.startBroadcast(superAdminPrivateKey);

names.mintName("admin");

vm.stopBroadcast();
}
}
2 changes: 1 addition & 1 deletion src/names/Names.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ contract Names is ERC721Enumerable, INames, Ownable {

/// @notice Initializes the Names contract with basic metadata
/// @dev Sets initial URIs and configures base contract parameters
constructor() Ownable(msg.sender) ERC721("Plasa Names", "NAME") ERC721Enumerable() {
constructor(address _owner) Ownable(_owner) ERC721("Plasa Names", "NAME") ERC721Enumerable() {
contractURI = "some-contract-uri";
_tokenURI = "some-token-uri";
}
Expand Down

0 comments on commit 8d7e7bc

Please sign in to comment.