Skip to content

Commit

Permalink
change accounts to use SI for localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
n00b21337 committed Mar 19, 2024
1 parent ca8ae3c commit 1377dc2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
7 changes: 4 additions & 3 deletions deploy/local/000_deploy_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,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 } = await getNamedAccounts();
const waitBlockConfirmations = network.name != 'testnet' ? 1 : 6;

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

// Check if this is run on Cluster and is already using deployed token from Storage Incentive
const deployedToken = "0x942C6684eB9874C63d4ed26Ab0623F951D253081";
const deployedToken = '0x942C6684eB9874C63d4ed26Ab0623F951D253081';
const code = await ethers.provider.getCode(deployedToken);
let tokenAddress;

Expand All @@ -31,7 +32,7 @@ const func: DeployFunction = async function ({ deployments, getNamedAccounts, ne
from: deployer,
args: deployArgs,
log: true,
waitConfirmations: waitBlockConfirmations,
waitConfirmations: 1,
});

log(`Factory deployed at address ${factory.address}`);
Expand Down
31 changes: 30 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ const accounts: string[] | { mnemonic: string } =
walletSecret.length === 64 ? [walletSecret] : { mnemonic: walletSecret };

const config: HardhatUserConfig = {
namedAccounts: {
deployer: 0,
admin: 1,
stamper: 2,
oracle: 3,
redistributor: 4,
pauser: 5,
node_0: 6,
node_1: 7,
node_2: 8,
node_3: 9,
node_4: 10,
node_5: 11,
node_6: 12,
node_7: 13,
},
defaultNetwork: 'hardhat',
solidity: {
compilers: [
Expand All @@ -47,11 +63,24 @@ const config: HardhatUserConfig = {
},
networks: {
hardhat: {
chainId: 12345,
accounts: [
// deployer 0x3c8F39EE625fCF97cB6ee22bCe25BE1F1E5A5dE8
{
privateKey: '0x0d8f0a76e88539c4ceaa6ad01372cce44fb621b56b34b2cc614b4c77fb081f20',
balance: '10000000000000000000000',
},
// admin 0x7E71bA1aB8AF3454a01CFafe358BEbb7691d02f8
{
privateKey: '0x8d56d322a1bb1e94c7d64ccd62aa2e5cc9760f59575eda0f7fd392bab8d6ba0d',
balance: '10000000000000000000000',
},
],
deploy: ['deploy/local/'],
},
localhost: {
url: 'http://localhost:8545',
accounts,
// accounts, if not defined uses the same as above hardhat
chainId: 12345,
deploy: ['deploy/local/'],
},
Expand Down
8 changes: 4 additions & 4 deletions test/swutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ function signTypedData(eip712data: any, signee: string): Promise<string> {
return signer._signTypedData(eip712data.domain, eip712data.types, eip712data.message);
}

// the chainId is set to 31337 which is the hardhat default
// the chainId is set to 12345 which is the hardhat default
async function signCheque(
swap: any,
beneficiary: string,
cumulativePayout: any,
signee: string,
chainId = 31337
chainId = 12345
): Promise<string> {
const cheque = {
chequebook: swap.address,
Expand Down Expand Up @@ -74,7 +74,7 @@ async function signCashOut(
beneficiaryAgent: string,
callerPayout: any,
signee: string,
chainId = 31337
chainId = 12345
): Promise<string> {
const eip712data = {
types: {
Expand Down Expand Up @@ -104,7 +104,7 @@ async function signCustomDecreaseTimeout(
beneficiary: string,
decreaseTimeout: any,
signee: string,
chainId = 31337
chainId = 12345
): Promise<string> {
const eip712data = {
types: {
Expand Down

0 comments on commit 1377dc2

Please sign in to comment.