diff --git a/Makefile b/Makefile index 4f5d484..2784ffb 100644 --- a/Makefile +++ b/Makefile @@ -24,5 +24,8 @@ build: forge fmt && forge clean && forge build --optimize --optimizer-runs 2000 # Tests -tests: - forge test --gas-report -vvv +test_suite: + forge test --use 0.8.17 + forge test --use 0.8.18 + forge test --use 0.8.19 + forge test --use 0.8.20 \ No newline at end of file diff --git a/README.md b/README.md index f35cd3b..2436935 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,15 @@ When cloning, you must use either `make remove && make install` or `make update` We use OpenZeppelin contracts version 4.8.3 in this codebase. +## Testing +You should run the test suite with `make test_suite`. + +This loops through the following solidity versions: +- 0.8.17 +- 0.8.18 +- 0.8.19 +- 0.8.20 + ## Disclaimer This codebase is provided on an "as is" and "as available" basis. diff --git a/src/access/OwnableAccessControl.sol b/src/access/OwnableAccessControl.sol index 37a856f..39b1cb4 100644 --- a/src/access/OwnableAccessControl.sol +++ b/src/access/OwnableAccessControl.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import {EnumerableSet} from "openzeppelin/utils/structs/EnumerableSet.sol"; import {Ownable} from "openzeppelin/access/Ownable.sol"; @@ -24,7 +24,7 @@ error NotRoleOrOwner(bytes32 role); /// @dev by default, only the owner can grant roles but by inheriting, but you /// may allow other roles to grant roles by using the internal helper. /// @author transientlabs.xyz -/// @custom:version 2.2.0 +/// @custom:version 2.2.2 abstract contract OwnableAccessControl is Ownable { /*////////////////////////////////////////////////////////////////////////// State Variables diff --git a/src/royalties/EIP2981TL.sol b/src/royalties/EIP2981TL.sol index 94a7dc7..7a4b284 100644 --- a/src/royalties/EIP2981TL.sol +++ b/src/royalties/EIP2981TL.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import {ERC165} from "openzeppelin/utils/introspection/ERC165.sol"; import {IEIP2981} from "./IEIP2981.sol"; @@ -24,7 +24,7 @@ error MaxRoyaltyError(); /// @dev follows EIP-2981 (https://eips.ethereum.org/EIPS/eip-2981) /// @author transientlabs.xyz /// https://github.com/Transient-Labs/tl-sol-tools -/// @custom:version 2.2.0 +/// @custom:version 2.2.2 abstract contract EIP2981TL is IEIP2981, ERC165 { /*////////////////////////////////////////////////////////////////////////// Royalty Struct diff --git a/src/royalties/IEIP2981.sol b/src/royalties/IEIP2981.sol index dc0650d..cf33c1c 100644 --- a/src/royalties/IEIP2981.sol +++ b/src/royalties/IEIP2981.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; /// /// @dev Interface for the NFT Royalty Standard diff --git a/src/upgradeable/access/OwnableAccessControlUpgradeable.sol b/src/upgradeable/access/OwnableAccessControlUpgradeable.sol index 3db50b4..b2710d3 100644 --- a/src/upgradeable/access/OwnableAccessControlUpgradeable.sol +++ b/src/upgradeable/access/OwnableAccessControlUpgradeable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import {EnumerableSetUpgradeable} from "openzeppelin-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; @@ -25,7 +25,7 @@ error NotRoleOrOwner(bytes32 role); /// @dev by default, only the owner can grant roles but by inheriting, but you /// may allow other roles to grant roles by using the internal helper. /// @author transientlabs.xyz -/// @custom:version 2.2.0 +/// @custom:version 2.2.2 abstract contract OwnableAccessControlUpgradeable is Initializable, OwnableUpgradeable { /*////////////////////////////////////////////////////////////////////////// State Variables diff --git a/src/upgradeable/royalties/EIP2981TLUpgradeable.sol b/src/upgradeable/royalties/EIP2981TLUpgradeable.sol index 10921b7..b1349cb 100644 --- a/src/upgradeable/royalties/EIP2981TLUpgradeable.sol +++ b/src/upgradeable/royalties/EIP2981TLUpgradeable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol"; @@ -24,7 +24,7 @@ error MaxRoyaltyError(); /// while allowing for specific token overrides /// @dev follows EIP-2981 (https://eips.ethereum.org/EIPS/eip-2981) /// @author transientlabs.xyz -/// @custom:version 2.2.0 +/// @custom:version 2.2.2 abstract contract EIP2981TLUpgradeable is IEIP2981, Initializable, ERC165Upgradeable { /*////////////////////////////////////////////////////////////////////////// Royalty Struct diff --git a/test/EIP2981TL.t.sol b/test/EIP2981TL.t.sol index e9d8933..b1418ff 100644 --- a/test/EIP2981TL.t.sol +++ b/test/EIP2981TL.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import "forge-std/Test.sol"; import {MockEIP2981TL} from "./mocks/MockEIP2981TL.sol"; diff --git a/test/OwnableAccessControl.t.sol b/test/OwnableAccessControl.t.sol index 128602e..d4be2aa 100644 --- a/test/OwnableAccessControl.t.sol +++ b/test/OwnableAccessControl.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import "forge-std/Test.sol"; import {MockOwnableAccessControl} from "./mocks/MockOwnableAccessControl.sol"; diff --git a/test/mocks/MockEIP2981TL.sol b/test/mocks/MockEIP2981TL.sol index 89d38d2..0570ffd 100644 --- a/test/mocks/MockEIP2981TL.sol +++ b/test/mocks/MockEIP2981TL.sol @@ -2,7 +2,7 @@ /// @dev this contract does not have proper access control but is only for testing -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import {EIP2981TL} from "../../src/royalties/EIP2981TL.sol"; diff --git a/test/mocks/MockOwnableAccessControl.sol b/test/mocks/MockOwnableAccessControl.sol index 0471da9..e61b345 100644 --- a/test/mocks/MockOwnableAccessControl.sol +++ b/test/mocks/MockOwnableAccessControl.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import {OwnableAccessControl} from "../../src/access/OwnableAccessControl.sol"; diff --git a/test/upgradeable/EIP2981TLUpgradeable.t.sol b/test/upgradeable/EIP2981TLUpgradeable.t.sol index 8d17879..034916b 100644 --- a/test/upgradeable/EIP2981TLUpgradeable.t.sol +++ b/test/upgradeable/EIP2981TLUpgradeable.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import "forge-std/Test.sol"; import {MockEIP2981TLUpgradeable} from "./mocks/MockEIP2981TLUpgradeable.sol"; diff --git a/test/upgradeable/OwnableAccessControlUpgradeable.t.sol b/test/upgradeable/OwnableAccessControlUpgradeable.t.sol index 3f11d39..3f134e0 100644 --- a/test/upgradeable/OwnableAccessControlUpgradeable.t.sol +++ b/test/upgradeable/OwnableAccessControlUpgradeable.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import "forge-std/Test.sol"; import {MockOwnableAccessControlUpgradeable} from "./mocks/MockOwnableAccessControlUpgradeable.sol"; diff --git a/test/upgradeable/mocks/MockEIP2981TLUpgradeable.sol b/test/upgradeable/mocks/MockEIP2981TLUpgradeable.sol index bdd9055..d440482 100644 --- a/test/upgradeable/mocks/MockEIP2981TLUpgradeable.sol +++ b/test/upgradeable/mocks/MockEIP2981TLUpgradeable.sol @@ -2,7 +2,7 @@ /// @dev this contract does not have proper access control but is only for testing -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import {EIP2981TLUpgradeable} from "../../../src/upgradeable/royalties/EIP2981TLUpgradeable.sol"; diff --git a/test/upgradeable/mocks/MockOwnableAccessControlUpgradeable.sol b/test/upgradeable/mocks/MockOwnableAccessControlUpgradeable.sol index 17dd124..ff7fd6d 100644 --- a/test/upgradeable/mocks/MockOwnableAccessControlUpgradeable.sol +++ b/test/upgradeable/mocks/MockOwnableAccessControlUpgradeable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.19; +pragma solidity ^0.8.17; import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol"; import {OwnableAccessControlUpgradeable} from "../../../src/upgradeable/access/OwnableAccessControlUpgradeable.sol";