-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
blockchain_integration/pi_network/deploy/deploy_governance.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |