@reality.eth/contracts 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chains/chainid.network.local.json +25 -0
- package/chains/deployments/280/WETH/RealityETH_ERC20-3.0.json +8 -0
- package/chains/supported.json +6 -0
- package/generated/chains.json +19 -0
- package/generated/contracts.json +11 -0
- package/generated/tokens.json +7 -0
- package/non_standard_deployments/zksync2/README +21 -0
- package/non_standard_deployments/zksync2/contracts/RealityETH_ERC20-3.0.sol +1096 -0
- package/non_standard_deployments/zksync2/deploy/deploy.ts +53 -0
- package/non_standard_deployments/zksync2/hardhat.config.ts +30 -0
- package/non_standard_deployments/zksync2/package.json +15 -0
- package/non_standard_deployments/zksync2/yarn.lock +2907 -0
- package/package.json +2 -2
- package/tokens/WETH.json +7 -0
- package/scripts/send_funds.js +0 -52
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
import { utils, Wallet } from "zksync-web3";
|
|
3
|
+
import * as ethers from "ethers";
|
|
4
|
+
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
5
|
+
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
|
|
8
|
+
// An example of a deploy script that will deploy and call a simple contract.
|
|
9
|
+
export default async function (hre: HardhatRuntimeEnvironment) {
|
|
10
|
+
console.log(`Running deploy script for the reality.eth contract`);
|
|
11
|
+
|
|
12
|
+
const key_file = '/home/ed/secrets/zksync_goerli.sec';
|
|
13
|
+
const priv = fs.readFileSync(key_file, 'utf8').replace(/\n$/, "");
|
|
14
|
+
|
|
15
|
+
// Initialize the wallet.
|
|
16
|
+
const wallet = new Wallet(priv);
|
|
17
|
+
|
|
18
|
+
// Create deployer object and load the artifact of the contract we want to deploy.
|
|
19
|
+
const deployer = new Deployer(hre, wallet);
|
|
20
|
+
const artifact = await deployer.loadArtifact("RealityETH_ERC20_v3_0");
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
// Deposit some funds to L2 in order to be able to perform L2 transactions.
|
|
24
|
+
const depositAmount = ethers.utils.parseEther("0.00001");
|
|
25
|
+
const depositHandle = await deployer.zkWallet.deposit({
|
|
26
|
+
to: deployer.zkWallet.address,
|
|
27
|
+
token: utils.ETH_ADDRESS,
|
|
28
|
+
amount: depositAmount,
|
|
29
|
+
});
|
|
30
|
+
// Wait until the deposit is processed on zkSync
|
|
31
|
+
await depositHandle.wait();
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
// Deploy this contract. The returned object will be of a `Contract` type, similarly to ones in `ethers`.
|
|
35
|
+
const realityContract = await deployer.deploy(artifact, []);
|
|
36
|
+
|
|
37
|
+
// Show the contract info.
|
|
38
|
+
const contractAddress = realityContract.address;
|
|
39
|
+
console.log(`${artifact.contractName} was deployed to ${contractAddress}`);
|
|
40
|
+
|
|
41
|
+
// Edit the greeting of the contract
|
|
42
|
+
const token = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
|
|
43
|
+
const setTokenHandle = await realityContract.setToken(token);
|
|
44
|
+
await setTokenHandle.wait();
|
|
45
|
+
|
|
46
|
+
const tokenFromContract = await realityContract.token();
|
|
47
|
+
if (tokenFromContract == token) {
|
|
48
|
+
console.log(`Contract greets us with ${token}!`);
|
|
49
|
+
} else {
|
|
50
|
+
console.error(`Contract said something unexpected: ${tokenFromContract}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require("@matterlabs/hardhat-zksync-deploy");
|
|
2
|
+
require("@matterlabs/hardhat-zksync-solc");
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
zksolc: {
|
|
6
|
+
version: "0.1.0",
|
|
7
|
+
compilerSource: "docker",
|
|
8
|
+
settings: {
|
|
9
|
+
optimizer: {
|
|
10
|
+
enabled: true,
|
|
11
|
+
},
|
|
12
|
+
experimental: {
|
|
13
|
+
dockerImage: "matterlabs/zksolc",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
zkSyncDeploy: {
|
|
18
|
+
zkSyncNetwork: "https://zksync2-testnet.zksync.dev",
|
|
19
|
+
ethNetwork: "goerli", // Can also be the RPC URL of the network (e.g. `https://goerli.infura.io/v3/<API_KEY>`)
|
|
20
|
+
},
|
|
21
|
+
networks: {
|
|
22
|
+
// To compile with zksolc, this must be the default network.
|
|
23
|
+
hardhat: {
|
|
24
|
+
zksync: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
solidity: {
|
|
28
|
+
version: "0.8.10",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zksync2",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@matterlabs/hardhat-zksync-deploy": "^0.3.5",
|
|
8
|
+
"@matterlabs/hardhat-zksync-solc": "^0.3.5",
|
|
9
|
+
"ethers": "^5.6.9",
|
|
10
|
+
"hardhat": "^2.10.1",
|
|
11
|
+
"ts-node": "^10.9.1",
|
|
12
|
+
"typescript": "^4.7.4",
|
|
13
|
+
"zksync-web3": "^0.7.9"
|
|
14
|
+
}
|
|
15
|
+
}
|