Skip to content

Commit

Permalink
Create deploy_governance.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Nov 22, 2024
1 parent 286f742 commit fd71db8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions blockchain_integration/pi_network/deploy/deploy_governance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const Web3 = require('web3');
const Governance = require('../build/Governance.json');
const PiToken = require('../build/PiToken.json');

async function deploy() {
const web3 = new Web3('https://your.ethereum.node');
const accounts = await web3.eth.getAccounts();
const tokenAddress = '0x...'; // Replace with your token contract address
const governance = await new web3.eth.Contract(Governance.abi)
.deploy({ data: Governance.evm.bytecode.object, arguments: [tokenAddress] })
.send({ from: accounts[0], gas: '1000000' });
console.log(`Governance contract deployed at: ${governance.options.address}`);
}

deploy();

0 comments on commit fd71db8

Please sign in to comment.