@1inch/solidity-utils 2.0.22 → 2.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity ^0.8.0;
4
+
5
+ import "@openzeppelin/contracts/access/Ownable.sol";
6
+ import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
7
+
8
+ contract TokenCustomDecimalsMock is ERC20Permit, Ownable {
9
+ uint8 internal immutable _decimals;
10
+
11
+ constructor(string memory name, string memory symbol, uint256 amount, uint8 decimals_) ERC20(name, symbol) ERC20Permit(name) {
12
+ _mint(msg.sender, amount);
13
+ _decimals = decimals_;
14
+ }
15
+
16
+ function mint(address account, uint256 amount) external onlyOwner {
17
+ _mint(account, amount);
18
+ }
19
+
20
+ function burn(address account, uint256 amount) external onlyOwner {
21
+ _burn(account, amount);
22
+ }
23
+
24
+ function decimals() public view virtual override returns (uint8) {
25
+ return _decimals;
26
+ }
27
+
28
+ function getChainId() external view returns(uint256) {
29
+ return block.chainid;
30
+ }
31
+ }
@@ -0,0 +1,21 @@
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity ^0.8.0;
4
+ pragma abicoder v1;
5
+
6
+ import "@openzeppelin/contracts/access/Ownable.sol";
7
+ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
8
+
9
+
10
+ contract TokenMock is ERC20, Ownable {
11
+ // solhint-disable-next-line no-empty-blocks
12
+ constructor(string memory name, string memory symbol) ERC20(name, symbol) {}
13
+
14
+ function mint(address account, uint256 amount) external onlyOwner {
15
+ _mint(account, amount);
16
+ }
17
+
18
+ function burn(address account, uint256 amount) external onlyOwner {
19
+ _burn(account, amount);
20
+ }
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1inch/solidity-utils",
3
- "version": "2.0.22",
3
+ "version": "2.0.23",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": {
@@ -87,6 +87,7 @@
87
87
  "./utils",
88
88
  "contracts/*.sol",
89
89
  "contracts/interfaces",
90
- "contracts/libraries"
90
+ "contracts/libraries",
91
+ "contracts/mocks"
91
92
  ]
92
93
  }