-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
authored and
root
committed
Nov 1, 2024
1 parent
061a468
commit 8f95d75
Showing
14 changed files
with
101 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,46 @@ | ||
// File: script/DeployMANA.s.sol | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import {MANA} from "src/Tokens/MANA.sol"; | ||
import {console} from "forge-std/console.sol"; | ||
import {HelperConfig} from "script/HelperConfig.s.sol"; | ||
import {console} from "forge-std/console.sol"; | ||
|
||
contract DeployMANA is Script { | ||
MANA public manaToken; | ||
MANA public mana; | ||
|
||
function run() external { | ||
HelperConfig helperConfig = new HelperConfig(); | ||
uint256 deployerKey = helperConfig.activeNetworkConfig.deployerKey; | ||
|
||
vm.startBroadcast(deployerKey); | ||
manaToken = new MANA(); | ||
helperConfig.setDeployedAddresses( | ||
address(0), | ||
address(manaToken), | ||
address(0), | ||
deployerKey | ||
); | ||
|
||
// Get the treasury address from HelperConfig; it may be address(0) | ||
address treasury = helperConfig.activeNetworkConfig.treasuryAddress; | ||
|
||
// Log a warning if treasury is set to the zero address | ||
if (treasury == address(0)) { | ||
console.log( | ||
"Warning: Treasury address is currently set to the zero address." | ||
); | ||
} | ||
|
||
bytes32[] memory defaultPartitions = new bytes32[](1); | ||
bytes32; | ||
defaultPartitions[0] = bytes32(0); | ||
|
||
// Retrieve deployer key | ||
uint256 deployerPrivateKey = helperConfig.getDeployerKey(); | ||
|
||
// Begin broadcasting transaction | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
// Deploy the MANA contract with treasury and default partitions | ||
mana = new MANA(treasury, defaultPartitions); | ||
|
||
// Update HelperConfig with the deployed MANA contract address | ||
helperConfig.setDeployedMANAAddress(address(mana)); | ||
|
||
// End broadcasting transaction | ||
vm.stopBroadcast(); | ||
|
||
console.log("Deployed MANA token at:", address(manaToken)); | ||
console.log("Deployed MANA at:", address(mana)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.