You may need to configure a proxy server if you're having trouble cloning
or fetching from a remote repository or getting an error
like unable to access '...' Couldn't resolve host '...'.
Consider something like:
| // Name: Associate SQL query with params | |
| import "@johnlindquist/kit" | |
| const DATASETTE_URL = "http://localhost:8001/xyz" | |
| // Example usage : call `associateQueryWithParams` with the following log message: | |
| // Query: select "id", "cout_abonnement", "cout_maintenance", "facture_energetique", "cout_isolation_enveloppe", "cout_solution_15", "aides_solution_15" from "bdd_eco" where "bdd_eco"."typologie" = ? and "bdd_eco"."zone_climatique" = ? and "bdd_eco"."type_CH" = ? and "bdd_eco"."type_ECS" = ? and "bdd_eco"."CH" = ? and "bdd_eco"."ECS" = ? and "bdd_eco"."scenario_renovation_enveloppe" = ? and "bdd_eco"."scenario_renovation_systeme" = ? limit ? -- params: ["Petit collectif (2001-2005)", "75 - Paris", "FIOUL", "FIOUL", "COL", "COL", "INIT", "CH + ECS Hybride : PAC + Chaudière", 1] | |
| function associateQueryWithParams(logMessage: string): string { | |
| // Extract query and params from the log message |
| import Web3 from "web3"; | |
| import dotenv from "dotenv"; | |
| import HDWalletProvider from "@truffle/hdwallet-provider"; | |
| // We assume you have a .env file with MNEMONIC and INFURA_ID variables | |
| dotenv.config(); | |
| const provider = new HDWalletProvider( | |
| `${process.env.MNEMONIC}`, // Seed phrase of your wallet | |
| `https://goerli.infura.io/v3/${process.env.INFURA_ID}` // Infura ID token |
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.18; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| /** | |
| * @title Voting | |
| */ | |
| contract Voting is Ownable { |
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.18; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract devinez is Ownable { | |
| string private mot; | |
| string public indice; | |
| address public gagnant; |
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.18; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract Notes is Ownable { | |
| struct Student { | |
| string name; | |
| uint256 noteBiology; | |
| uint256 noteMaths; |
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.18; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract epargne is Ownable { | |
| string private mot; | |
| string public indice; | |
| address public gagnant; | |
| mapping(address=>bool) played; | |
| address[] public players; |
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.18; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract epargne is Ownable { | |
| string private mot; | |
| string public indice; | |
| address public gagnant; | |
| mapping(address=>bool) played; | |
| address[] public players; |
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.18; | |
| /** | |
| * | |
| */ | |
| contract ParentContract { | |
| uint256 internal sensDeLaVie = 42; |