@solarity/hardhat-migrate
Version:
The simplest way to deploy smart contracts
20 lines • 877 B
JavaScript
/**
* Source: https://github.com/OpenZeppelin/openzeppelin-upgrades
*/
import { networkManager } from "./NetworkManager.js";
import { MigrateError } from "../../utils/index.js";
export const RESPONSE_OK = "1";
/**
* Call the configured Etherscan API with the given parameters.
*/
export async function callEtherscanApi(instance, params) {
const parameters = new URLSearchParams({ ...params, apikey: instance.apiKey });
const response = await networkManager.axios.post(instance.apiUrl, parameters.toString(), {
headers: { "Content-Type": "application/x-www-form-urlencoded" },
});
if (!(response.status >= 200 && response.status < 300)) {
throw new MigrateError(`Etherscan API call failed with status ${response.status}, response: ${JSON.stringify(response.data)}`);
}
return response.data;
}
//# sourceMappingURL=etherscan-api.js.map