Skip to content

Commit

Permalink
Update FRE to version 2.2.2 (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ-Everett authored Dec 17, 2024
1 parent 8e410f9 commit 9985e73
Show file tree
Hide file tree
Showing 31 changed files with 56 additions and 47 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@
### Changed
- Asset Handler Diamonds now use the DiamondCutFacetAppAdmin library with AppAdminOrOnlyOwner modifier to allow application admins to upgrade facets in the handler diamond

## 2.2.2 - 2024-12-17

### Removed
- Removed internal documentation

### Added
- Documentation pointers to https://docs.forterulesengine.io

### Changed
- Updated NPM package contents
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Check out [our docs](https://docs.forterulesengine.io) for in-depth guides and r

This repository contains an EVM-based protocol designed to meet the unique needs of tokenized assets and on-chain economies. The protocol enables the creation and management of economic and compliance controls for your on-chain economy at the token level, allowing for maximum flexibility while maintaining the transparency and trustlessness of Web3.

[version-image]: https://img.shields.io/badge/Version-2.2.1-brightgreen?style=for-the-badge&logo=appveyor
[version-image]: https://img.shields.io/badge/Version-2.2.2-brightgreen?style=for-the-badge&logo=appveyor
[version-url]: https://github.com/thrackle-io/forte-rules-engine

## Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/CHECKOUT-REPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
[upgradeSubmodules-url]: ./SUBMODULE-UPGRADE.md

<!-- These are the header links -->
[version-image]: https://img.shields.io/badge/Version-2.2.1-brightgreen?style=for-the-badge&logo=appveyor
[version-image]: https://img.shields.io/badge/Version-2.2.2-brightgreen?style=for-the-badge&logo=appveyor
[version-url]: https://github.com/thrackle-io/forte-rules-engine
2 changes: 1 addition & 1 deletion docs/SUBMODULE-UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@


<!-- These are the header links -->
[version-image]: https://img.shields.io/badge/Version-2.2.1-brightgreen?style=for-the-badge&logo=appveyor
[version-image]: https://img.shields.io/badge/Version-2.2.2-brightgreen?style=for-the-badge&logo=appveyor
[version-url]: https://github.com/thrackle-io/forte-rules-engine
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"prettier-plugin-solidity": "^1.1.1"
},
"name": "@thrackle-io/forte-rules-engine",
"version": "2.2.1",
"version": "2.2.2",
"description": "Set of contracts to easily start an application in rules engine",
"dependencies": {
"@openzeppelin/contracts": "4.9.6",
Expand Down
2 changes: 1 addition & 1 deletion script/DeployAllModulesPt3.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract DeployAllModulesPt3Script is Script, DiamondScriptUtil, DeployABIUtil {
address ownerAddress;
bool recordAllChains;
uint256 timestamp;
string private constant VERSION="2.2.1";
string private constant VERSION="2.2.2";

/**
* @dev This is the main function that gets called by the Makefile or CLI
Expand Down
2 changes: 1 addition & 1 deletion script/python/get_latest_facet_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

_dir = dotenv_values(".env")
dir = Path(_dir["DEPLOYMENT_OUT_DIR"])
version = "2.2.1"
version = "2.2.2"

def get_latest_deployed_facet(args):
record = {}
Expand Down
2 changes: 1 addition & 1 deletion script/python/record_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# This file is meant to record the ABI for a specific contract per deployment so that it is categorized by date and useable for DOOM backwards compatibility
_dir = dotenv_values(".env")

version = "2.2.1"
version = "2.2.2"

def record_abi(args):
contract = args.contract
Expand Down
2 changes: 1 addition & 1 deletion script/python/record_facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from dotenv import dotenv_values

_dir = dotenv_values(".env")
version = "2.2.1"
version = "2.2.2"
def record_facets(args):
date = datetime.fromtimestamp(int(args.timestamp)).isoformat()[:10]
record = {}
Expand Down
2 changes: 1 addition & 1 deletion script/python/set_latest_facet_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
_dir = dotenv_values(".env")
dir = Path(_dir["DEPLOYMENT_OUT_DIR"])
file = Path(_dir["DEPLOYMENT_OUT_DIR"] + _dir["DIAMOND_DEPLOYMENT_OUT_FILE"])
version = "2.2.1"
version = "2.2.2"

def set_latest_deployed_facet(args):
record = {}
Expand Down
2 changes: 1 addition & 1 deletion src/client/application/AppManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {ActionTypes} from "src/common/ActionEnum.sol";
* @notice This contract is the permissions contract
*/
contract AppManager is IAppManager, AccessControlEnumerable, IAppLevelEvents, IApplicationEvents, IIntegrationEvents, ReentrancyGuard {
string private constant VERSION = "2.2.1";
string private constant VERSION = "2.2.2";
using ERC165Checker for address;
bytes32 constant SUPER_ADMIN_ROLE = keccak256("SUPER_ADMIN_ROLE");
bytes32 constant APP_ADMIN_ROLE = keccak256("APP_ADMIN_ROLE");
Expand Down
2 changes: 1 addition & 1 deletion src/client/application/ProtocolApplicationHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract ProtocolApplicationHandler is
IAppHandlerErrors,
ProtocolApplicationHandlerCommon
{
string private constant VERSION = "2.2.1";
string private constant VERSION = "2.2.2";
IAppManager immutable appManager;
address public immutable appManagerAddress;
IRuleProcessor immutable ruleProcessor;
Expand Down
2 changes: 1 addition & 1 deletion src/client/application/data/DataModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract contract DataModule is Ownable, IOwnershipErrors, IZeroAddressError {
error AppManagerNotConnected();
error NotAppAdministratorOrOwner();

string private constant VERSION="2.2.1";
string private constant VERSION="2.2.2";
address public immutable dataModuleAppManagerAddress;
address newOwner; // This is used for data contract migration
// slither-disable-next-line constable-states
Expand Down
2 changes: 1 addition & 1 deletion src/client/pricing/ProtocolERC20Pricing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {IApplicationEvents} from "src/common/IEvents.sol";
* @dev This contract doesn't allow any marketplace operations.
*/
contract ProtocolERC20Pricing is Ownable, IApplicationEvents, IProtocolERC20Pricing {
string private constant VERSION="2.2.1";
string private constant VERSION="2.2.2";

mapping(address => uint256) public tokenPrices;

Expand Down
2 changes: 1 addition & 1 deletion src/client/pricing/ProtocolERC721Pricing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {IApplicationEvents} from "src/common/IEvents.sol";
* @dev This contract allows for setting prices on entire collections or by tokenId
*/
contract ProtocolERC721Pricing is Ownable, IApplicationEvents, IProtocolERC721Pricing {
string private constant VERSION="2.2.1";
string private constant VERSION="2.2.2";
using ERC165Checker for address;

mapping(address => mapping(uint256 => uint256)) public nftPrice;
Expand Down
2 changes: 1 addition & 1 deletion src/client/token/handler/diamond/ERC20HandlerMainFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {IHandlerDiamondErrors} from "src/common/IErrors.sol";

contract ERC20HandlerMainFacet is HandlerBase, HandlerUtils, ICommonApplicationHandlerEvents, IHandlerDiamondErrors {

string private constant VERSION="2.2.1";
string private constant VERSION="2.2.2";
/**
* @dev Initializer params
* @param _ruleProcessorProxyAddress of the protocol's Rule Processor contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "diamond-std/implementations/ERC173/ERC173.sol";

contract ERC721HandlerMainFacet is HandlerBase, HandlerUtils, ICommonApplicationHandlerEvents, NFTValuationLimit, IHandlerDiamondErrors {

string private constant VERSION="2.2.1";
string private constant VERSION="2.2.2";

/**
* @dev Initializer params
Expand Down
12 changes: 6 additions & 6 deletions test/client/application/ProtocolApplicationHandlerTests.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ contract ProtocolApplicationHandlerTests is TestCommonFoundry {
switchToAppAdministrator();

vm.expectEmit();
emit AD1467_UpgradedToVersion(appAdministrator, "2.2.1");
(success, ) = address(applicationCoinHandler).call(abi.encodeWithSignature("updateVersion(string)", "2.2.1"));
emit AD1467_UpgradedToVersion(appAdministrator, "2.2.2");
(success, ) = address(applicationCoinHandler).call(abi.encodeWithSignature("updateVersion(string)", "2.2.2"));
assertTrue(success);

vm.expectEmit();
emit AD1467_UpgradedToVersion(appAdministrator, "2.2.1");
(success, ) = address(applicationNFTHandler).call(abi.encodeWithSignature("updateVersion(string)", "2.2.1"));
emit AD1467_UpgradedToVersion(appAdministrator, "2.2.2");
(success, ) = address(applicationNFTHandler).call(abi.encodeWithSignature("updateVersion(string)", "2.2.2"));
assertTrue(success);

vm.assertEq(HandlerVersionFacet(address(applicationCoinHandler)).version(), "2.2.1");
vm.assertEq(HandlerVersionFacet(address(applicationNFTHandler)).version(), "2.2.1");
vm.assertEq(HandlerVersionFacet(address(applicationCoinHandler)).version(), "2.2.2");
vm.assertEq(HandlerVersionFacet(address(applicationNFTHandler)).version(), "2.2.2");
}

// note: make a test for get acc total valuation
Expand Down
2 changes: 1 addition & 1 deletion test/client/pricing/integration/ERC20Pricing.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract ERC20PricingTest is TestCommonFoundry {

function testPricing_ERC20Pricing_PricerVersion() public view {
string memory version = uniBase.version();
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
}

/// Testing setting the price for a single token under the right conditions
Expand Down
2 changes: 1 addition & 1 deletion test/client/pricing/integration/ERC721Pricing.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract ERC721PricingTest is TestCommonFoundry {

function testPricing_ERC721Pricing_PricerVersion() public view {
string memory version = openOcean.version();
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
}

/// Testing setting the price for a single NFT under the right conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ contract ApplicationERC20TokenDeploymentTest is Test, TestCommonFoundry, ERC20Co

switchToAppAdministrator();

HandlerVersionFacet(address(applicationCoinHandler)).updateVersion("2.2.1");
HandlerVersionFacet(address(applicationCoinHandler)).updateVersion("2.2.2");

forkTest = true;
testDeployments = true;
Expand Down
2 changes: 1 addition & 1 deletion test/client/token/ERC20/integration/ERC20CommonTests.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract contract ERC20CommonTests is TestCommonFoundry, DummyAMM, ERC20Util {

function testERC20_ERC20CommonTests_ERC20AndHandlerVersions() public view ifDeploymentTestsEnabled {
string memory version = HandlerVersionFacet(address(applicationCoinHandler)).version();
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
}

function testERC20_ERC20CommonTests_ERC20Handler_RuleProcessorGetter() public view ifDeploymentTestsEnabled {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ contract ApplicationERC721TokenDeploymentTest is Test, TestCommonFoundry, ERC721

switchToAppAdministrator();

HandlerVersionFacet(address(applicationNFTHandler)).updateVersion("2.2.1");
HandlerVersionFacet(address(applicationNFTHandler)).updateVersion("2.2.2");
erc721Pricer.setNFTCollectionPrice(address(applicationNFT), 1 * (10 ** 18));
forkTest = true;
testDeployments = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract contract ERC721CommonTests is TestCommonFoundry, ERC721Util {

function testERC721_ERC721CommonTests_HandlerVersions() public view ifDeploymentTestsEnabled {
string memory version = VersionFacet(address(applicationNFTHandler)).version();
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
}

function testERC20_ERC721CommonTests_ERC721Handler_RuleProcessorGetter() public view ifDeploymentTestsEnabled {
Expand Down
2 changes: 1 addition & 1 deletion test/client/token/ERC721/integration/ERC721Examples.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract ApplicationERC721ExampleTest is TestCommonFoundry {

function testERC721_ApplicationERC721Examples_AndHandlerVersions() public view {
string memory version = VersionFacet(address(applicationNFTHandler)).version();
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
}

function testERC721_ApplicationERC721Examples_OwnerOrAdminMint() public endWithStopPrank {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract ProtocolERC721MinLegacyTest is TestCommonFoundry, DummyNFTAMM, ERC721Ut

function testERC721Legacy_ProtocolERC721Min_HandlerVersions() public view {
string memory version = VersionFacet(address(applicationNFTHandler)).version();
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
}

function testERC721Legacy_ProtocolERC721Min_AlreadyInitialized() public endWithStopPrank(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ contract ApplicationERC721SystemInvariantTest is ApplicationERC721Common {
function invariant_ERC721_external_VersionCanBeCalledByAnyUser() public {
vm.startPrank(USER1, USER1);
bytes memory version = bytes(VersionFacet(address(applicationNFTHandler)).version());
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
}

// Only app admins may connect a handler
Expand Down
8 changes: 4 additions & 4 deletions test/protocol/economic/RuleProcessorDiamondCommonTests.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ abstract contract RuleProcessorDiamondCommonTests is Test, TestCommonFoundry, ER
function testProtocol_RuleProcessorDiamond_RuleProcessorVersion2() public endWithStopPrank ifDeploymentTestsEnabled {
switchToSuperAdmin();
// update version
VersionFacet(address(ruleProcessor)).updateVersion("2.2.1"); // upgrade_version script will replace this version
VersionFacet(address(ruleProcessor)).updateVersion("2.2.2"); // upgrade_version script will replace this version
string memory version = VersionFacet(address(ruleProcessor)).version();
console.log(version);
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
}

function testProtocol_RuleProcessorDiamond_RuleProcessorVersion_Negative() public endWithStopPrank ifDeploymentTestsEnabled {
switchToSuperAdmin();
// update version
VersionFacet(address(ruleProcessor)).updateVersion("2.2.1"); // upgrade_version script will replace this version
VersionFacet(address(ruleProcessor)).updateVersion("2.2.2"); // upgrade_version script will replace this version
string memory version = VersionFacet(address(ruleProcessor)).version();
console.log(version);
assertEq(version, "2.2.1");
assertEq(version, "2.2.2");
// test that no other than the owner can update the version
vm.stopPrank();
if (vm.envAddress("DEPLOYMENT_OWNER") != address(0x0)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract DeploymentProcessorERC20 is ERC20CommonTests {

Blocktime = uint64(block.timestamp);
switchToAppAdministrator();
HandlerVersionFacet(address(applicationCoinHandler)).updateVersion("2.2.1");
HandlerVersionFacet(address(applicationCoinHandler)).updateVersion("2.2.2");
} else {
setUpProcotolAndCreateERC20AndDiamondHandler();
switchToAppAdministrator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract DeploymentProcessorERC721 is ERC721CommonTests {

Blocktime = uint64(block.timestamp);
switchToAppAdministrator();
HandlerVersionFacet(address(applicationCoinHandler)).updateVersion("2.2.1");
HandlerVersionFacet(address(applicationCoinHandler)).updateVersion("2.2.2");
} else {
vm.warp(Blocktime);
setUpProcotolAndCreateERC20AndDiamondHandler();
Expand Down
20 changes: 10 additions & 10 deletions test/util/TestCommonFoundry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
applicationCoin.connectHandlerToToken(address(applicationCoinHandlerSpecialOwner));
/// register the token
applicationAppManager.registerToken("application2", address(applicationCoin));
HandlerVersionFacet(address(applicationCoinHandlerSpecialOwner)).updateVersion("2.2.1");
HandlerVersionFacet(address(applicationCoinHandlerSpecialOwner)).updateVersion("2.2.2");
/// register the token
applicationAppManager.registerToken("FRANK", address(applicationCoin));
/// set up the pricer for erc20
Expand Down Expand Up @@ -687,7 +687,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
erc721.connectHandlerToToken(address(handler));
/// register the token
_applicationAppManager.registerToken(name, address(erc721));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}

function deployAndSetupERC721NoRegister(string memory name, string memory symbol) internal endWithStopPrank returns (UtilApplicationERC721 erc721, HandlerDiamond handler) {
Expand All @@ -697,7 +697,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
ERC721HandlerMainFacet(address(handler)).initialize(address(ruleProcessor), address(applicationAppManager), address(erc721));
switchToAppAdministrator();
erc721.connectHandlerToToken(address(handler));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}

function deployAndSetupERC721Min(string memory name, string memory symbol) internal endWithStopPrank returns (MinimalERC721 erc721, HandlerDiamond handler) {
Expand All @@ -711,7 +711,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
vm.expectEmit(true, true, false, false);
emit AD1467_TokenRegistered(name, address(erc721), 1);
applicationAppManager.registerToken(name, address(erc721));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}

function deployAndSetupERC721MinLegacy(string memory name, string memory symbol) internal endWithStopPrank returns (MinimalERC721Legacy erc721, HandlerDiamond handler) {
Expand All @@ -723,7 +723,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
erc721.connectHandlerToToken(address(handler));
/// register the token
applicationAppManager.registerToken(name, address(erc721));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}

function deployAndSetupERC721MinLegacySell(string memory name, string memory symbol) internal endWithStopPrank returns (MinimalERC721LegacySell erc721, HandlerDiamond handler) {
Expand All @@ -735,7 +735,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
erc721.connectHandlerToToken(address(handler));
/// register the token
applicationAppManager.registerToken(name, address(erc721));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}

function deployAndSetupERC20MinLegacySell(string memory name, string memory symbol) internal endWithStopPrank returns (MinimalERC20LegacySell erc20, HandlerDiamond handler) {
Expand All @@ -747,7 +747,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
erc20.connectHandlerToToken(address(handler));
/// register the token
applicationAppManager.registerToken(name, address(erc20));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}


Expand All @@ -770,7 +770,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
vm.expectEmit(true, true, false, false);
emit AD1467_TokenRegistered(name, address(erc20), 0);
_applicationAppManager.registerToken(name, address(erc20));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}

function deployAndSetupERC20NoRegister(string memory name, string memory symbol) internal endWithStopPrank returns (UtilApplicationERC20 erc20, HandlerDiamond handler) {
Expand All @@ -780,7 +780,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
ERC20HandlerMainFacet(address(handler)).initialize(address(ruleProcessor), address(applicationAppManager), address(erc20));
switchToAppAdministrator();
erc20.connectHandlerToToken(address(handler));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}

function deployAndSetupERC20Min(string memory name, string memory symbol) internal endWithStopPrank returns (MinimalERC20 erc20, HandlerDiamond handler) {
Expand All @@ -792,7 +792,7 @@ abstract contract TestCommonFoundry is TestCommon, EndWithStopPrank, EnabledActi
erc20.connectHandlerToToken(address(handler));
/// register the token
applicationAppManager.registerToken(name, address(erc20));
HandlerVersionFacet(address(handler)).updateVersion("2.2.1");
HandlerVersionFacet(address(handler)).updateVersion("2.2.2");
}

/**
Expand Down

0 comments on commit 9985e73

Please sign in to comment.