-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathethers.js
24 lines (18 loc) · 913 Bytes
/
ethers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { ethers } = require("ethers");
const fs = require('fs');
// Setup your provider and wallet
const provider = new ethers.providers.JsonRpcProvider(YOUR_RPC_URL);
const wallet = new ethers.Wallet(YOUR_PRIVATE_KEY, provider);
// Load the compiled contract
const contractABI = JSON.parse(fs.readFileSync('./QuantumContractABI.json', 'utf8'));
const contractBytecode = fs.readFileSync('./QuantumContractBytecode.bin', 'utf8');
// Quantum result from Python
const quantumResult = YOUR_QUANTUM_RESULT; // Replace this with the result you obtained from the Python script
async function deploy() {
// Create a contract factory
const factory = new ethers.ContractFactory(contractABI, contractBytecode, wallet);
// Deploy the contract with the quantum result
const contract = await factory.deploy(quantumResult);
console.log(`Contract deployed at address: ${contract.address}`);
}
deploy();