Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions foundry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"lib/forge-std": {
"rev": "8f24d6b04c92975e0795b5868aa0d783251cdeaa"
},
"lib/openzeppelin-contracts": {
"rev": "3291252c866ad698f6a55ec660259e49a67eb3d0"
},
"lib/sign-protocol-evm": {
"rev": "264af194a780b7b4493aa056b597ab80243b5a0c"
},
"lib/v4-core": {
"rev": "4aa6c3ddd3b540a3aa22021c02d2298e79ae3928"
},
"lib/v4-periphery": {
"rev": "0c162a0cec2bf9184ce97e19f710fbc657ae7a5a"
}
}
14 changes: 6 additions & 8 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc = "0.8.26"
auto_detect_solc = true
solc_version = "0.8.24"
via_ir = true
optimizer = true
optimizer_runs = 200


remappings = [
"@openzeppelin/contracts=lib/openzeppelin-contracts/contracts/",
"@foundry-rs/=lib/foundry-rs/",
"@openzeppelin/contracts=lib/openzeppelin-contracts/contracts/",
"@uniswap/v4-core/=lib/v4-core/",
"forge-gas-snapshot/=lib/v4-core/lib/forge-gas-snapshot/src/",
"permit2/=lib/v4-periphery/lib/permit2/",
"solmate/=lib/v4-core/lib/solmate/",
"v4-core/=lib/v4-core/",
"v4-periphery/=lib/v4-periphery/",
"v4-core/src/=lib/v4-core/src/",
"v4-periphery/src/=lib/v4-periphery/src/",
"@signprotocol/signprotocol-evm=lib/sign-protocol-evm",
]

Expand Down
2 changes: 1 addition & 1 deletion script/AddLiquidity.s.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
pragma solidity ^0.8.24;

import { Script, console2 } from "forge-std/Script.sol";
import { HelperConfig } from "./HelperConfig.s.sol";
Expand Down
4 changes: 2 additions & 2 deletions script/DeployAndSetup.s.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import { console2 } from "forge-std/Test.sol";
import { Script } from "forge-std/Script.sol";
Expand Down
3 changes: 1 addition & 2 deletions script/HelperConfig.s.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;
pragma solidity ^0.8.24;

import { console2 } from "forge-std/Test.sol";
import { Script } from "forge-std/Script.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/forked/DeployAndTest.s.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
pragma solidity ^0.8.24;

import { Script, console2 } from "forge-std/Script.sol";
import { HelperConfig } from "../HelperConfig.s.sol";
Expand Down
34 changes: 25 additions & 9 deletions src/FactoryTokenContract.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
pragma solidity ^0.8.24;

import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { TokenContract } from "./helpers/TokenContract.sol";
Expand Down Expand Up @@ -74,13 +74,17 @@ contract FactoryTokenContract is Ownable {
* @notice Modifiers.
*/
modifier onlyMultiSigContract() {
require(msg.sender == address(multiSigContract), FactoryTokenContract__onlyMultiSigContract());
if (msg.sender != address(multiSigContract)) {
revert FactoryTokenContract__onlyMultiSigContract();
}
_;
}

/// @notice modifier to ensure only pending txs can be executed
modifier onlyPendigTx(uint256 _txId) {
require(txArray[_txId].isPending, TransactionAlreadyExecuted());
if (!txArray[_txId].isPending) {
revert TransactionAlreadyExecuted();
}
_;
}

Expand Down Expand Up @@ -144,12 +148,24 @@ contract FactoryTokenContract is Ownable {
external
returns (uint256 txId)
{
require(_signers.length >= 2, InvalidSignerCount());
require(bytes(_tokenName).length > 0, EmptyName());
require(bytes(_tokenSymbol).length > 0, EmptySymbol());
require(_totalSupply > 0, InvalidSupply());
if (_supplyCapEnabled) {
require(_maxSupply >= _totalSupply, InvalidSupply());
if (_signers.length < 2) {
revert InvalidSignerCount();
}
if (bytes(_tokenName).length == 0) {
revert EmptyName();
}
if (bytes(_tokenSymbol).length == 0) {
revert EmptySymbol();
}
if (_totalSupply <= 0) {
if (_supplyCapEnabled) {
if (_maxSupply < _totalSupply) {
revert InvalidSupply();
}
}
if (_maxSupply < _totalSupply) {
revert InvalidSupply();
}
}
txId = _handleQueue(
_signers,
Expand Down
Loading
Loading