diff --git a/contracts/DataFeedConsumer.sol b/contracts/DataFeedConsumer.sol index da4f849..af75edc 100644 --- a/contracts/DataFeedConsumer.sol +++ b/contracts/DataFeedConsumer.sol @@ -32,7 +32,7 @@ contract DataFeedConsumer { return dataFeed.decimals(); } - function getLatestDataThroughRouter(string pair) public { + function getLatestDataThroughRouter(string calldata pair) public { ( uint80 roundId_, int256 answer_ /* uint startedAt */ /* uint updatedAt */ /* uint80 answeredInRound */, @@ -45,7 +45,7 @@ contract DataFeedConsumer { roundId = roundId_; } - function decimalsThroughRouter(string pair) public view returns (uint8) { + function decimalsThroughRouter(string calldata pair) public view returns (uint8) { return router.decimals(pair); } } diff --git a/hardhat.config.ts b/hardhat.config.ts index 6c5f8fa..0e75dac 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -7,15 +7,17 @@ import dotenv from 'dotenv' dotenv.config() -let commonConfig = { gas: 5_000_000, gasPrice: 250_000_000_000 } +let commonConfig = {} if (process.env.PRIV_KEY) { commonConfig = { - ...commonConfig, + gas: 5_000_000, + gasPrice: 250_000_000_000, accounts: [process.env.PRIV_KEY] } } else { commonConfig = { - ...commonConfig, + gas: 5_000_000, + gasPrice: 250_000_000_000, accounts: { mnemonic: process.env.MNEMONIC || '' }