Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another cl fix #175

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions deploy/local/000_deploy_factory.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
import { DeployFunction } from 'hardhat-deploy/types';

const func: DeployFunction = async function ({ deployments, getNamedAccounts, network, ethers }) {

Check warning on line 3 in deploy/local/000_deploy_factory.ts

View workflow job for this annotation

GitHub Actions / check

'network' is defined but never used
const { deploy, log } = deployments;
const { deployer, deployer_si } = await getNamedAccounts();
const { deployer } = 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
37 changes: 16 additions & 21 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import { HardhatUserConfig } from 'hardhat/types';
const PRIVATE_RPC_MAINNET: string | undefined = process.env.PRIVATE_RPC_MAINNET;
const PRIVATE_RPC_TESTNET: string | undefined = process.env.PRIVATE_RPC_TESTNET;

const walletSecret: string = process.env.WALLET_SECRET === undefined ? 'undefined' : process.env.WALLET_SECRET;
// We use WALLET_SECRET_2 because of collide with SI repo that uses WALLET_SECRET and we use both of them for cluster deployment
const walletSecret: string = process.env.WALLET_SECRET_2 === undefined ? 'undefined' : process.env.WALLET_SECRET_2;

if (walletSecret === 'undefined') {
console.log('Please set your WALLET_SECRET in a .env file');
console.log('Please set your WALLET_SECRET_2 in a .env file');
} else if (walletSecret.length !== 64) {
console.log('WALLET_SECRET must be 64 characters long.');
console.log('WALLET_SECRET_2 must be 64 characters long.');
}

const mainnetEtherscanKey: string | undefined = process.env.MAINNET_ETHERSCAN_KEY;
Expand All @@ -23,15 +24,6 @@ const accounts: string[] | { mnemonic: string } =
walletSecret.length === 64 ? [walletSecret] : { mnemonic: walletSecret };

const config: HardhatUserConfig = {
namedAccounts: {
deployer: 0,
deployer_si: 1,
admin: 2,
alice: 3,
bob: 4,
carol: 5,
other: 6,
},
defaultNetwork: 'hardhat',
solidity: {
compilers: [
Expand Down Expand Up @@ -62,19 +54,14 @@ const config: HardhatUserConfig = {
hardhat: {
chainId: 12345,
accounts: [
// deployer 0x77CbAdb1059dDC7334227e025fC940469f52FEd8
{
privateKey: '0xb65c0589ad60bc9985f0b6eafe5dd480b7ad63f073a7e9625dd23466a0d1947d',
balance: '10000000000000000000000',
},
// deployer_SI 0x62cab2b3b55f341f10348720ca18063cdb779ad5
// deployer 0x7E71bA1aB8AF3454a01CFafe358BEbb7691d02f8
{
privateKey: '4663c222787e30c1994b59044aa5045377a6e79193a8ead88293926b535c722d',
privateKey: '0x8d56d322a1bb1e94c7d64ccd62aa2e5cc9760f59575eda0f7fd392bab8d6ba0d',
balance: '10000000000000000000000',
},
// admin 0x7E71bA1aB8AF3454a01CFafe358BEbb7691d02f8
// admin 0x77CbAdb1059dDC7334227e025fC940469f52FEd8
{
privateKey: '0x8d56d322a1bb1e94c7d64ccd62aa2e5cc9760f59575eda0f7fd392bab8d6ba0d',
privateKey: '0xb65c0589ad60bc9985f0b6eafe5dd480b7ad63f073a7e9625dd23466a0d1947d',
balance: '10000000000000000000000',
},
// named1 0xFCA295bC36F47A3Eb53F657b88f3f324374656C6
Expand Down Expand Up @@ -157,6 +144,14 @@ const config: HardhatUserConfig = {
paths: {
sources: 'contracts',
},
namedAccounts: {
deployer: 0,
admin: 1,
alice: 2,
bob: 3,
carol: 4,
other: 5,
},
};

export default config;
Loading