Skip to content

Commit 013cd57

Browse files
committed
update solc version
1 parent 1b20c7f commit 013cd57

19 files changed

+83
-75
lines changed

solidity/contracts/CosmosToken.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
44

55
contract CosmosERC20 is ERC20 {
6-
uint256 constant MAX_UINT = 2**256 - 1;
6+
uint256 constant MAX_UINT = 2 ** 256 - 1;
77
uint8 private cosmosDecimals;
88
address private gravityAddress;
99

solidity/contracts/DummyToken.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// contracts/GLDToken.sol
22
// SPDX-License-Identifier: MIT
3-
pragma solidity ^0.8.0;
3+
pragma solidity 0.8.16;
44

55
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
66
import "@openzeppelin/contracts/access/Ownable.sol";

solidity/contracts/Gravity.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33

44
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
55
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

solidity/contracts/GravityERC721.sol

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33

44
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
55
import "./Gravity.sol";
66
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
77
import { ERC721Holder } from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
88
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
99

10-
1110
contract GravityERC721 is ERC721Holder, ReentrancyGuard {
12-
1311
uint256 public state_lastERC721EventNonce = 1;
1412
address public state_gravitySolAddress;
1513

@@ -26,7 +24,7 @@ contract GravityERC721 is ERC721Holder, ReentrancyGuard {
2624
address _gravitySolAddress
2725
) {
2826
state_gravitySolAddress = _gravitySolAddress;
29-
}
27+
}
3028

3129
function sendERC721ToCosmos(
3230
address _tokenContract,
@@ -40,19 +38,23 @@ contract GravityERC721 is ERC721Holder, ReentrancyGuard {
4038
_tokenContract,
4139
msg.sender,
4240
_destination,
43-
_tokenId,
41+
_tokenId,
4442
state_lastERC721EventNonce
4543
);
4644
}
4745

48-
function withdrawERC721 (
46+
function withdrawERC721(
4947
address _ERC721TokenContract,
5048
uint256[] calldata _tokenIds,
5149
address[] calldata _destinations
5250
) external {
5351
require(msg.sender == state_gravitySolAddress, "Can only call from Gravity.sol");
5452
for (uint256 i = 0; i < _tokenIds.length; i++) {
55-
ERC721(_ERC721TokenContract).safeTransferFrom(address(this), _destinations[i], _tokenIds[i]);
53+
ERC721(_ERC721TokenContract).safeTransferFrom(
54+
address(this),
55+
_destinations[i],
56+
_tokenIds[i]
57+
);
5658
}
5759
state_lastERC721EventNonce = state_lastERC721EventNonce + 1;
5860
}

solidity/contracts/HashingTest.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33

44
import "hardhat/console.sol";
55

solidity/contracts/ReentrantERC20.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
44
import "./Gravity.sol";
55

solidity/contracts/SigningTest.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33

44
import "hardhat/console.sol";
55

solidity/contracts/SimpleLogicBatch.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33

44
import "@openzeppelin/contracts/access/Ownable.sol";
55
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

solidity/contracts/TestERC20A.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
44

55
// One of three testing coins

solidity/contracts/TestERC20B.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
44

55
// One of three testing coins

solidity/contracts/TestERC20C.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
44

55
// One of three testing coins

solidity/contracts/TestERC721A.sol

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
44

55
// Generate NFTs with token ids 1-10 and 190-195
66
contract TestERC721A is ERC721 {
77
constructor() ERC721("NFT PUNK", "NFTPUNK") {
8-
uint i=0;
9-
// mint group 1 of nfts starting at token id 1, to 10
10-
for (i = 1; i <= 10; i += 1) {
11-
_mint(0xc783df8a850f42e7F7e57013759C285caa701eB6, i);
12-
}
13-
// mint group 2 of nfts starting at token id 190, to 199
14-
for (i = 190; i < 200; i += 1) {
15-
_mint(0xc783df8a850f42e7F7e57013759C285caa701eB6, i);
16-
}
17-
// mint group 3 of nfts token id 200, 201, 202
18-
_mint(0xBf660843528035a5A4921534E156a27e64B231fE, 200);
19-
_mint(0xBf660843528035a5A4921534E156a27e64B231fE, 201);
20-
_mint(0xBf660843528035a5A4921534E156a27e64B231fE, 202);
21-
_mint(0xBf660843528035a5A4921534E156a27e64B231fE, 203);
8+
uint i = 0;
9+
// mint group 1 of nfts starting at token id 1, to 10
10+
for (i = 1; i <= 10; i += 1) {
11+
_mint(0xc783df8a850f42e7F7e57013759C285caa701eB6, i);
12+
}
13+
// mint group 2 of nfts starting at token id 190, to 199
14+
for (i = 190; i < 200; i += 1) {
15+
_mint(0xc783df8a850f42e7F7e57013759C285caa701eB6, i);
16+
}
17+
// mint group 3 of nfts token id 200, 201, 202
18+
_mint(0xBf660843528035a5A4921534E156a27e64B231fE, 200);
19+
_mint(0xBf660843528035a5A4921534E156a27e64B231fE, 201);
20+
_mint(0xBf660843528035a5A4921534E156a27e64B231fE, 202);
21+
_mint(0xBf660843528035a5A4921534E156a27e64B231fE, 203);
2222
}
2323
}

solidity/contracts/TestFakeGravity.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity ^0.8.10;
2+
pragma solidity 0.8.16;
33

44
import "hardhat/console.sol";
55
import "./Gravity.sol";

solidity/contracts/TestLogicContract.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity ^0.8.10;
2+
pragma solidity 0.8.16;
33

44
import "hardhat/console.sol";
55
import "@openzeppelin/contracts/access/Ownable.sol";
@@ -12,11 +12,7 @@ contract TestLogicContract is Ownable {
1212
state_tokenContract = _tokenContract;
1313
}
1414

15-
function transferTokens(
16-
address _to,
17-
uint256 _a,
18-
uint256 _b
19-
) public onlyOwner {
15+
function transferTokens(address _to, uint256 _a, uint256 _b) public onlyOwner {
2016
IERC20(state_tokenContract).transfer(_to, _a + _b);
2117
console.log("Sent Tokens");
2218
}

solidity/contracts/TestTokenBatchMiddleware.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity ^0.8.10;
2+
pragma solidity 0.8.16;
33

44
import "@openzeppelin/contracts/access/Ownable.sol";
55
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

solidity/contracts/VulnerableERC20.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//SPDX-License-Identifier: Apache-2.0
2-
pragma solidity 0.8.10;
2+
pragma solidity 0.8.16;
33
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
44

55
// A test ERC20 with a really bad method called steal which permissionlessly allows transfers from an account
@@ -17,10 +17,10 @@ contract VulnerableERC20 is ERC20 {
1717
}
1818

1919
/**
20-
* Attepmts to transfer `amount` from `from` to `to`, bypassing the normal checks
20+
* Attepmts to transfer `amount` from `from` to `to`, bypassing the normal checks
2121
* essentially allowing anyone to steal funds from anyone else
22-
*/
23-
function steal(address from, address to, uint256 amount) public {
24-
_transfer(from, to, amount);
22+
*/
23+
function steal(address from, address to, uint256 amount) public {
24+
_transfer(from, to, amount);
2525
}
2626
}

solidity/hardhat-first-fork.config.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,42 @@ task("accounts", "Prints the list of accounts", async (args, hre) => {
2828
module.exports = {
2929
// This is a sample solc configuration that specifies which version of solc to use
3030
solidity: {
31-
version: "0.8.10",
31+
version: "0.8.16",
3232
settings: {
3333
optimizer: {
34-
enabled: true
35-
}
36-
}
34+
enabled: true,
35+
},
36+
},
3737
},
3838
networks: {
3939
hardhat: {
4040
chainId: 420,
41-
accounts: [{ privateKey: "0xbbfb76c92cd13796899f63dc6ead6d2420e8d0bc502d42bd5773c2d4b8897f08", balance: "10000000000000000000000" }],
41+
accounts: [
42+
{
43+
privateKey:
44+
"0xbbfb76c92cd13796899f63dc6ead6d2420e8d0bc502d42bd5773c2d4b8897f08",
45+
balance: "10000000000000000000000",
46+
},
47+
],
4248
forking: {
4349
url: "https://rpc.ankr.com/eth_goerli",
44-
blockNumber: 8218229
50+
blockNumber: 8218229,
4551
},
4652
mining: {
4753
auto: false,
48-
interval: 2000
49-
}
50-
}
51-
54+
interval: 2000,
55+
},
56+
},
5257
},
5358
typechain: {
5459
outDir: "typechain",
5560
target: "ethers-v5",
56-
runOnCompile: true
61+
runOnCompile: true,
5762
},
5863
gasReporter: {
59-
enabled: true
64+
enabled: true,
6065
},
6166
mocha: {
62-
timeout: 2000000
63-
}
67+
timeout: 2000000,
68+
},
6469
};

solidity/hardhat-second-fork.config.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,42 @@ task("accounts", "Prints the list of accounts", async (args, hre) => {
2828
module.exports = {
2929
// This is a sample solc configuration that specifies which version of solc to use
3030
solidity: {
31-
version: "0.8.10",
31+
version: "0.8.16",
3232
settings: {
3333
optimizer: {
34-
enabled: true
35-
}
36-
}
34+
enabled: true,
35+
},
36+
},
3737
},
3838
networks: {
3939
hardhat: {
4040
chainId: 421,
41-
accounts: [{ privateKey: "0xbbfb76c92cd13796899f63dc6ead6d2420e8d0bc502d42bd5773c2d4b8897f08", balance: "10000000000000000000000" }],
41+
accounts: [
42+
{
43+
privateKey:
44+
"0xbbfb76c92cd13796899f63dc6ead6d2420e8d0bc502d42bd5773c2d4b8897f08",
45+
balance: "10000000000000000000000",
46+
},
47+
],
4248
forking: {
4349
url: "https://1rpc.io/bnb",
44-
blockNumber: 24882604
50+
blockNumber: 24882604,
4551
},
4652
mining: {
4753
auto: false,
48-
interval: 2000
49-
}
50-
}
51-
54+
interval: 2000,
55+
},
56+
},
5257
},
5358
typechain: {
5459
outDir: "typechain",
5560
target: "ethers-v5",
56-
runOnCompile: true
61+
runOnCompile: true,
5762
},
5863
gasReporter: {
59-
enabled: true
64+
enabled: true,
6065
},
6166
mocha: {
62-
timeout: 2000000
63-
}
67+
timeout: 2000000,
68+
},
6469
};

solidity/hardhat.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const config: HardhatUserConfig = {
4444
solidity: {
4545
compilers: [
4646
{
47-
version: "0.8.10",
47+
version: "0.8.16",
4848
settings: {
4949
optimizer: {
5050
enabled: true,

0 commit comments

Comments
 (0)