diff --git a/contracts/FarmToken.sol b/contracts/FarmToken.sol index 3dc89d1..1ff03e2 100644 --- a/contracts/FarmToken.sol +++ b/contracts/FarmToken.sol @@ -1,9 +1,12 @@ -pragma solidity ^0.6.2; +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; -import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import "@openzeppelin/contracts/utils/math/SafeMath.sol"; + contract FarmToken is ERC20 { using Address for address; @@ -12,10 +15,7 @@ contract FarmToken is ERC20 { IERC20 public token; - constructor(address _token) - public - ERC20("FarmToken", "FRM") - { + constructor(address _token) ERC20("FarmToken", "FRM") { token = IERC20(_token); } diff --git a/contracts/MyToken.sol b/contracts/MyToken.sol index c2c0f51..e19ae00 100644 --- a/contracts/MyToken.sol +++ b/contracts/MyToken.sol @@ -1,9 +1,11 @@ -pragma solidity ^0.6.2; +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20 { - constructor() public ERC20("MyToken", "MTKN"){ + constructor() ERC20("MyToken", "MTKN"){ _mint(msg.sender, 1000000000000000000000000); } + } \ No newline at end of file diff --git a/truffle-config.js b/truffle-config.js index 701820c..c28aae1 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -19,7 +19,6 @@ */ // const HDWalletProvider = require('@truffle/hdwallet-provider'); -// const infuraKey = "fj4jll3k....."; // // const fs = require('fs'); // const mnemonic = fs.readFileSync(".secret").toString().trim(); @@ -54,7 +53,7 @@ module.exports = { // gas: 8500000, // Gas sent with each transaction (default: ~6700000) // gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei) // from:
, // Account to send txs from (default: accounts[0]) - // websockets: true // Enable EventEmitter interface for web3 (default: false) + // websocket: true // Enable EventEmitter interface for web3 (default: false) // }, // Useful for deploying to a public network. // NB: It's important to wrap the provider as a function. @@ -82,7 +81,9 @@ module.exports = { // Configure your compilers compilers: { solc: { - version: "0.6.2", // Fetch exact version from solc-bin (default: truffle's version) + version: "0.8.10", + //version: "0.6.2", + // version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version) // docker: true, // Use "0.5.1" you've installed locally with docker (default: false) // settings: { // See the solidity docs for advice about optimization and evmVersion // optimizer: { @@ -92,5 +93,26 @@ module.exports = { // evmVersion: "byzantium" // } } - } + }, + + // Truffle DB is currently disabled by default; to enable it, change enabled: + // false to enabled: true. The default storage location can also be + // overridden by specifying the adapter settings, as shown in the commented code below. + // + // NOTE: It is not possible to migrate your contracts to truffle DB and you should + // make a backup of your artifacts to a safe location before enabling this feature. + // + // After you backed up your artifacts you can utilize db by running migrate as follows: + // $ truffle migrate --reset --compile-all + // + // db: { + // enabled: false, + // host: "127.0.0.1", + // adapter: { + // name: "sqlite", + // settings: { + // directory: ".db" + // } + // } + // } };