Skip to content

Commit

Permalink
Start of Deploy Scripts for Treasury Contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Oct 29, 2024
1 parent 65e8c4c commit 1065a42
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 4 deletions.
40 changes: 40 additions & 0 deletions script/Treasury/DeployGenesisPriceOracle.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {Script} from "forge-std/Script.sol";
import {Oracle} from "src/Treasury/Oracle.sol";

contract DeployGenesisPriceOracle is Script {
GenesisPriceOracle public genesisPriceOracle;

function run() external {
address fyre = 0xFYREAddressHere; // Replace with actual FYRE address
address manaERC20 = 0xMANAERC20AddressHere; // Replace with actual MANA ERC20 address
address labContrib = 0xLABCONTRIBAddress; // Replace with actual LAB_CONTRIB address
address finContrib = 0xFINCONTRIBAddress; // Replace with actual FIN_CONTRIB address
address shld = 0xSHLDAddress; // Replace with actual SHLD address

uint256 fyrePrice = 100; // Replace with actual price for FYRE
uint256 manaERC20Price = 200; // Replace with actual price for MANA ERC20
uint256 labContribPrice = 300; // Replace with actual price for LAB_CONTRIB
uint256 finContribPrice = 400; // Replace with actual price for FIN_CONTRIB
uint256 shldPrice = 500; // Replace with actual price for SHLD

vm.startBroadcast();
genesisPriceOracle = new GenesisPriceOracle(
fyre,
manaERC20,
labContrib,
finContrib,
shld,
fyrePrice,
manaERC20Price,
labContribPrice,
finContribPrice,
shldPrice
);
vm.stopBroadcast();

console.log("GenesisPriceOracle deployed at:", address(genesisPriceOracle));
}
}
20 changes: 20 additions & 0 deletions script/Treasury/DeployManaBalanceVerifier.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// deploy_ManaBalanceVerifier.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {Script} from "forge-std/Script.sol";
import {ManaBalanceVerifier} from "src/Treasury/ManaBalanceVerifier.sol";

contract DeployManaBalanceVerifier is Script {
ManaBalanceVerifier public manaBalanceVerifier;

function run() external {
address signer = 0xYourSignerAddressHere; // Replace with the actual signer address

vm.startBroadcast();
manaBalanceVerifier = new ManaBalanceVerifier(signer);
vm.stopBroadcast();

console.log("ManaBalanceVerifier deployed at:", address(manaBalanceVerifier));
}
}
38 changes: 38 additions & 0 deletions script/Treasury/DeployPurchaseFYRE.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {Script} from "forge-std/Script.sol";
import {PurchaseFYRE} from "src/Treasury/PurchaseFYRE.sol";
import {FYREToken} from "src/Tokens/FYREToken.sol";
import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";

contract DeployPurchaseFYRE is Script {
PurchaseFYRE public purchaseFYRE;

function run() external {
// Replace with deployed token addresses
FyreToken fyreToken = FyreToken(0xFYRETokenAddressHere); // FYRE token address
IERC20 usdcToken = IERC20(0xUSDCTokenAddressHere); // USDC token address
IERC20 tbtcToken = IERC20(0xTBTCAddressHere); // tBTC token address

uint256 usdcToFyreRate = 100; // Initial FYRE per USDC rate
uint256 ethToFyreRate = 200; // Initial FYRE per ETH rate
uint256 tbtcToFyreRate = 150; // Initial FYRE per tBTC rate

address treasury = 0xTreasuryAddressHere; // Replace with the actual treasury address

vm.startBroadcast();
purchaseFYRE = new PurchaseFYRE(
fyreToken,
usdcToken,
tbtcToken,
usdcToFyreRate,
ethToFyreRate,
tbtcToFyreRate,
treasury
);
vm.stopBroadcast();

console.log("PurchaseFYRE deployed at:", address(purchaseFYRE));
}
}
2 changes: 1 addition & 1 deletion src/Treasury/PurchaseFYRE.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {FYREToken} from "../Tokens/FYREToken.sol"; // Import the FYRE ERC20 token contract
import {FYREToken} from "../Tokens/FYREToken.sol";
import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol";
import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";

Expand Down
4 changes: 2 additions & 2 deletions src/Treasury/PurchaseMANA.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {FYREToken} from "../Tokens/FYREToken.sol"; // Import the FYRE ERC20 token contract
import {MANA} from "../Tokens/MANA.sol"; // Import the MANA ERC1400 token contract
import {FYREToken} from "../Tokens/FYREToken.sol";
import {MANA} from "../Tokens/MANA.sol";
import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol";

contract PurchaseMANA is Ownable {
Expand Down
2 changes: 1 addition & 1 deletion src/Treasury/PurchaseSHLD.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {FYREToken} from "../Tokens/FYREToken.sol"; // Import the FYRE ERC20 token contract
import {FYREToken} from "../Tokens/FYREToken.sol";
import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol";
import {ECDSA} from "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol";

Expand Down

0 comments on commit 1065a42

Please sign in to comment.