Skip to content

Commit

Permalink
Merge pull request #34 from 0xBcamp/mumbai
Browse files Browse the repository at this point in the history
Mumbai
  • Loading branch information
0xwetzo authored Feb 17, 2024
2 parents d76a7b4 + fe4393a commit 4985edb
Show file tree
Hide file tree
Showing 44 changed files with 13,050 additions and 816 deletions.
6 changes: 5 additions & 1 deletion packages/hardhat/NOTES-TF.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ This logic is a compact way to determine the outcome of a rock-paper-scissors ga

## 1/30
Yearn Notes:
Once a user's liquidity is withdrawn from the yVault, their yVault Token will be burned. yVault Tokens are ERC20, meaning they can be transferred and traded as any other common Ethereum token.
Once a user's liquidity is withdrawn from the yVault, their yVault Token will be burned. yVault Tokens are ERC20, meaning they can be transferred and traded as any other common Ethereum token.

## 2/24 Deployed contracts to goerli
tournament - 0x18a03553a264E7Ee66B288E1A44DF15011C43C6a
factory - 0x11B95a450d0869fC27dd530A06671062413FA66b
111 changes: 56 additions & 55 deletions packages/hardhat/deploy/00_deploy_your_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,62 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";

const deployMocksAndTokens: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy, log } = hre.deployments;
const chainId = await hre.getChainId();

const BASE_FEE = "250000000000000000"; // 0.25 is this the premium in LINK?
const GAS_PRICE_LINK = 1e9; // link per gas, is this the gas lane? // 0.000000001 LINK per gas

// Deploy VRFCoordinatorV2Mock on local networks
if (chainId === "31337") {
log("Local network detected! Deploying mocks...");

await deploy("VRFCoordinatorV2Mock", {
from: deployer,
log: true,
args: [BASE_FEE, GAS_PRICE_LINK], // Add the appropriate constructor arguments if needed
autoMine: true,
});

log("VRFCoordinatorV2Mock Deployed!");
log("------------------------------------------------");
}

// Example token deployment, adjust as necessary
await deploy("USDT", {
from: deployer,
args: [],
log: true,
autoMine: true,
});

await deploy("WETH", {
from: deployer,
args: [],
log: true,
autoMine: true,
});

const USDT = await hre.ethers.getContract("USDT", deployer);
const WETH = await hre.ethers.getContract("WETH", deployer);

await deploy("UniswapV2Pair", {
from: deployer,
args: [USDT.target, WETH.target],
log: true,
autoMine: true,
});

await deploy("Vyper_contract", {
from: deployer,
args: [USDT.target],
log: true,
autoMine: true,
});

// Additional deployment logic...
// const { deployer } = await hre.getNamedAccounts();
// const { deploy, log } = hre.deployments;
// const chainId = await hre.getChainId();
hre;

// const BASE_FEE = "250000000000000000"; // 0.25 is this the premium in LINK?
// const GAS_PRICE_LINK = 1e9; // link per gas, is this the gas lane? // 0.000000001 LINK per gas

// // Deploy VRFCoordinatorV2Mock on local networks
// if (chainId === "31337") {
// log("Local network detected! Deploying mocks...");

// await deploy("VRFCoordinatorV2Mock", {
// from: deployer,
// log: true,
// args: [BASE_FEE, GAS_PRICE_LINK], // Add the appropriate constructor arguments if needed
// autoMine: true,
// });

// log("VRFCoordinatorV2Mock Deployed!");
// log("------------------------------------------------");
// }

// // Example token deployment, adjust as necessary
// await deploy("USDT", {
// from: deployer,
// args: [],
// log: true,
// autoMine: true,
// });

// await deploy("WETH", {
// from: deployer,
// args: [],
// log: true,
// autoMine: true,
// });

// const USDT = await hre.ethers.getContract("USDT", deployer);
// const WETH = await hre.ethers.getContract("WETH", deployer);

// await deploy("UniswapV2Pair", {
// from: deployer,
// args: [USDT.target, WETH.target],
// log: true,
// autoMine: true,
// });

// await deploy("Vyper_contract", {
// from: deployer,
// args: [USDT.target],
// log: true,
// autoMine: true,
// });

// // Additional deployment logic...
};

export default deployMocksAndTokens;
Expand Down
18 changes: 9 additions & 9 deletions packages/hardhat/deploy/01_deploy_your_contract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { Contract } from "ethers";
//import { Contract } from "ethers";

/**
* Deploys a contract named "YourContract" using the deployer account and
Expand All @@ -21,9 +21,9 @@ const deployContracts: DeployFunction = async function (hre: HardhatRuntimeEnvir
*/
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;
const UniswapV2Pair = await hre.ethers.getContract<Contract>("UniswapV2Pair", deployer);
const Vyper_contract = await hre.ethers.getContract<Contract>("Vyper_contract", deployer); // yearn
const vrf = await hre.ethers.getContract<Contract>("VRFCoordinatorV2Mock", deployer);
// const UniswapV2Pair = await hre.ethers.getContract<Contract>("UniswapV2Pair", deployer);
// const Vyper_contract = await hre.ethers.getContract<Contract>("Vyper_contract", deployer); // yearn
// const vrf = await hre.ethers.getContract<Contract>("VRFCoordinatorV2Mock", deployer);

// await deploy("VRFConsumerBaseV2Upgradeable", {
// from: deployer,
Expand All @@ -45,13 +45,13 @@ const deployContracts: DeployFunction = async function (hre: HardhatRuntimeEnvir
autoMine: true,
});

// const implementation = await hre.ethers.getContract<Contract>("Tournament", deployer);
const frontBurner = "0x7D64289652C768b56A9Efa7eEc7cb4133c8317e2"; //@note this is where you need to add your burnner address
//const implementation = await hre.ethers.getContract<Contract>("Tournament", deployer);
const frontBurner = "0xCd3C672770495EC50013E40AEd66DBD755BbC584"; //@note this is where you need to add your burnner address

await deploy("TournamentFactory", {
from: deployer,
// Contract constructor arguments
args: [frontBurner, vrf.target],
args: [frontBurner, "0x7a1BaC17Ccc5b313516C5E16fb24f7659aA5ebed"],
log: true,
// autoMine: can be passed to the deploy function to make the deployment process faster on local networks by
// automatically mining the contract deployment transaction. There is no effect on live networks.
Expand All @@ -60,8 +60,8 @@ const deployContracts: DeployFunction = async function (hre: HardhatRuntimeEnvir

// Get the deployed contract to interact with it after deploying.

await UniswapV2Pair.transfer(frontBurner, hre.ethers.parseEther("1000"));
await Vyper_contract.transfer(frontBurner, hre.ethers.parseEther("1000"));
// await UniswapV2Pair.transfer(frontBurner, hre.ethers.parseEther("1000"));
// await Vyper_contract.transfer(frontBurner, hre.ethers.parseEther("1000"));
};

export default deployContracts;
Expand Down
1 change: 1 addition & 0 deletions packages/hardhat/deployments/goerli/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
Loading

0 comments on commit 4985edb

Please sign in to comment.