-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
blockchain_integration/pi_network/contracts/PI-bank/migrations/2_deploy_contracts.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,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(); | ||
}; |