Skip to content

Commit

Permalink
Create 2_deploy_contracts.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jun 16, 2024
1 parent 5c51c00 commit 3135b7f
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const { deployer, web3 } = require('@openzeppelin/truffle-deployer');

module.exports = async function(deployer) {
// Initialize the deployer
await deployer.initialize();

// Create a new migration
const migration = await deployer.createMigration('2_deploy_contracts');

// Set the network ID
const networkId = await web3.eth.net.getId();

// Set the gas price
const gasPrice = await web3.eth.getGasPrice();

// Set the gas limit
const gasLimit = 8000000;

// Deploy the contracts
await deployer.deploy([
{
contract: 'PIBankAccessControl',
args: [],
gas: gasLimit,
gasPrice: gasPrice,
},
{
contract: 'PIBank Gamification',
args: [],
gas: gasLimit,
gasPrice: gasPrice,
},
{
contract: 'PIBankRegulatoryCompliance',
args: [],
gas: gasLimit,
gasPrice: gasPrice,
},
]);

// Link the contracts
await deployer.link('PIBankAccessControl', 'PIBank');
await deployer.link('PIBankGamification', 'PIBank');
await deployer.link('PIBankRegulatoryCompliance', 'PIBank');

// Save the migration
await migration.save();
};

0 comments on commit 3135b7f

Please sign in to comment.