Skip to content

Commit

Permalink
Version 2.2.2 (#9)
Browse files Browse the repository at this point in the history
Changed to a solidity floating pragma and tested with 0.8.17, 0.8.18,
0.8.19, and 0.8.20. All tests passing.
  • Loading branch information
mpeyfuss authored Jul 31, 2023
1 parent a6704b6 commit f3bb929
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 19 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions src/access/OwnableAccessControl.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/royalties/EIP2981TL.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/royalties/IEIP2981.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/upgradeable/access/OwnableAccessControlUpgradeable.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/upgradeable/royalties/EIP2981TLUpgradeable.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/EIP2981TL.t.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion test/OwnableAccessControl.t.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/MockEIP2981TL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion test/mocks/MockOwnableAccessControl.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion test/upgradeable/EIP2981TLUpgradeable.t.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion test/upgradeable/OwnableAccessControlUpgradeable.t.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion test/upgradeable/mocks/MockEIP2981TLUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down

0 comments on commit f3bb929

Please sign in to comment.