From 1982945ef9a5f6e6ec018759f8fcd1f51129ed46 Mon Sep 17 00:00:00 2001 From: Zero Ekkusu <94782988+ZeroEkkusu@users.noreply.github.com> Date: Fri, 3 Nov 2023 22:36:41 +0100 Subject: [PATCH] feat: use solc 0.8.22 --- foundry.toml | 2 +- script/deployers/DeployCounter.s.sol | 25 ++++++++++++------------- script/util/deployer_template | 4 ++-- src/Counter.sol | 2 +- src/interface/ICounter.sol | 10 +++++----- src/interface/IVersioned.sol | 4 ++-- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/foundry.toml b/foundry.toml index fa09e08..674be44 100644 --- a/foundry.toml +++ b/foundry.toml @@ -5,7 +5,7 @@ libs = ['lib'] optimizer = true optimize_runs = 999999 via_ir = true -solc = '0.8.21' +solc = '0.8.22' verbosity = 2 ffi = true fs_permissions = [ diff --git a/script/deployers/DeployCounter.s.sol b/script/deployers/DeployCounter.s.sol index 7282112..015db87 100644 --- a/script/deployers/DeployCounter.s.sol +++ b/script/deployers/DeployCounter.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.22; import "forge-std/Script.sol"; @@ -7,26 +7,25 @@ import "src/Counter.sol"; import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; abstract contract CounterDeployer is Script { - function deployCounter(address proxyAdmin, uint256 number) - internal - returns (Counter proxyAsCounter, address proxy, address logic) - { + function deployCounter( + address proxyAdmin, + uint256 number + ) internal returns (Counter proxyAsCounter, address proxy, address logic) { bytes memory initData = abi.encodeCall(Counter.initialize, (number)); return _deployCounter(proxyAdmin, initData); } - function deployCounter_NoInit(address proxyAdmin) - internal - returns (Counter proxyAsCounter, address proxy, address logic) - { + function deployCounter_NoInit( + address proxyAdmin + ) internal returns (Counter proxyAsCounter, address proxy, address logic) { return _deployCounter(proxyAdmin, ""); } - function _deployCounter(address proxyAdmin, bytes memory initData) - private - returns (Counter proxyAsCounter, address proxy, address logic) - { + function _deployCounter( + address proxyAdmin, + bytes memory initData + ) private returns (Counter proxyAsCounter, address proxy, address logic) { vm.startBroadcast(vm.envUint("PRIVATE_KEY")); logic = address(new Counter()); diff --git a/script/util/deployer_template b/script/util/deployer_template index 25f3050..3f69a66 100644 --- a/script/util/deployer_template +++ b/script/util/deployer_template @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity 0.8.21; import "forge-std/Script.sol"; import ""; -import {TransparentUpgradeableProxy} from "lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; abstract contract Deployer is Script { function deploy( diff --git a/src/Counter.sol b/src/Counter.sol index 079575c..23c6eb1 100644 --- a/src/Counter.sol +++ b/src/Counter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import {ICounter, IVersioned} from "./interface/ICounter.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; diff --git a/src/interface/ICounter.sol b/src/interface/ICounter.sol index 4b7acf7..4eb5c3b 100644 --- a/src/interface/ICounter.sol +++ b/src/interface/ICounter.sol @@ -1,16 +1,16 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import {IVersioned} from "./IVersioned.sol"; interface ICounter is IVersioned { - /// @return the current number + /// @return The current number. function number() external view returns (uint256); - /// @notice set the number - /// @param newNumber the new number + /// @notice Sets the number. + /// @param newNumber The new number. function setNumber(uint256 newNumber) external; - /// @notice increment the number by 1 + /// @notice Increments the number by 1. function increment() external; } diff --git a/src/interface/IVersioned.sol b/src/interface/IVersioned.sol index 98b238c..badd969 100644 --- a/src/interface/IVersioned.sol +++ b/src/interface/IVersioned.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; interface IVersioned { - /// @return the version of the contract + /// @return The version of the contract. function version() external pure returns (string memory); }