This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity 0.8.18; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
/** | |
* @title Voting | |
*/ | |
contract Voting is Ownable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity 0.8.18; | |
/** | |
* | |
*/ | |
contract ParentContract { | |
uint256 internal sensDeLaVie = 42; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity 0.8.18; | |
import "./1_Storage.sol"; | |
interface IStorage { | |
function store(uint256 num) external ; | |
function retrieve() external view returns (uint256); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity 0.8.18; | |
/** | |
* Guess a word with a clue. | |
*/ | |
contract Guess { | |
address owner; | |
string mysteryText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.8.2 <0.9.0; | |
/** | |
* Compte épargne | |
* | |
* Cf. aussi Ownable de OpenZeppelin | |
*/ | |
contract Epargne { |
NewerOlder