Skip to content

Commit

Permalink
feat: use solc 0.8.22
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroEkkusu committed Nov 3, 2023
1 parent 204ad2b commit 1982945
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
25 changes: 12 additions & 13 deletions script/deployers/DeployCounter.s.sol
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity 0.8.22;

import "forge-std/Script.sol";

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());
Expand Down
4 changes: 2 additions & 2 deletions script/util/deployer_template
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity 0.8.21;

import "forge-std/Script.sol";

import "<src/Example.sol>";
import {TransparentUpgradeableProxy} from "lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

abstract contract <Example>Deployer is Script {
function deploy<Example>(
Expand Down
2 changes: 1 addition & 1 deletion src/Counter.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
10 changes: 5 additions & 5 deletions src/interface/ICounter.sol
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 2 additions & 2 deletions src/interface/IVersioned.sol
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 1982945

Please sign in to comment.