Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment/zksync testnet #15

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WALLET_PRIVATE_KEY=
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
*.info
artifacts
cache
cache_hardhat
node_modules
out
zkout
.env
deployments-zk
artifacts-zk
cache_hardhat-zk
8 changes: 4 additions & 4 deletions contracts/KDAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;

import {LockedKDAO} from "./LockedKDAO.sol";
import {KDAOL} from "interfaces/Addresses.sol";
import {DEV_FUND, KDAOL, PROTOCOL_FUND, VOTING} from "interfaces/Addresses.sol";
import {KDAOL, PROTOCOL_FUND, VOTING} from "interfaces/Addresses.sol";
import {DistroStage, IDistroStage} from "interfaces/IDistroStage.sol";
import {IERC20, IERC20Permit} from "interfaces/IERC20Permit.sol";
import {IERC20Snapshot3} from "interfaces/IERC20Snapshot3.sol";
Expand Down Expand Up @@ -346,7 +346,7 @@ contract KDAO is IERC20Permit, IERC20Snapshot3, IDistroStage {
* @param newStage value to double check to prevent user error.
*/
function incrementDistroStage(DistroStage newStage) external {
require(msg.sender == DEV_FUND);
require(msg.sender == VOTING);
// Ensure the user provided round number matches, to prevent user error.
require(uint256(distroStage) + 1 == uint256(newStage));
// Make sure all minting has been done for the current stage
Expand Down Expand Up @@ -386,7 +386,7 @@ contract KDAO is IERC20Permit, IERC20Snapshot3, IDistroStage {
* followed by a 160-bits address.
*/
function mintTo(uint256 amountAccount) public {
require(msg.sender == DEV_FUND || (distroStage == DistroStage.Presale2 && msg.sender == presale2Contract));
require(msg.sender == VOTING || (distroStage == DistroStage.Presale2 && msg.sender == presale2Contract));
mint(amountAccount);
}

Expand Down Expand Up @@ -454,7 +454,7 @@ contract KDAO is IERC20Permit, IERC20Snapshot3, IDistroStage {
}

function setPresale2Contract(address addr) external {
require(msg.sender == DEV_FUND);
require(msg.sender == VOTING);
presale2Contract = addr;
}

Expand Down
12 changes: 11 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@ sort_imports = true

[profile.default]
src = 'contracts'
solc_version = "0.8.25"
solc_version = "0.8.24"
optimizer = true
optimizer_runs = 100_000
remappings = [
"forge-std/=lib/forge-std/src/",
"interfaces/=lib/interfaces/contracts/",
]

[profile.zksync]
src = 'contracts'
solc_version = "0.8.24"
optimizer = true
optimizer_runs = 100_000
remappings = [
"forge-std/=lib/forge-std/src/",
"interfaces/=lib/interfaces/contracts/",
]
34 changes: 34 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
require("@matterlabs/hardhat-zksync-deploy");
require("@matterlabs/hardhat-zksync-verify");
require("@matterlabs/hardhat-zksync-solc");
require("@nomicfoundation/hardhat-toolbox");
require("@nomicfoundation/hardhat-foundry");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
zksolc: {
version: "1.4.0", // Uses latest available in https://github.com/matter-labs/zksolc-bin/
settings: {},
},
solidity: {
version: "0.8.24",
eraVersion: "1.0.0", //optional. Compile contracts with EraVM compiler
},
defaultNetwork: "zkSyncTestnet",
networks: {
sepolia: {
url: "https://sepolia.infura.io/v3/<API_KEY>", // The Ethereum Web3 RPC URL (optional).
zksync: false, // disables zksolc compiler
},
zkSyncTestnet: {
url: "https://sepolia.era.zksync.dev", // The testnet RPC URL of zkSync Era network.
ethNetwork: "sepolia", // The Ethereum Web3 RPC URL, or the identifier of the network (e.g. `mainnet` or `sepolia`)
zksync: true, // enables zksolc compiler
verifyURL:
"https://explorer.sepolia.era.zksync.dev/contract_verification",
},
},
sourcify: {
enabled: true,
},
};
Loading
Loading