Skip to content

Commit

Permalink
chore: use solc 0.8.22
Browse files Browse the repository at this point in the history
  • Loading branch information
artall64 committed Nov 7, 2023
1 parent 0c9d2bc commit d9dfe06
Show file tree
Hide file tree
Showing 8 changed files with 407 additions and 338 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"indent": [2, 4],
"quotes": [2, "single"],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"space-before-function-paren": ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}],
"no-use-before-define": 0,
"no-unused-expressions": "off",
"eqeqeq": [2, "smart"],
Expand Down
2 changes: 1 addition & 1 deletion contracts/AddressToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
\__| \__| \_______| \_______|\__| \_______|\_______/ \_______/ \__| \__|\__| \__|
*/

pragma solidity 0.8.20;
pragma solidity 0.8.22;

import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { IERC4906 } from "@openzeppelin/contracts/interfaces/IERC4906.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/AddressTokenMetadata.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity 0.8.22;

import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { IAddressTokenMetadata } from "./interfaces/IAddressTokenMetadata.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IAddressTokenMetadata.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity 0.8.22;

interface IAddressTokenMetadata {
function tokenJSON(uint256 tokenId) external pure returns(string memory);
Expand Down
8 changes: 7 additions & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@ require('solidity-coverage');

const { networks, etherscan } = require('./hardhat.networks');

function getNetwork() {
const index = process.argv.findIndex((arg) => arg === '--network') + 1;
return index !== 0 ? process.argv[index] : undefined;
}

module.exports = {
etherscan,
networks,
solidity: {
compilers: [
{
version: '0.8.20',
version: '0.8.22',
settings: {
optimizer: {
enabled: true,
runs: 1000000,
},
evmVersion: networks[getNetwork()]?.hardfork || 'shanghai',
viaIR: true,
},
},
Expand Down
31 changes: 16 additions & 15 deletions hardhat.networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const networks = {
};
const etherscan = { apiKey: {}, customChains: [] };

function register (name, chainId, url, privateKey, etherscanNetworkName, etherscanKey) {
function register(name, chainId, hardfork, url, privateKey, etherscanNetworkName, etherscanKey) {
if (url && privateKey && etherscanKey) {
networks[name] = {
url,
Expand All @@ -20,6 +20,7 @@ function register (name, chainId, url, privateKey, etherscanNetworkName, ethersc
},
chainId,
accounts: [privateKey],
hardfork,
};
etherscan.apiKey[etherscanNetworkName] = etherscanKey;
console.log(`Network '${name}' registered`);
Expand All @@ -28,25 +29,25 @@ function register (name, chainId, url, privateKey, etherscanNetworkName, ethersc
}
}

function registerCustom (name, chainId, url, privateKey, etherscanKey, apiURL, browserURL) {
function registerCustom(name, chainId, hardfork, url, privateKey, etherscanKey, apiURL, browserURL) {
if (url && privateKey && etherscanKey) {
register(name, chainId, url, privateKey, name, etherscanKey);
register(name, chainId, hardfork, url, privateKey, name, etherscanKey);
etherscan.customChains.push({ network: name, chainId, urls: { apiURL, browserURL } });
}
}

register('mainnet', 1, process.env.MAINNET_RPC_URL, process.env.MAINNET_PRIVATE_KEY, 'mainnet', process.env.MAINNET_ETHERSCAN_KEY);
register('bsc', 56, process.env.BSC_RPC_URL, process.env.BSC_PRIVATE_KEY, 'bsc', process.env.BSC_ETHERSCAN_KEY);
register('kovan', 42, process.env.KOVAN_RPC_URL, process.env.KOVAN_PRIVATE_KEY, 'kovan', process.env.KOVAN_ETHERSCAN_KEY);
register('optimistic', 10, process.env.OPTIMISTIC_RPC_URL, process.env.OPTIMISTIC_PRIVATE_KEY, 'optimisticEthereum', process.env.OPTIMISTIC_ETHERSCAN_KEY);
register('matic', 137, process.env.MATIC_RPC_URL, process.env.MATIC_PRIVATE_KEY, 'polygon', process.env.MATIC_ETHERSCAN_KEY);
register('arbitrum', 42161, process.env.ARBITRUM_RPC_URL, process.env.ARBITRUM_PRIVATE_KEY, 'arbitrumOne', process.env.ARBITRUM_ETHERSCAN_KEY);
register('xdai', 100, process.env.XDAI_RPC_URL, process.env.XDAI_PRIVATE_KEY, 'gnosis', process.env.XDAI_ETHERSCAN_KEY);
register('avax', 43114, process.env.AVAX_RPC_URL, process.env.AVAX_PRIVATE_KEY, 'avalanche', process.env.AVAX_ETHERSCAN_KEY);
register('fantom', 250, process.env.FANTOM_RPC_URL, process.env.FANTOM_PRIVATE_KEY, 'opera', process.env.FANTOM_ETHERSCAN_KEY);
register('aurora', 1313161554, process.env.AURORA_RPC_URL, process.env.AURORA_PRIVATE_KEY, 'aurora', process.env.AURORA_ETHERSCAN_KEY);
register('base', 8453, process.env.BASE_RPC_URL, process.env.BASE_PRIVATE_KEY, 'base', process.env.BASE_ETHERSCAN_KEY);
registerCustom('klaytn', 8217, process.env.KLAYTN_RPC_URL, process.env.KLAYTN_PRIVATE_KEY, process.env.KLAYTN_ETHERSCAN_KEY, 'https://scope.klaytn.com/', 'https://scope.klaytn.com/');
register('mainnet', 1, 'shanghai', process.env.MAINNET_RPC_URL, process.env.MAINNET_PRIVATE_KEY, 'mainnet', process.env.MAINNET_ETHERSCAN_KEY);
register('bsc', 56, 'paris', process.env.BSC_RPC_URL, process.env.BSC_PRIVATE_KEY, 'bsc', process.env.BSC_ETHERSCAN_KEY);
register('kovan', 42, 'paris', process.env.KOVAN_RPC_URL, process.env.KOVAN_PRIVATE_KEY, 'kovan', process.env.KOVAN_ETHERSCAN_KEY);
register('optimistic', 10, 'paris', process.env.OPTIMISTIC_RPC_URL, process.env.OPTIMISTIC_PRIVATE_KEY, 'optimisticEthereum', process.env.OPTIMISTIC_ETHERSCAN_KEY);
register('matic', 137, 'paris', process.env.MATIC_RPC_URL, process.env.MATIC_PRIVATE_KEY, 'polygon', process.env.MATIC_ETHERSCAN_KEY);
register('arbitrum', 42161, 'paris', process.env.ARBITRUM_RPC_URL, process.env.ARBITRUM_PRIVATE_KEY, 'arbitrumOne', process.env.ARBITRUM_ETHERSCAN_KEY);
register('xdai', 100, 'paris', process.env.XDAI_RPC_URL, process.env.XDAI_PRIVATE_KEY, 'gnosis', process.env.XDAI_ETHERSCAN_KEY);
register('avax', 43114, 'paris', process.env.AVAX_RPC_URL, process.env.AVAX_PRIVATE_KEY, 'avalanche', process.env.AVAX_ETHERSCAN_KEY);
register('fantom', 250, 'paris', process.env.FANTOM_RPC_URL, process.env.FANTOM_PRIVATE_KEY, 'opera', process.env.FANTOM_ETHERSCAN_KEY);
register('aurora', 1313161554, 'paris', process.env.AURORA_RPC_URL, process.env.AURORA_PRIVATE_KEY, 'aurora', process.env.AURORA_ETHERSCAN_KEY);
register('base', 8453, 'paris', process.env.BASE_RPC_URL, process.env.BASE_PRIVATE_KEY, 'base', process.env.BASE_ETHERSCAN_KEY);
registerCustom('klaytn', 8217, 'paris', process.env.KLAYTN_RPC_URL, process.env.KLAYTN_PRIVATE_KEY, process.env.KLAYTN_ETHERSCAN_KEY, 'https://scope.klaytn.com/', 'https://scope.klaytn.com/');

module.exports = {
networks,
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"license": "MIT",
"dependencies": {
"@1inch/solidity-utils": "2.2.27",
"@openzeppelin/contracts": "5.0.0",
"solmate": "6.7.0"
},
Expand All @@ -25,15 +24,15 @@
"eslint-plugin-n": "16.0.0",
"eslint-plugin-promise": "6.1.1",
"ethers": "5.7.2",
"hardhat": "2.14.1",
"hardhat": "2.19.0",
"hardhat-dependency-compiler": "1.1.3",
"hardhat-deploy": "0.11.30",
"hardhat-deploy": "0.11.43",
"hardhat-gas-reporter": "1.0.9",
"hardhat-tracer": "2.3.5",
"hardhat-tracer": "2.7.0",
"rimraf": "5.0.1",
"solc": "0.8.20",
"solhint": "3.4.1",
"solidity-coverage": "0.8.2",
"solc": "0.8.22",
"solhint": "4.0.0",
"solidity-coverage": "0.8.5",
"solidity-docgen": "0.5.17"
},
"scripts": {
Expand Down
Loading

0 comments on commit d9dfe06

Please sign in to comment.