Skip to content

Commit

Permalink
Merge pull request #118 from OriginTrail/fix/dependencies
Browse files Browse the repository at this point in the history
Fix/dependencies
  • Loading branch information
u-hubar authored Mar 21, 2023
2 parents ea17e7e + 26f606b commit f343ec5
Show file tree
Hide file tree
Showing 5 changed files with 1,128 additions and 2,151 deletions.
217 changes: 83 additions & 134 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dotenv/config';
import 'hardhat-abi-exporter';
import 'hardhat-deploy';
import 'hardhat-deploy-ethers';
Expand All @@ -10,156 +9,106 @@ import '@typechain/hardhat';
import '@nomicfoundation/hardhat-chai-matchers';
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-solhint';
import { HardhatUserConfig, extendEnvironment } from 'hardhat/config';
import { extendEnvironment } from 'hardhat/config';
import { lazyObject } from 'hardhat/plugins';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

import './tasks/address_converter';
import './utils/type-extensions';
import config from './hardhat.node.config';
import { Helpers } from './utils/helpers';
import { accounts, rpc } from './utils/network';

extendEnvironment((hre: HardhatRuntimeEnvironment) => {
hre.helpers = lazyObject(() => new Helpers(hre));
});

const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
namedAccounts: {
deployer: 0,
minter: 0,
config.networks = {
...config.networks,
otp_alphanet: {
chainId: 2043,
url: rpc('otp_alphanet'),
gas: 12_000_000, // Gas limit used for deployments
gasPrice: 1_000_000,
accounts: accounts('otp_alphanet'),
saveDeployments: false,
},
networks: {
localhost: {
url: rpc('localhost'),
accounts: accounts('localhost'),
saveDeployments: false,
},
hardhat: {
chainId: 31337,
gas: 6_000_000,
gasMultiplier: 1,
blockGasLimit: 30_000_000,
hardfork: 'merge',
throwOnTransactionFailures: true,
throwOnCallFailures: true,
loggingEnabled: false,
allowUnlimitedContractSize: false,
saveDeployments: false,
mining: {
auto: true,
interval: [3000, 5000],
},
},
otp_alphanet: {
chainId: 2043,
url: rpc('otp_alphanet'),
gas: 12_000_000, // Gas limit used for deployments
gasPrice: 1_000_000,
accounts: accounts('otp_alphanet'),
saveDeployments: false,
},
otp_devnet: {
chainId: 2160,
url: rpc('otp_devnet'),
gas: 10_000_000, // Gas limit used for deployments
gasPrice: 1_000_000,
accounts: accounts('otp_devnet'),
saveDeployments: false,
},
otp_testnet: {
chainId: 20430,
url: rpc('otp_testnet'),
gas: 10_000_000, // Gas limit used for deploys
gasPrice: 20,
accounts: accounts('otp_testnet'),
saveDeployments: false,
},
otp_mainnet: {
chainId: 2043,
url: rpc('otp_mainnet'),
gas: 10_000_000, // Gas limit used for deploys
gasPrice: 10,
accounts: accounts('otp_mainnet'),
saveDeployments: false,
},
otp_devnet: {
chainId: 2160,
url: rpc('otp_devnet'),
gas: 10_000_000, // Gas limit used for deployments
gasPrice: 1_000_000,
accounts: accounts('otp_devnet'),
saveDeployments: false,
},
solidity: {
version: '0.8.16',
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
peephole: true,
inliner: true,
jumpdestRemover: true,
orderLiterals: true,
deduplicate: true,
cse: true,
constantOptimizer: true,
yul: true,
yulDetails: {
stackAllocation: true,
},
},
},
viaIR: process.env.COVERAGE_REPORT ? false : true,
},
otp_testnet: {
chainId: 20430,
url: rpc('otp_testnet'),
gas: 10_000_000, // Gas limit used for deploys
gasPrice: 20,
accounts: accounts('otp_testnet'),
saveDeployments: false,
},
paths: {
sources: './contracts',
tests: './test',
cache: './cache',
artifacts: './artifacts',
otp_mainnet: {
chainId: 2043,
url: rpc('otp_mainnet'),
gas: 10_000_000, // Gas limit used for deploys
gasPrice: 10,
accounts: accounts('otp_mainnet'),
saveDeployments: false,
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5',
},
mocha: {
reporterOptions: {
excludeContracts: [],
},
},
abiExporter: {
path: './abi',
runOnCompile: true,
clear: true,
flat: true,
only: [],
except: [
'AccessControl.sol',
'ERC20.sol',
'ERC20Burnable.sol',
'ERC165.sol',
'ERC721.sol',
'GeneralErrors.sol',
'IERC20Metadata.sol',
'IERC721.sol',
'IERC721Metadata.sol',
'IERC721Receiver.sol',
'IERC734Extended.sol',
'Ownable.sol',
'ContentAssetErrors.sol',
'ServiceAgreementErrorsV1.sol',
'ServiceAgreementErrorsV1U1.sol',
'Shares.sol',
],
spacing: 2,
format: 'json',
},
gasReporter: {
enabled: process.env.GAS_REPORT ? true : false,
},
contractSizer: {
alphaSort: true,
runOnCompile: false,
disambiguatePaths: false,
strict: false,
only: [],
except: [],
};

config.typechain = {
outDir: 'typechain',
target: 'ethers-v5',
};

config.mocha = {
reporterOptions: {
excludeContracts: [],
},
};

config.abiExporter = {
path: './abi',
runOnCompile: true,
clear: true,
flat: true,
only: [],
except: [
'AccessControl.sol',
'ERC20.sol',
'ERC20Burnable.sol',
'ERC165.sol',
'ERC721.sol',
'GeneralErrors.sol',
'IERC20Metadata.sol',
'IERC721.sol',
'IERC721Metadata.sol',
'IERC721Receiver.sol',
'IERC734Extended.sol',
'Ownable.sol',
'ContentAssetErrors.sol',
'ServiceAgreementErrorsV1.sol',
'ServiceAgreementErrorsV1U1.sol',
'Shares.sol',
],
spacing: 2,
format: 'json',
};

config.gasReporter = {
enabled: process.env.GAS_REPORT ? true : false,
};

config.contractSizer = {
alphaSort: true,
runOnCompile: false,
disambiguatePaths: false,
strict: false,
only: [],
except: [],
};

export default config;
74 changes: 74 additions & 0 deletions hardhat.node.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import 'hardhat-deploy';
import 'hardhat-deploy-ethers';
import { HardhatUserConfig, extendEnvironment } from 'hardhat/config';
import { lazyObject } from 'hardhat/plugins';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

import { Helpers } from './utils/helpers';
import { accounts, rpc } from './utils/network';

extendEnvironment((hre: HardhatRuntimeEnvironment) => {
hre.helpers = lazyObject(() => new Helpers(hre));
});

const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
namedAccounts: {
deployer: 0,
minter: 0,
},
networks: {
localhost: {
url: rpc('localhost'),
accounts: accounts('localhost'),
saveDeployments: false,
},
hardhat: {
chainId: 31337,
gas: 6_000_000,
gasMultiplier: 1,
blockGasLimit: 30_000_000,
hardfork: 'merge',
throwOnTransactionFailures: true,
throwOnCallFailures: true,
loggingEnabled: false,
allowUnlimitedContractSize: false,
saveDeployments: false,
mining: {
auto: true,
interval: [3000, 5000],
},
},
},
solidity: {
version: '0.8.16',
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
peephole: true,
inliner: true,
jumpdestRemover: true,
orderLiterals: true,
deduplicate: true,
cse: true,
constantOptimizer: true,
yul: true,
yulDetails: {
stackAllocation: true,
},
},
},
viaIR: process.env.COVERAGE_REPORT ? false : true,
},
},
paths: {
sources: './contracts',
tests: './test',
cache: './cache',
artifacts: './artifacts',
},
};

export default config;
Loading

0 comments on commit f343ec5

Please sign in to comment.