diff --git a/.gitignore b/.gitignore index 8cae864..0f6f889 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ PredToken.sol BEP20.sol .env .env.development -.env.production \ No newline at end of file +.env.production +.env.staging \ No newline at end of file diff --git a/.openzeppelin/unknown-56.json b/.openzeppelin/unknown-56.json index 2f0fd66..7ef2511 100644 --- a/.openzeppelin/unknown-56.json +++ b/.openzeppelin/unknown-56.json @@ -30,6 +30,16 @@ "address": "0x5D83EF52661Baa67c9a7d60BF61b8339622603B6", "txHash": "0x2f7023960034bb5cef7906cbd3c0f7c1e1eeebf089910d1ff8aa8f5d3ccc92d3", "kind": "uups" + }, + { + "address": "0xDe3a1Ab5a741819d672B3b24Ba2F1154179CF0B1", + "txHash": "0x9069923a4767d2173ac4859ad2e77b3143e52e259b85fd7aec7402a0e9dd3bf2", + "kind": "uups" + }, + { + "address": "0xf7D256f46593c4695D11858d8D4089417652A86f", + "txHash": "0x6cd170d93abfa15f7feb4b25d85eae9fbc5e07e69898395c82691dd057b25409", + "kind": "uups" } ], "impls": { diff --git a/scripts/deploy.testnet.ts b/scripts/deploy.testnet.ts deleted file mode 100644 index fbf5903..0000000 --- a/scripts/deploy.testnet.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ethers, upgrades } from "hardhat" - -async function main() { - // We get the contract to deploy - const predAddress = process.env.PRED_ADDRESS; - const operator = process.env.OPERATOR; - const predPerBlock = 3750000000; - const bnbPerBlock = 10000000; - - const Wallet = await ethers.getContractFactory("PredictionWallet") - const wallet = await Wallet.deploy(predAddress); - const LoserFarm = await ethers.getContractFactory("LoserPredictionPool"); - const WinnerFarm = await ethers.getContractFactory("WinnerPredictionPool"); - const loserFarm = await upgrades.deployProxy(LoserFarm, [operator, predAddress, bnbPerBlock, 0, ethers.utils.parseEther("100"), wallet.address, - process.env.PREDICTION_CONTRACT_ADDRESS], {kind: "uups"}) - const winnerFarm = await upgrades.deployProxy(WinnerFarm, [operator, predAddress, predPerBlock, 0, ethers.utils.parseEther("100"), wallet.address, - process.env.PREDICTION_CONTRACT_ADDRESS], {kind: "uups"}) - await wallet.grantRole(ethers.utils.formatBytes32String("loserPredictionPool"), loserFarm.address); - await wallet.grantRole(ethers.utils.formatBytes32String("winnerPredictionPool"), winnerFarm.address); - - console.log(`LoserPredictionPool deployed to: ${loserFarm.address} - WinnerPrediction Pool deployed to: ${winnerFarm.address} - Wallet deployed to: ${wallet.address}`); -}; - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); - }); diff --git a/scripts/deployPool.mainnet.ts b/scripts/deployLoserPool.ts similarity index 100% rename from scripts/deployPool.mainnet.ts rename to scripts/deployLoserPool.ts diff --git a/scripts/deployPool.ts b/scripts/deployPool.ts deleted file mode 100644 index 7166afd..0000000 --- a/scripts/deployPool.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { ethers, upgrades } from "hardhat" - -async function main() { - // We get the contract to deploy - const predAddress = process.env.PRED_ADDRESS; - const operator = process.env.OPERATOR; - const predPerBlock = 3750000000; - const bnbPerBlock = 50000000000; - - const wallet = await ethers.getContractAt( - "PredictionWallet", - process.env.WALLET_ADDRESS || "", - ); - - const LoserFarm = await ethers.getContractFactory("LoserPredictionPool"); - - const loserFarm = await upgrades.deployProxy(LoserFarm, [operator, predAddress, - process.env.BID_ADDRESS, - bnbPerBlock, 0, ethers.utils.parseEther("500"), wallet.address, - process.env.PREDICTION_CONTRACT_ADDRESS], {kind: "uups"}); - - await wallet.grantRole(ethers.utils.formatBytes32String("winnerPredictionPool"), loserFarm.address); - - console.log(`LoserPredictionPool deployed to: ${loserFarm.address}`); -}; - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); - }); diff --git a/scripts/deployWallet.ts b/scripts/deployWallet.ts new file mode 100644 index 0000000..7bb840d --- /dev/null +++ b/scripts/deployWallet.ts @@ -0,0 +1,14 @@ +import { ethers } from "hardhat" + +async function main() { + const predAddress = process.env.PRED_ADDRESS; + const Wallet = await ethers.getContractFactory("PredictionWallet") + await Wallet.deploy(predAddress); +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/scripts/deploy.mainnet.ts b/scripts/deployWinnerPool.ts similarity index 59% rename from scripts/deploy.mainnet.ts rename to scripts/deployWinnerPool.ts index 304a86d..c8c414e 100644 --- a/scripts/deploy.mainnet.ts +++ b/scripts/deployWinnerPool.ts @@ -5,21 +5,18 @@ async function main() { const predAddress = process.env.PRED_ADDRESS; const operator = process.env.OPERATOR; const predPerBlock = 3750000000; - const bnbPerBlock = 10000000; - const Wallet = await ethers.getContractFactory("PredictionWallet") - const wallet = await Wallet.deploy(predAddress); - const LoserFarm = await ethers.getContractFactory("LoserPredictionPool"); + const wallet = await ethers.getContractAt( + "PredictionWallet", + process.env.WALLET_ADDRESS || "", + ); + const WinnerFarm = await ethers.getContractFactory("WinnerPredictionPool"); - const loserFarm = await upgrades.deployProxy(LoserFarm, [operator, predAddress, bnbPerBlock, 0, ethers.utils.parseEther("100"), wallet.address, - process.env.PREDICTION_CONTRACT_ADDRESS], {kind: "uups"}) const winnerFarm = await upgrades.deployProxy(WinnerFarm, [operator, predAddress, predPerBlock, 0, ethers.utils.parseEther("100"), wallet.address, process.env.PREDICTION_CONTRACT_ADDRESS], {kind: "uups"}) - await wallet.grantRole(ethers.utils.formatBytes32String("loserPredictionPool"), loserFarm.address); await wallet.grantRole(ethers.utils.formatBytes32String("winnerPredictionPool"), winnerFarm.address); console.log(` - LoserPredictionPool deployed to: ${loserFarm.address} WinnerPrediction Pool deployed to: ${winnerFarm.address} Wallet deployed to: ${wallet.address}`); };