Skip to content

Commit

Permalink
Create deploy_contracts.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 11, 2024
1 parent cf1772e commit 2052b4c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions pi-nexus-blockchain/migrations/deploy_cobtracts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { deployer, web3 } = require('@openzeppelin/truffle-deployer');
const { BN } = web3.utils;

const IdentityVerification = artifacts.require('IdentityVerification');
const UserRegistry = artifacts.require('UserRegistry');

module.exports = async (deployer) => {
// Set the gas price and gas limit for the deployment
const gasPrice = new BN('20000000000');
const gasLimit = new BN('5000000');

// Get the deployed instances of the contracts
const identityVerificationInstance = await IdentityVerification.deployed();
const userRegistryInstance = await UserRegistry.deployed();

// Set the address of the IdentityVerification contract in the UserRegistry contract
await userRegistryInstance.setIdentityVerificationAddress(identityVerificationInstance.address, {
from: deployer.accounts[0],
gas: gasLimit,
gasPrice: gasPrice,
});

// Set the address of the UserRegistry contract in the IdentityVerification contract
await identityVerificationInstance.setUserRegistryAddress(userRegistryInstance.address, {
from: deployer.accounts[0],
gas: gasLimit,
gasPrice: gasPrice,
});
};

0 comments on commit 2052b4c

Please sign in to comment.