Skip to content

Commit

Permalink
add eth sending to deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
n00b21337 committed Apr 17, 2024
1 parent 1e2eac2 commit e599c29
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 13 additions & 1 deletion deploy/local/000_deploy_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ import { DeployFunction } from 'hardhat-deploy/types';

const func: DeployFunction = async function ({ deployments, getNamedAccounts, network, ethers }) {
const { deploy, log } = deployments;
const { deployer } = await getNamedAccounts();
const { deployer, deployer_si } = await getNamedAccounts();

log('----------------------------------------------------');
log('Deployer address at ', deployer);
log('----------------------------------------------------');

// Send ETH to S3 deployer if using localcluster and geth
const amountEth = ethers.utils.parseEther('10'); // 10 ETH
if (network.name == 'localcluster') {
await deployments.rawTx({
from: ethers.utils.getAddress(deployer_si),
to: ethers.utils.getAddress(deployer),
value: amountEth,
});
log('Sent ETH to S3 deployer from SI deployer');
log('----------------------------------------------------');
}

// Check if this is run on Cluster and is already using deployed token from Storage Incentive
const deployedToken = '0x6AAB14FE9cccd64A502d23842d916eB5321c26E7';
const code = await ethers.provider.getCode(deployedToken);
Expand Down
8 changes: 4 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ const config: HardhatUserConfig = {
hardhat: {
chainId: 12345,
accounts: [
// deployer 0x62cab2b3b55f341f10348720ca18063cdb779ad5
// deployer 0x77CbAdb1059dDC7334227e025fC940469f52FEd8
{
privateKey: '4663c222787e30c1994b59044aa5045377a6e79193a8ead88293926b535c722d',
privateKey: '0xb65c0589ad60bc9985f0b6eafe5dd480b7ad63f073a7e9625dd23466a0d1947d',
balance: '10000000000000000000000',
},
// deployer_2 0x77CbAdb1059dDC7334227e025fC940469f52FEd8
// deployer_SI 0x62cab2b3b55f341f10348720ca18063cdb779ad5
{
privateKey: '0xb65c0589ad60bc9985f0b6eafe5dd480b7ad63f073a7e9625dd23466a0d1947d',
privateKey: '4663c222787e30c1994b59044aa5045377a6e79193a8ead88293926b535c722d',
balance: '10000000000000000000000',
},
// admin 0x7E71bA1aB8AF3454a01CFafe358BEbb7691d02f8
Expand Down

0 comments on commit e599c29

Please sign in to comment.