Skip to content

Commit d322d8f

Browse files
committed
add basic token deploy on zksync and scripts
1 parent f0185f3 commit d322d8f

7 files changed

Lines changed: 60 additions & 88 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#Hardhat files
22
cache
33
artifacts
4+
cache-zk
5+
artifacts-zk
46
node_modules
57
build
68

contracts/mock/BasicToken.sol

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity 0.6.12;
3+
4+
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
5+
6+
contract BasicToken is ERC20 {
7+
constructor(
8+
string memory _name,
9+
string memory _symbol
10+
) public ERC20(_name, _symbol) {
11+
_mint(msg.sender, 1e9 ether);
12+
}
13+
14+
function give(address receiver, uint256 amount ) external {
15+
_mint(receiver, amount);
16+
}
17+
}

deploy/1_deployDmm.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

deploy/deployClassic.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Wallet, utils } from "zksync-web3";
2+
import * as ethers from "ethers";
3+
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
4+
import * as dotenv from 'dotenv';
5+
dotenv.config();
6+
7+
task('deployClassic', 'deploy classic sc')
8+
.setAction(async (taskArgs, hre) => {
9+
console.log(`Running deploy script zkSync Era`);
10+
const wallet = new Wallet(process.env.PRIVATE_KEY);
11+
const deployer = new Deployer(hre, wallet);
12+
13+
let admin = '0x96202931a23e5349f88D7bCF422AA3e4B811C758';
14+
let USDC = '0xB1fe0a5788596CE7e868916873C7D5219bD605Fd';
15+
let USDT = '0x1a928903A57e8b57243b8E6A0Aa751935451a618';
16+
17+
const KyberFairLaunchV3 = await deployer.loadArtifact("KyberFairLaunchV3");
18+
19+
let sc = await deployer.deploy(KyberFairLaunchV3, [admin, [USDC, USDT]]);
20+
console.log(`KyberFairLaunchV3 was deployed at ${sc.address}`);
21+
});

hardhat.config.js

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ module.exports = {
162162
tests: './test',
163163
},
164164
zksolc: {
165-
version: '1.2.0',
165+
version: '1.3.10',
166166
compilerSource: 'binary',
167167
settings: {
168168

@@ -175,27 +175,6 @@ const PRIVATE_KEY = process.env.PRIVATE_KEY;
175175
const MATIC_VIGIL_KEY = process.env.MATIC_VIGIL_KEY;
176176

177177
if (INFURA_API_KEY != undefined && PRIVATE_KEY != undefined) {
178-
module.exports.networks.kovan = {
179-
url: `https://kovan.infura.io/v3/${INFURA_API_KEY}`,
180-
accounts: [PRIVATE_KEY],
181-
timeout: 20000,
182-
zksync: false,
183-
};
184-
185-
module.exports.networks.rinkeby = {
186-
url: `https://rinkeby.infura.io/v3/${INFURA_API_KEY}`,
187-
accounts: [PRIVATE_KEY],
188-
timeout: 20000,
189-
zksync: false,
190-
};
191-
192-
module.exports.networks.ropsten = {
193-
url: `https://ropsten.infura.io/v3/${INFURA_API_KEY}`,
194-
accounts: [PRIVATE_KEY],
195-
timeout: 20000,
196-
zksync: false,
197-
};
198-
199178
module.exports.networks.mainnet = {
200179
url: `https://mainnet.infura.io/v3/${INFURA_API_KEY}`,
201180
accounts: [PRIVATE_KEY],
@@ -266,12 +245,13 @@ module.exports.networks.zkSyncTestnet = {
266245
ethNetwork: 'goerli',
267246
zksync: true,
268247
verifyURL: 'https://zksync2-testnet-explorer.zksync.dev/contract_verification',
269-
},
248+
};
249+
270250
module.exports.networks.zkSyncMainnet = {
271251
url: "https://mainnet.era.zksync.io",
272252
ethNetwork: "mainnet",
273253
zksync: true
274-
}
254+
};
275255

276256
if (process.env.ETHERSCAN_API_KEY != undefined) {
277257
module.exports.etherscan = {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
"@ethersproject/web": "^5.7.1",
4141
"@matterlabs/hardhat-zksync-chai-matchers": "^0.1.2",
4242
"@matterlabs/hardhat-zksync-deploy": "^0.6.3",
43-
"@matterlabs/hardhat-zksync-solc": "^0.3.16",
43+
"@matterlabs/hardhat-zksync-solc": "^0.3.17",
4444
"@matterlabs/hardhat-zksync-toolbox": "^0.1.1",
45-
"@matterlabs/hardhat-zksync-verify": "^0.1.5",
45+
"@matterlabs/hardhat-zksync-verify": "^0.1.6",
4646
"@matterlabs/hardhat-zksync-vyper": "^0.1.8",
4747
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
4848
"@nomiclabs/hardhat-ethers": "^2.2.3",

yarn.lock

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -585,19 +585,10 @@
585585
dependencies:
586586
chalk "4.1.2"
587587

588-
"@matterlabs/hardhat-zksync-solc@0.3.14":
589-
version "0.3.14"
590-
resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.3.14.tgz#0a32f01b4cd8631ecd8dfe0547e3ac49ab8290d5"
591-
integrity sha512-iKuQ+vvnpv3K2lkFO41xpJcNWH0KHJ/5JbOboTlPZATVR7F3GJeHfJL+GG4wkxKXnxZczpxyQqC4rAfMKvRaDg==
592-
dependencies:
593-
"@nomiclabs/hardhat-docker" "^2.0.0"
594-
chalk "4.1.2"
595-
dockerode "^3.3.4"
596-
597-
"@matterlabs/hardhat-zksync-solc@^0.3.16":
598-
version "0.3.16"
599-
resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.3.16.tgz#dd8ed44f1a580f282794a15fee995f418b040158"
600-
integrity sha512-gw46yyiCfj49I/nbUcOlnF5xE80WyeW/i8i9ouHom4KWJNt1kioQIwOPkN7aJURhXpJJxKSdeWBrQHLWTZDnTA==
588+
"@matterlabs/hardhat-zksync-solc@0.3.17", "@matterlabs/hardhat-zksync-solc@^0.3.17":
589+
version "0.3.17"
590+
resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-0.3.17.tgz#72f199544dc89b268d7bfc06d022a311042752fd"
591+
integrity sha512-aZgQ0yfXW5xPkfuEH1d44ncWV4T2LzKZd0VVPo4PL5cUrYs2/II1FaEDp5zsf3FxOR1xT3mBsjuSrtJkk4AL8Q==
601592
dependencies:
602593
"@nomiclabs/hardhat-docker" "^2.0.0"
603594
chalk "4.1.2"
@@ -608,13 +599,13 @@
608599
resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-toolbox/-/hardhat-zksync-toolbox-0.1.1.tgz#723f20111035f031627bff01482cb3bf9eaee7f8"
609600
integrity sha512-722AIJqLUsTJ7rKca4TbdYlLvRMKh4Ql3TKfLe5vh/kDrGUs5FfPH3+KgBs24hbwijMEcDKT5eL1taIIcRkRmQ==
610601

611-
"@matterlabs/hardhat-zksync-verify@^0.1.5":
612-
version "0.1.5"
613-
resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-verify/-/hardhat-zksync-verify-0.1.5.tgz#300a03d5533581a8cca775cc7a7968b22e8a2d62"
614-
integrity sha512-o79DsXaEfa4ou4z07KLhCVOk4vX593QZME5cNq1wDD4DG3+ZYAjxwqplCpLhUmSSVjUKAVRGfEfqvuRMcvis2w==
602+
"@matterlabs/hardhat-zksync-verify@^0.1.6":
603+
version "0.1.6"
604+
resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-verify/-/hardhat-zksync-verify-0.1.6.tgz#c6f5cc4c414e60bbf8685c9eafdf3dd9ecdd2f10"
605+
integrity sha512-Il/VzFXS7QQ2M19/hf3POfBYtNbTzZXTZWa8EYzTWViMdanVYKPSAy7ZMwfB1CVBqrPwZUgGEmvdkpkLPr5+pQ==
615606
dependencies:
616-
"@matterlabs/hardhat-zksync-solc" "0.3.14"
617-
axios "^1.3.4"
607+
"@matterlabs/hardhat-zksync-solc" "0.3.17"
608+
axios "^1.3.6"
618609
chalk "4.1.2"
619610
dockerode "^3.3.4"
620611

@@ -1780,10 +1771,10 @@ aws4@^1.8.0:
17801771
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.1.tgz#e1e82e4f3e999e2cfd61b161280d16a111f86428"
17811772
integrity sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==
17821773

1783-
axios@^1.3.4:
1784-
version "1.3.5"
1785-
resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.5.tgz#e07209b39a0d11848e3e341fa087acd71dadc542"
1786-
integrity sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw==
1774+
axios@^1.3.6:
1775+
version "1.4.0"
1776+
resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f"
1777+
integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==
17871778
dependencies:
17881779
follow-redirects "^1.15.0"
17891780
form-data "^4.0.0"

0 commit comments

Comments
 (0)