Skip to content

Commit

Permalink
fix syntax and compilation errors, chainlink errors not done
Browse files Browse the repository at this point in the history
  • Loading branch information
TForge1 committed Oct 14, 2024
1 parent 37dc86d commit 1bcbce8
Show file tree
Hide file tree
Showing 8 changed files with 803 additions and 204 deletions.
20 changes: 10 additions & 10 deletions config/base_sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"uniswapRouter": "0x2B480c63bDe7C764cadBaA8b181405D770728128",
"rootHash": "0xc86c16e17ceec4e4cfe6670bb0b509cd7d6b6e87a19745216fb21219a3886196",

"accessController": "0x1365FFDC0ef5c65CAb0B77A1d05eC3Dd853F2f35",
"addressProvider": "0x10B1d1e7b7E2D348D97a51f8116003ecd97548C5",
"airdrop": "0xBdB7c786B6c828380a6d5804527c54a5fE07F3e6",
"accessController": "0x0000000000000000000000000000000000000000",
"addressProvider": "0x0000000000000000000000000000000000000000",
"airdrop": "0x0000000000000000000000000000000000000000",
"daoFund": "0x0000000000000000000000000000000000000000",
"devFund": "0x755428C410C0FB7eb01B4a66C5aBcB72A25876Cb",
"entityForging": "0xde3AA9007FfE09b182540e0EACa1C7a46C7AC329",
"entityTrading": "0x269e4FCC486C43bA32bD19295E466ecAc1d3Fb53",
"entropyGenerator": "0xCC955E75d9774d87062c55eB07ccE71B061D3079",
"nukeFund": "0xE5B758aA0238763aA4E73d9A3aF1ee3e30950360",
"trait": "0xAA23bCe2fB0e284Dbc871200c5c7FF846D9Eda86",
"traitForgeNft": "0x64Cf499636805C261D6B9BAa1685f4A89c2A4692"
"devFund": "0x0000000000000000000000000000000000000000",
"entityForging": "0x0000000000000000000000000000000000000000",
"entityTrading": "0x0000000000000000000000000000000000000000",
"entropyGenerator": "0x0000000000000000000000000000000000000000",
"nukeFund": "0x0000000000000000000000000000000000000000",
"trait": "0x0000000000000000000000000000000000000000",
"traitForgeNft": "0x0000000000000000000000000000000000000000"
}
307 changes: 151 additions & 156 deletions contracts/LottFund.sol

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions contracts/NukeRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,4 @@ contract FundRouter {
}


// Fallback for any unintended direct transfers
fallback() external payable {
receive(); // Same logic as receive()
}


}
9 changes: 1 addition & 8 deletions contracts/interfaces/ILottFund.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
pragma solidity ^0.8.20;

interface ILottFund {
// Structs
struct RequestStatus {
bool fulfilled; // whether the request has been successfully fulfilled
bool exists; // whether a requestId exists
uint256[] randomWords;
}

// Events
event RequestSent(uint256 requestId, uint32 numWords);
event RequestFulfilled(uint256 requestId, uint256[] randomWords);
Expand All @@ -31,7 +24,7 @@ interface ILottFund {
function setTaxCut(uint256 _taxCut) external;
function setMaxAllowedClaimDivisor(uint256 _divisor) external;
function setMaxBidsPerAddress(uint256 _limit) external;
function setAmountToWin(uint256 _amountToWin) external
function setAmountToWin(uint256 _amountToWin) external;
function setNukeFactorMaxParam(uint256 _nukeFactorMaxParam) external;
function setEthCollector(address _ethCollector) external;
function setNativePayment(bool isTrue) external;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"genMerkleTree": "npx hardhat run ./scripts/saveMerkleTreeToJson.ts"
},
"devDependencies": {
"@chainlink/contracts": "^1.2.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.3",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomicfoundation/hardhat-network-helpers": "^1.0.10",
Expand Down
19 changes: 6 additions & 13 deletions script/deployment/05_DeployNukeFund.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@ import { BaseScript } from "../Base.s.sol";
import { Roles } from "contracts/libraries/Roles.sol";
import { console } from "@forge-std/console.sol";

import { NukeFund } from "contracts/NukeFund.sol";
import { FundRouter } from "contracts/NukeRouter.sol";

contract DeployNukeFund is BaseScript {
contract DeployNukeRouter is BaseScript {
function run() public virtual initConfig broadcast {
if (ethCollector == address(0)) {
revert AddressIsZero();
}

if (addressProvider == address(0)) {
revert AddressProviderAddressIsZero();
}
address newNukeFundAddress = _deployNukeFund();
console.log("NukeFund deployed at address: ", newNukeFundAddress);
address newNukeRouterAddress = _deployFundRouter();
console.log("NukeRouter deployed at address: ", newNukeRouterAddress);
}

function _deployNukeFund() internal returns (address) {
return address(new NukeFund(addressProvider, ethCollector));
function _deployFundRouter() internal returns (address) {
return address(new FundRouter(nukeFund, lottFund));
}
}
14 changes: 14 additions & 0 deletions script/deployment/DeployAll.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { console } from "@forge-std/console.sol";
import { Airdrop } from "contracts/Airdrop.sol";
import { DevFund } from "contracts/DevFund.sol";
import { DAOFund } from "contracts/DAOFund.sol";
import { FundRouter } from "contracts/NukeRouter.sol";
import { NukeFund } from "contracts/NukeFund.sol";
import { LottFund } from "contracts/LottFund.sol";
import { EntityForging } from "contracts/EntityForging.sol";
import { EntityTrading } from "contracts/EntityTrading.sol";
import { EntropyGenerator } from "contracts/EntropyGenerator.sol";
Expand All @@ -23,7 +25,9 @@ contract DeployAll is BaseScript {
address newAirdropAddress = _deployAirdrop();
address newDevFundAddress = _deployDevFund();
// address newDaoFundAddress = _deployDaoFund();
address newLottFundAddress = _deployLottFund();
address newNukeFundAddress = _deployNukeFund();
address newFundRouterAddress = _deployFundRouter();
address newEntityForgingAddress = _deployEntityForging();
address newEntityTradingAddress = _deployEntityTrading();
address newEntropyGeneratorAddress = _deployEntropyGenerator();
Expand All @@ -34,6 +38,8 @@ contract DeployAll is BaseScript {
console.log("DevFund deployed at address: ", newDevFundAddress);
// console.log("DAOFund deployed at address: ", newDaoFundAddress);
console.log("NukeFund deployed at address: ", newNukeFundAddress);
console.log("LottFund deployed at address: ", newLottFundAddress);
console.log("FundRouter deployed at address: ", newFundRouterAddress);
console.log("EntityForging deployed at address: ", newEntityForgingAddress);
console.log("EntityTrading deployed at address: ", newEntityTradingAddress);
console.log("EntropyGenerator deployed at address: ", newEntropyGeneratorAddress);
Expand All @@ -59,6 +65,14 @@ contract DeployAll is BaseScript {
return address(new NukeFund(addressProvider, ethCollector));
}

function _deployLottFund() internal returns (address) {
return address(new LottFund(addressProvider, ethCollector, nukeFund, 93583552556180380494622873604450265439540157164614218152369824305078161896524));
}

function _deployNukeRouter() internal returns (address) {
return address(new FundRouter(newNukeFundAddress, newLottFundAddress));
}

function _deployEntityForging() internal returns (address) {
return address(new EntityForging(addressProvider));
}
Expand Down
Loading

0 comments on commit 1bcbce8

Please sign in to comment.