fireblocks / hardhat-fireblocks Goto Github PK
View Code? Open in Web Editor NEWHardhat plugin for integrating with Fireblocks
License: MIT License
Hardhat plugin for integrating with Fireblocks
License: MIT License
Hello, I'm trying to set my apiKey
and privateKey
to hardhat config after I fetch them from a key management system on the fly (after I run some commands with npx hardhat run <script_path>
). The problem is, I can't do await calls in the hardhat config script before module.exports statement. Hence, I can't fetch my keys and make the process wait until that happens. I tried several workarounds like immediately invoked function expressions, but even if I can run a logic to fetch keys asynchronously, config is exported way before fetch process ends hence I can't set these fields properly.
Maybe I'm missing a trick that I can handle this with node.js, but I thought this can be achieved if you can let apiKey
and privateKey
fields to be assigned async functions that return string values for these fields, so that I can assign async functions to these fields which will fetch the keys and return those to config fields. If this sounds weird and you know another way of doing this, I appreciate any suggestion!
Hello,
I am trying to deploy a contract at Mumbai Polygon testnet. However, it returns this error:
TypeError: Cannot read properties of null (reading 'sendTransaction') at ContractFactory.<anonymous> (/Users/lucianocampagnoli/Documents/DAX/greener-hardhat/node_modules/@ethersproject/contracts/src.ts/index.ts:1247:38) at step (/Users/lucianocampagnoli/Documents/DAX/greener-hardhat/node_modules/@ethersproject/contracts/lib/index.js:48:23) at Object.next (/Users/lucianocampagnoli/Documents/DAX/greener-hardhat/node_modules/@ethersproject/contracts/lib/index.js:29:53) at fulfilled (/Users/lucianocampagnoli/Documents/DAX/greener-hardhat/node_modules/@ethersproject/contracts/lib/index.js:20:58) at processTicksAndRejections (node:internal/process/task_queues:95:5)
I configured my hardhat.config.ts file as the README.md suggests:
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "@fireblocks/hardhat-fireblocks";
import * as dotenv from "dotenv";
import fs from "fs";
import path from "path";
dotenv.config();
const secretKey = fs.readFileSync(path.resolve(__dirname, "./fireblocks_secret.key"), "utf8");
const config: HardhatUserConfig = {
solidity: "0.8.17",
networks: {
mumbai: {
url: "https://rpc-mumbai.maticvigil.com",
fireblocks: {
privateKey: secretKey || "",
apiKey: process.env.FIREBLOCKS_API_KEY || "",
vaultAccountIds: process.env.FIREBLOCKS_VAULT_ACCOUNT_IDS,
}
}
},
};
export default config;
Does anyone knows what could being done wrongly?
Best Regards
Luciano Augusto
Trying to deploy to Sepolia testnet, using the Hardhat and Fireblocks plugin but running into this error:
hardhat: v2.14.0
@fireblocks/hardhat-fireblocks: v1.2.1
Error: Unsupported chain id: 0xaa36a7. Supported chains ids: 1, 3, 4, 5, 10, 19, 30, 31, 42, 56, 69, 97, 137, 250, 1284, 1285, 2020, 42161, 42220, 43113, 43114, 44787, 62320, 80001, 421611, MAINNET, ROPSTEN, KOVAN, GOERLI, RINKEBY, BSC, BSC_TEST, POLYGON, POLYGON_TEST, AVALANCHE, AVALANCHE_TEST, MOONRIVER, MOONBEAM, SONGBIRD, ARBITRUM, ARBITRUM_RIN, FANTOM, RSK, RSK_TEST, CELO, CELO_BAK, CELO_ALF, OPTIMISM, OPTIMISM_KOVAN, RONIN If you're using a private blockchain, you can specify the blockchain's Fireblocks Asset ID via the "assetId" config param. at FireblocksWeb3Provider.populateAssetAndChainId (/Users/user_name/Desktop/projects/project_name/node_modules/@fireblocks/fireblocks-web3-provider/src/provider.ts:146:20) at processTicksAndRejections (node:internal/process/task_queues:95:5) at FireblocksWeb3Provider.populateAccounts (/Users/user_name/Desktop/projects/project_name/node_modules/@fireblocks/fireblocks-web3-provider/src/provider.ts:162:5)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.