Skip to content

Commit

Permalink
updated version of solidity to 0.8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
julietrubin committed Dec 13, 2021
1 parent 4e5daa1 commit a51c1f0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
12 changes: 6 additions & 6 deletions contracts/FarmToken.sol
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
}

Expand Down
6 changes: 4 additions & 2 deletions contracts/MyToken.sol
Original file line number Diff line number Diff line change
@@ -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);
}

}
30 changes: 26 additions & 4 deletions truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

// const HDWalletProvider = require('@truffle/hdwallet-provider');
// const infuraKey = "fj4jll3k.....";
//
// const fs = require('fs');
// const mnemonic = fs.readFileSync(".secret").toString().trim();
Expand Down Expand Up @@ -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: <address>, // 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.
Expand Down Expand Up @@ -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: {
Expand All @@ -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"
// }
// }
// }
};

0 comments on commit a51c1f0

Please sign in to comment.