Skip to content
This repository was archived by the owner on Oct 12, 2021. It is now read-only.

Commit 9e6ab61

Browse files
committed
Optimize mint function. Change compiler to 0.7.4.
1 parent 6a4d0aa commit 9e6ab61

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

.solhint.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"plugins": ["prettier"],
44
"rules": {
55
"code-complexity": ["error", 7],
6-
"compiler-version": ["error", "^0.7.0"],
6+
"compiler-version": ["error", "0.7.4"],
77
"const-name-snakecase": "off",
88
"constructor-syntax": "error",
99
"func-visibility": ["error", { "ignoreConstructors": true }],
10-
"max-line-length": ["error", 120],
10+
"max-line-length": ["error", 140],
1111
"not-rely-on-time": "off",
1212
"prettier/prettier": [
1313
"error",

contracts/FlashToken.sol

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity 0.6.12;
2+
pragma solidity 0.7.4;
33

44
import "./libraries/SafeMath.sol";
55

@@ -38,9 +38,10 @@ contract FlashToken is IERC20 {
3838
string public constant symbol = "FLASH";
3939
uint8 public constant decimals = 18;
4040

41-
uint256 public override totalSupply;
41+
address public constant FLASH_PROTOCOL = address(0x0);
42+
address public constant FLASH_CLAIM = address(0x0);
4243

43-
mapping(address => bool) public minters;
44+
uint256 public override totalSupply;
4445

4546
mapping(address => uint256) public override balanceOf;
4647
mapping(address => mapping(address => uint256)) public override allowance;
@@ -54,14 +55,14 @@ contract FlashToken is IERC20 {
5455
event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce);
5556

5657
modifier onlyMinter {
57-
require(minters[msg.sender] == true, "FlashToken:: NOT_MINTER");
58+
require(msg.sender == FLASH_PROTOCOL || msg.sender == FLASH_CLAIM, "FlashToken:: NOT_MINTER");
5859
_;
5960
}
6061

61-
constructor(address flashProtocol, address flashClaim) public {
62-
minters[flashProtocol] = true;
63-
minters[flashClaim] = true;
64-
_mint(address(0),0*(10**18)); //address and amount will be updated
62+
constructor() {
63+
// BlockZero Labs: Foundation Fund
64+
_mint(0x842f8f6fB524996d0b660621DA895166E1ceA691, 1200746000000000000000000);
65+
_mint(0x0945d9033147F27aDDFd3e7532ECD2100cb91032, 1000000000000000000000000);
6566
}
6667

6768
function _validateSignedData(

contracts/interfaces/IERC20.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity 0.6.12;
2+
pragma solidity 0.7.4;
33

44
interface IERC20 {
55
function totalSupply() external view returns (uint256);

contracts/libraries/SafeMath.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity 0.6.12;
2+
pragma solidity 0.7.4;
33

44
// A library for performing overflow-safe math, courtesy of DappHub: https://github.com/dapphub/ds-math/blob/d0ef6d6a5f/src/math.sol
55
// Modified to include only the essentials

hardhat.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const config: HardhatUserConfig = {
6868
tests: "./test",
6969
},
7070
solidity: {
71-
version: "0.6.12",
71+
version: "0.7.4",
7272
settings: {
7373
// https://hardhat.org/hardhat-network/#solidity-optimizer-support
7474
optimizer: {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8290,7 +8290,7 @@ [email protected]:
82908290

82918291
82928292
version "0.7.4"
8293-
resolved "https://registry.npmjs.org/solc/-/solc-0.7.4.tgz#9c5ed81ae0692e3e614e47cd5b500b0f9485b98d"
8293+
resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.4.tgz#9c5ed81ae0692e3e614e47cd5b500b0f9485b98d"
82948294
integrity sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==
82958295
dependencies:
82968296
command-exists "^1.2.8"

0 commit comments

Comments
 (0)