From b45c0eba8ee132c559de105ebe1f3ddbe7b4cd0f Mon Sep 17 00:00:00 2001 From: vicnaum Date: Sun, 29 Dec 2024 20:33:06 +0100 Subject: [PATCH 1/2] misc: username primitive renamed to namespace --- .../{IUsername.sol => INamespace.sol} | 20 ++--- .../{IUsernameRule.sol => INamespaceRule.sol} | 2 +- .../LensUsernameTokenURIProvider.sol | 0 .../Username.sol => namespace/Namespace.sol} | 24 +++--- .../NamespaceCore.sol} | 6 +- .../RuleBasedNamespace.sol} | 86 +++++++++---------- contracts/dashboard/factories/LensFactory.sol | 32 ++++--- ...ernameFactory.sol => NamespaceFactory.sol} | 22 ++--- contracts/dashboard/primitives/app/App.sol | 36 ++++---- .../dashboard/primitives/app/AppCore.sol | 28 +++--- contracts/dashboard/primitives/app/IApp.sol | 12 +-- .../SimplePaymentNamespaceRule.sol} | 4 +- .../TokenGatedNamespaceRule.sol} | 4 +- .../UsernameCharsetNamespaceRule.sol} | 28 +++--- .../UsernameLengthNamespaceRule.sol} | 12 +-- .../UsernameReservedNamespaceRule.sol} | 24 +++--- deploy/deployAux.ts | 24 +++--- deploy/deployFactories.ts | 4 +- deploy/deployRules.ts | 15 ++-- 19 files changed, 192 insertions(+), 191 deletions(-) rename contracts/core/interfaces/{IUsername.sol => INamespace.sol} (80%) rename contracts/core/interfaces/{IUsernameRule.sol => INamespaceRule.sol} (97%) rename contracts/core/primitives/{username => namespace}/LensUsernameTokenURIProvider.sol (100%) rename contracts/core/primitives/{username/Username.sol => namespace/Namespace.sol} (93%) rename contracts/core/primitives/{username/UsernameCore.sol => namespace/NamespaceCore.sol} (93%) rename contracts/core/primitives/{username/RuleBasedUsername.sol => namespace/RuleBasedNamespace.sol} (74%) rename contracts/dashboard/factories/{UsernameFactory.sol => NamespaceFactory.sol} (56%) rename contracts/rules/{username/SimplePaymentUsernameRule.sol => namespace/SimplePaymentNamespaceRule.sol} (97%) rename contracts/rules/{username/TokenGatedUsernameRule.sol => namespace/TokenGatedNamespaceRule.sol} (96%) rename contracts/rules/{username/CharsetUsernameRule.sol => namespace/UsernameCharsetNamespaceRule.sol} (86%) rename contracts/rules/{username/LengthUsernameRule.sol => namespace/UsernameLengthNamespaceRule.sol} (89%) rename contracts/rules/{username/ReservedUsernameRule.sol => namespace/UsernameReservedNamespaceRule.sol} (83%) diff --git a/contracts/core/interfaces/IUsername.sol b/contracts/core/interfaces/INamespace.sol similarity index 80% rename from contracts/core/interfaces/IUsername.sol rename to contracts/core/interfaces/INamespace.sol index 10bfe6d9..e4a90085 100644 --- a/contracts/core/interfaces/IUsername.sol +++ b/contracts/core/interfaces/INamespace.sol @@ -5,16 +5,16 @@ pragma solidity ^0.8.0; import {KeyValue, RuleChange, RuleProcessingParams, Rule} from "./../types/Types.sol"; import {IMetadataBased} from "./IMetadataBased.sol"; -interface IUsername is IMetadataBased { - event Lens_Username_RuleConfigured(address indexed rule, bytes32 indexed configSalt, KeyValue[] configParams); +interface INamespace is IMetadataBased { + event Lens_Namespace_RuleConfigured(address indexed rule, bytes32 indexed configSalt, KeyValue[] configParams); - event Lens_Username_RuleReconfigured(address indexed rule, bytes32 indexed configSalt, KeyValue[] configParams); + event Lens_Namespace_RuleReconfigured(address indexed rule, bytes32 indexed configSalt, KeyValue[] configParams); - event Lens_Username_RuleSelectorEnabled( + event Lens_Namespace_RuleSelectorEnabled( address indexed rule, bytes32 indexed configSalt, bool isRequired, bytes4 ruleSelector ); - event Lens_Username_RuleSelectorDisabled( + event Lens_Namespace_RuleSelectorDisabled( address indexed rule, bytes32 indexed configSalt, bool isRequired, bytes4 ruleSelector ); @@ -58,11 +58,11 @@ interface IUsername is IMetadataBased { event Lens_Username_ExtraDataUpdated(bytes32 indexed key, bytes value, bytes indexed valueIndexed); event Lens_Username_ExtraDataRemoved(bytes32 indexed key); - event Lens_Username_MetadataURISet(string metadataURI); + event Lens_Namespace_MetadataURISet(string metadataURI); function setExtraData(KeyValue[] calldata extraDataToSet) external; - function changeUsernameRules(RuleChange[] calldata ruleChanges) external; + function changeNamespaceRules(RuleChange[] calldata ruleChanges) external; function createUsername( address account, @@ -94,7 +94,7 @@ interface IUsername is IMetadataBased { RuleProcessingParams[] calldata ruleProcessingParams ) external; - function setExtraData(string memory username, KeyValue[] calldata extraDataToSet) external; + function setUsernameExtraData(string memory username, KeyValue[] calldata extraDataToSet) external; function usernameOf(address user) external view returns (string memory); @@ -102,9 +102,9 @@ interface IUsername is IMetadataBased { function getNamespace() external view returns (string memory); - function getUsernameRules(bytes4 ruleSelector, bool isRequired) external view returns (Rule[] memory); + function getNamespaceRules(bytes4 ruleSelector, bool isRequired) external view returns (Rule[] memory); function getExtraData(bytes32 key) external view returns (bytes memory); - function getExtraData(string calldata username, bytes32 key) external view returns (bytes memory); + function getUsernameExtraData(string calldata username, bytes32 key) external view returns (bytes memory); } diff --git a/contracts/core/interfaces/IUsernameRule.sol b/contracts/core/interfaces/INamespaceRule.sol similarity index 97% rename from contracts/core/interfaces/IUsernameRule.sol rename to contracts/core/interfaces/INamespaceRule.sol index 324befea..c7cec123 100644 --- a/contracts/core/interfaces/IUsernameRule.sol +++ b/contracts/core/interfaces/INamespaceRule.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {KeyValue} from "./../types/Types.sol"; -interface IUsernameRule { +interface INamespaceRule { function configure(bytes32 configSalt, KeyValue[] calldata ruleParams) external; function processCreation( diff --git a/contracts/core/primitives/username/LensUsernameTokenURIProvider.sol b/contracts/core/primitives/namespace/LensUsernameTokenURIProvider.sol similarity index 100% rename from contracts/core/primitives/username/LensUsernameTokenURIProvider.sol rename to contracts/core/primitives/namespace/LensUsernameTokenURIProvider.sol diff --git a/contracts/core/primitives/username/Username.sol b/contracts/core/primitives/namespace/Namespace.sol similarity index 93% rename from contracts/core/primitives/username/Username.sol rename to contracts/core/primitives/namespace/Namespace.sol index 0c15d266..faabbdd9 100644 --- a/contracts/core/primitives/username/Username.sol +++ b/contracts/core/primitives/namespace/Namespace.sol @@ -2,11 +2,11 @@ // Copyright (C) 2024 Lens Labs. All Rights Reserved. pragma solidity ^0.8.0; -import {UsernameCore as Core} from "./UsernameCore.sol"; -import {IUsername} from "./../../interfaces/IUsername.sol"; +import {NamespaceCore as Core} from "./NamespaceCore.sol"; +import {INamespace} from "./../../interfaces/INamespace.sol"; import {IAccessControl} from "./../../interfaces/IAccessControl.sol"; import {RuleChange, RuleProcessingParams, KeyValue} from "./../../types/Types.sol"; -import {RuleBasedUsername} from "./RuleBasedUsername.sol"; +import {RuleBasedNamespace} from "./RuleBasedNamespace.sol"; import {AccessControlled} from "./../../access/AccessControlled.sol"; import {ExtraStorageBased} from "./../../base/ExtraStorageBased.sol"; import {IAccessControl} from "./../../interfaces/IAccessControl.sol"; @@ -15,17 +15,17 @@ import {LensERC721} from "./../../base/LensERC721.sol"; import {ITokenURIProvider} from "./../../interfaces/ITokenURIProvider.sol"; import {SourceStampBased} from "./../../base/SourceStampBased.sol"; import {MetadataBased} from "./../../base/MetadataBased.sol"; -// TODO: Rename to Namespace (cause "Username" is an entity of the primitive "Namespace", like "Post" of "Feed") -contract Username is - IUsername, +contract Namespace is + INamespace, LensERC721, - RuleBasedUsername, + RuleBasedNamespace, AccessControlled, ExtraStorageBased, SourceStampBased, MetadataBased { + // TODO: Why is this event not in the INamespace interface? event Lens_Username_Transfer(address indexed from, address indexed to, uint256 indexed tokenId); // TODO: Do we want more granular resources here? Like add/update/remove PIDs? Or are we OK with the multi-purpose? @@ -48,11 +48,11 @@ contract Username is Core.$storage().namespace = namespace; _setMetadataURI(metadataURI); _emitPIDs(); - emit Events.Lens_Contract_Deployed("username", "lens.username", "username", "lens.username"); + emit Events.Lens_Contract_Deployed("namespace", "lens.namespace", "namespace", "lens.namespace"); } function _emitMetadataURISet(string memory metadataURI) internal override { - emit Lens_Username_MetadataURISet(metadataURI); + emit Lens_Namespace_MetadataURISet(metadataURI); } function _emitPIDs() internal override { @@ -170,7 +170,6 @@ contract Username is emit Lens_Username_Unassigned(username, account, customParams, ruleProcessingParams, source); } - // TODO: Rename this to setNamespaceExtraData/setPrimitiveExtraData? function setExtraData(KeyValue[] calldata extraDataToSet) external override { _requireAccess(msg.sender, SET_EXTRA_DATA_PID); for (uint256 i = 0; i < extraDataToSet.length; i++) { @@ -192,8 +191,7 @@ contract Username is } } - // TODO: Rename this to setUsernameExtraData? - function setExtraData(string calldata username, KeyValue[] calldata extraDataToSet) external { + function setUsernameExtraData(string calldata username, KeyValue[] calldata extraDataToSet) external { uint256 id = _computeId(username); address owner = _ownerOf(id); require(msg.sender == owner); @@ -276,7 +274,7 @@ contract Username is return _getPrimitiveExtraData(key); } - function getExtraData(string calldata username, bytes32 key) external view override returns (bytes memory) { + function getUsernameExtraData(string calldata username, bytes32 key) external view override returns (bytes memory) { uint256 tokenId = _computeId(username); address owner = _ownerOf(tokenId); return _getEntityExtraData(owner, tokenId, key); diff --git a/contracts/core/primitives/username/UsernameCore.sol b/contracts/core/primitives/namespace/NamespaceCore.sol similarity index 93% rename from contracts/core/primitives/username/UsernameCore.sol rename to contracts/core/primitives/namespace/NamespaceCore.sol index 1e4314a4..b25571bd 100644 --- a/contracts/core/primitives/username/UsernameCore.sol +++ b/contracts/core/primitives/namespace/NamespaceCore.sol @@ -2,7 +2,7 @@ // Copyright (C) 2024 Lens Labs. All Rights Reserved. pragma solidity ^0.8.0; -library UsernameCore { +library NamespaceCore { // Storage struct Storage { @@ -12,8 +12,8 @@ library UsernameCore { mapping(address => string) accountToUsername; } - // keccak256('lens.username.core.storage') - bytes32 constant CORE_STORAGE_SLOT = 0x99859b45773300f37fd6dda5224af64cfd118242932458b3472b7865bfa1b249; + // keccak256('lens.namespace.core.storage') + bytes32 constant CORE_STORAGE_SLOT = 0x4633c806713e508283f343c3870478c20173363bf79b100380c3b7de19d23da3; function $storage() internal pure returns (Storage storage _storage) { assembly { diff --git a/contracts/core/primitives/username/RuleBasedUsername.sol b/contracts/core/primitives/namespace/RuleBasedNamespace.sol similarity index 74% rename from contracts/core/primitives/username/RuleBasedUsername.sol rename to contracts/core/primitives/namespace/RuleBasedNamespace.sol index be1f5132..8ce7f368 100644 --- a/contracts/core/primitives/username/RuleBasedUsername.sol +++ b/contracts/core/primitives/namespace/RuleBasedNamespace.sol @@ -2,45 +2,45 @@ // Copyright (C) 2024 Lens Labs. All Rights Reserved. pragma solidity ^0.8.0; -import {IUsernameRule} from "./../../interfaces/IUsernameRule.sol"; +import {INamespaceRule} from "./../../interfaces/INamespaceRule.sol"; import {RulesStorage, RulesLib} from "./../../libraries/RulesLib.sol"; import {RuleChange, RuleProcessingParams, Rule, KeyValue} from "./../../types/Types.sol"; -import {IUsername} from "./../../interfaces/IUsername.sol"; +import {INamespace} from "./../../interfaces/INamespace.sol"; import {RuleBasedPrimitive} from "./../../base/RuleBasedPrimitive.sol"; -abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { +abstract contract RuleBasedNamespace is INamespace, RuleBasedPrimitive { using RulesLib for RulesStorage; struct RuleBasedStorage { - RulesStorage usernameRulesStorage; + RulesStorage namespaceRulesStorage; } - // keccak256('lens.rule.based.username.storage') - bytes32 constant RULE_BASED_USERNAME_STORAGE_SLOT = - 0xdb7398dc7b1d4544bdce6830d22802260c007b71c45e9fa93889a6ec0667be87; + // keccak256('lens.rule.based.namespace.storage') + bytes32 constant RULE_BASED_NAMESPACE_STORAGE_SLOT = + 0x217b52007082874e501211ba85dc5d9de80968a125bf61e48698a792fb130140; function $ruleBasedStorage() private pure returns (RuleBasedStorage storage _storage) { assembly { - _storage.slot := RULE_BASED_USERNAME_STORAGE_SLOT + _storage.slot := RULE_BASED_NAMESPACE_STORAGE_SLOT } } - function $usernameRulesStorage() private view returns (RulesStorage storage _storage) { - return $ruleBasedStorage().usernameRulesStorage; + function $namespaceRulesStorage() private view returns (RulesStorage storage _storage) { + return $ruleBasedStorage().namespaceRulesStorage; } //////////////////////////// CONFIGURATION FUNCTIONS //////////////////////////// - function changeUsernameRules(RuleChange[] calldata ruleChanges) external virtual override { - _changePrimitiveRules($usernameRulesStorage(), ruleChanges); + function changeNamespaceRules(RuleChange[] calldata ruleChanges) external virtual override { + _changePrimitiveRules($namespaceRulesStorage(), ruleChanges); } function _supportedPrimitiveRuleSelectors() internal view virtual override returns (bytes4[] memory) { bytes4[] memory selectors = new bytes4[](4); - selectors[0] = IUsernameRule.processCreation.selector; - selectors[1] = IUsernameRule.processRemoval.selector; - selectors[2] = IUsernameRule.processAssigning.selector; - selectors[3] = IUsernameRule.processUnassigning.selector; + selectors[0] = INamespaceRule.processCreation.selector; + selectors[1] = INamespaceRule.processRemoval.selector; + selectors[2] = INamespaceRule.processAssigning.selector; + selectors[3] = INamespaceRule.processUnassigning.selector; return selectors; } @@ -48,7 +48,7 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { bytes32 configSalt, KeyValue[] calldata ruleParams ) internal pure override returns (bytes memory) { - return abi.encodeCall(IUsernameRule.configure, (configSalt, ruleParams)); + return abi.encodeCall(INamespaceRule.configure, (configSalt, ruleParams)); } function _emitPrimitiveRuleConfiguredEvent( @@ -58,9 +58,9 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { KeyValue[] calldata ruleParams ) internal override { if (wasAlreadyConfigured) { - emit IUsername.Lens_Username_RuleReconfigured(ruleAddress, configSalt, ruleParams); + emit INamespace.Lens_Namespace_RuleReconfigured(ruleAddress, configSalt, ruleParams); } else { - emit IUsername.Lens_Username_RuleConfigured(ruleAddress, configSalt, ruleParams); + emit INamespace.Lens_Namespace_RuleConfigured(ruleAddress, configSalt, ruleParams); } } @@ -72,22 +72,22 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { bytes4 ruleSelector ) internal override { if (enabled) { - emit Lens_Username_RuleSelectorEnabled(ruleAddress, configSalt, isRequired, ruleSelector); + emit Lens_Namespace_RuleSelectorEnabled(ruleAddress, configSalt, isRequired, ruleSelector); } else { - emit Lens_Username_RuleSelectorDisabled(ruleAddress, configSalt, isRequired, ruleSelector); + emit Lens_Namespace_RuleSelectorDisabled(ruleAddress, configSalt, isRequired, ruleSelector); } } function _amountOfRules(bytes4 ruleSelector) internal view returns (uint256) { - return $usernameRulesStorage()._getRulesArray(ruleSelector, false).length - + $usernameRulesStorage()._getRulesArray(ruleSelector, true).length; + return $namespaceRulesStorage()._getRulesArray(ruleSelector, false).length + + $namespaceRulesStorage()._getRulesArray(ruleSelector, true).length; } - function getUsernameRules( + function getNamespaceRules( bytes4 ruleSelector, bool isRequired ) external view virtual override returns (Rule[] memory) { - return $usernameRulesStorage()._getRulesArray(ruleSelector, isRequired); + return $namespaceRulesStorage()._getRulesArray(ruleSelector, isRequired); } //////////////////////////// PROCESSING FUNCTIONS //////////////////////////// @@ -103,7 +103,7 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { ) internal returns (bool, bytes memory) { return rule.call( abi.encodeCall( - IUsernameRule.processCreation, + INamespaceRule.processCreation, (configSalt, originalMsgSender, account, username, primitiveCustomParams, ruleCustomParams) ) ); @@ -116,9 +116,9 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { KeyValue[] calldata primitiveCustomParams, RuleProcessingParams[] calldata rulesProcessingParams ) internal { - _processUsernameRule( + _processNamespaceRule( _encodeAndCallProcessCreation, - IUsernameRule.processCreation.selector, + INamespaceRule.processCreation.selector, originalMsgSender, account, username, @@ -138,7 +138,7 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { ) internal returns (bool, bytes memory) { return rule.call( abi.encodeCall( - IUsernameRule.processRemoval, + INamespaceRule.processRemoval, (configSalt, originalMsgSender, username, primitiveCustomParams, ruleCustomParams) ) ); @@ -150,9 +150,9 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { KeyValue[] calldata primitiveCustomParams, RuleProcessingParams[] calldata rulesProcessingParams ) internal { - _processUsernameRule( + _processNamespaceRule( _encodeAndCallProcessRemoval, - IUsernameRule.processRemoval.selector, + INamespaceRule.processRemoval.selector, originalMsgSender, address(0), username, @@ -172,7 +172,7 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { ) internal returns (bool, bytes memory) { return rule.call( abi.encodeCall( - IUsernameRule.processAssigning, + INamespaceRule.processAssigning, (configSalt, originalMsgSender, account, username, primitiveCustomParams, ruleCustomParams) ) ); @@ -185,9 +185,9 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { KeyValue[] calldata primitiveCustomParams, RuleProcessingParams[] calldata rulesProcessingParams ) internal { - _processUsernameRule( + _processNamespaceRule( _encodeAndCallProcessAssigning, - IUsernameRule.processAssigning.selector, + INamespaceRule.processAssigning.selector, originalMsgSender, account, username, @@ -207,7 +207,7 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { ) internal returns (bool, bytes memory) { return rule.call( abi.encodeCall( - IUsernameRule.processUnassigning, + INamespaceRule.processUnassigning, (configSalt, originalMsgSender, account, username, primitiveCustomParams, ruleCustomParams) ) ); @@ -220,9 +220,9 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { KeyValue[] calldata primitiveCustomParams, RuleProcessingParams[] calldata rulesProcessingParams ) internal { - _processUsernameRule( + _processNamespaceRule( _encodeAndCallProcessUnassigning, - IUsernameRule.processUnassigning.selector, + INamespaceRule.processUnassigning.selector, originalMsgSender, account, username, @@ -231,7 +231,7 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { ); } - function _processUsernameRule( + function _processNamespaceRule( function(address,bytes32,address,address,string memory,KeyValue[] calldata,KeyValue[] memory) internal returns (bool,bytes memory) encodeAndCall, bytes4 ruleSelector, @@ -242,8 +242,8 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { RuleProcessingParams[] calldata rulesProcessingParams ) private { // Check required rules (AND-combined rules) - for (uint256 i = 0; i < $usernameRulesStorage().requiredRules[ruleSelector].length; i++) { - Rule memory rule = $usernameRulesStorage().requiredRules[ruleSelector][i]; + for (uint256 i = 0; i < $namespaceRulesStorage().requiredRules[ruleSelector].length; i++) { + Rule memory rule = $namespaceRulesStorage().requiredRules[ruleSelector][i]; for (uint256 j = 0; j < rulesProcessingParams.length; j++) { KeyValue[] memory ruleParams = new KeyValue[](0); if ( @@ -265,8 +265,8 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { } } // Check any-of rules (OR-combined rules) - for (uint256 i = 0; i < $usernameRulesStorage().anyOfRules[ruleSelector].length; i++) { - Rule memory rule = $usernameRulesStorage().anyOfRules[ruleSelector][i]; + for (uint256 i = 0; i < $namespaceRulesStorage().anyOfRules[ruleSelector].length; i++) { + Rule memory rule = $namespaceRulesStorage().anyOfRules[ruleSelector][i]; for (uint256 j = 0; j < rulesProcessingParams.length; j++) { KeyValue[] memory ruleParams = new KeyValue[](0); if ( @@ -290,6 +290,6 @@ abstract contract RuleBasedUsername is IUsername, RuleBasedPrimitive { } } // If there are any-of rules and it reached this point, it means all of them failed. - require($usernameRulesStorage().anyOfRules[ruleSelector].length > 0, "All of the any-of rules failed"); + require($namespaceRulesStorage().anyOfRules[ruleSelector].length > 0, "All of the any-of rules failed"); } } diff --git a/contracts/dashboard/factories/LensFactory.sol b/contracts/dashboard/factories/LensFactory.sol index 65ce1694..be5458ec 100644 --- a/contracts/dashboard/factories/LensFactory.sol +++ b/contracts/dashboard/factories/LensFactory.sol @@ -17,23 +17,21 @@ import { import {GroupFactory} from "./GroupFactory.sol"; import {FeedFactory} from "./FeedFactory.sol"; import {GraphFactory} from "./GraphFactory.sol"; -import {UsernameFactory} from "./UsernameFactory.sol"; +import {NamespaceFactory} from "./NamespaceFactory.sol"; import {AppFactory, AppInitialProperties} from "./AppFactory.sol"; import {AccessControlFactory} from "./AccessControlFactory.sol"; import {AccountFactory} from "./AccountFactory.sol"; import {IAccount, AccountManagerPermissions} from "./../account/IAccount.sol"; -import {IUsername} from "./../../core/interfaces/IUsername.sol"; +import {INamespace} from "./../../core/interfaces/INamespace.sol"; import {ITokenURIProvider} from "./../../core/interfaces/ITokenURIProvider.sol"; -import {LensUsernameTokenURIProvider} from "./../../core/primitives/username/LensUsernameTokenURIProvider.sol"; +import {LensUsernameTokenURIProvider} from "./../../core/primitives/namespace/LensUsernameTokenURIProvider.sol"; import {IFeedRule} from "./../../core/interfaces/IFeedRule.sol"; import {IGraphRule} from "./../../core/interfaces/IGraphRule.sol"; import {GROUP_PARAM_KEY} from "./../../rules/feed/GroupGatedFeedRule.sol"; // TODO: Move this some place else or remove interface IOwnable { - function transferOwnership( - address newOwner - ) external; + function transferOwnership(address newOwner) external; function owner() external view returns (address); } @@ -53,7 +51,7 @@ contract LensFactory { GroupFactory internal immutable GROUP_FACTORY; FeedFactory internal immutable FEED_FACTORY; GraphFactory internal immutable GRAPH_FACTORY; - UsernameFactory internal immutable USERNAME_FACTORY; + NamespaceFactory internal immutable NAMESPACE_FACTORY; IAccessControl internal immutable _factoryOwnedAccessControl; address internal immutable _accountBlockingRule; address internal immutable _groupGatedFeedRule; @@ -65,7 +63,7 @@ contract LensFactory { GroupFactory groupFactory, FeedFactory feedFactory, GraphFactory graphFactory, - UsernameFactory usernameFactory, + NamespaceFactory namespaceFactory, address accountBlockingRule, address groupGatedFeedRule ) { @@ -75,7 +73,7 @@ contract LensFactory { GROUP_FACTORY = groupFactory; FEED_FACTORY = feedFactory; GRAPH_FACTORY = graphFactory; - USERNAME_FACTORY = usernameFactory; + NAMESPACE_FACTORY = namespaceFactory; _factoryOwnedAccessControl = new RoleBasedAccessControl({owner: address(this)}); _accountBlockingRule = accountBlockingRule; _groupGatedFeedRule = groupGatedFeedRule; @@ -87,7 +85,7 @@ contract LensFactory { address owner, address[] calldata accountManagers, AccountManagerPermissions[] calldata accountManagersPermissions, - address usernamePrimitiveAddress, + address namespacePrimitiveAddress, string calldata username, SourceStamp calldata accountCreationSourceStamp, KeyValue[] calldata createUsernameCustomParams, @@ -106,14 +104,14 @@ contract LensFactory { accountCreationSourceStamp, accountExtraData ); - IUsername usernamePrimitive = IUsername(usernamePrimitiveAddress); + INamespace namespacePrimitive = INamespace(namespacePrimitiveAddress); bytes memory txData = abi.encodeCall( - usernamePrimitive.createUsername, + namespacePrimitive.createUsername, (account, username, createUsernameCustomParams, createUsernameRuleProcessingParams, usernameExtraData) ); - IAccount(payable(account)).executeTransaction(usernamePrimitiveAddress, uint256(0), txData); + IAccount(payable(account)).executeTransaction(namespacePrimitiveAddress, uint256(0), txData); txData = abi.encodeCall( - usernamePrimitive.assignUsername, + namespacePrimitive.assignUsername, ( account, username, @@ -123,7 +121,7 @@ contract LensFactory { assignRuleProcessingParams ) ); - IAccount(payable(account)).executeTransaction(usernamePrimitiveAddress, uint256(0), txData); + IAccount(payable(account)).executeTransaction(namespacePrimitiveAddress, uint256(0), txData); IOwnable(account).transferOwnership(owner); return account; } @@ -271,7 +269,7 @@ contract LensFactory { ); } - function deployUsername( + function deployNamespace( string calldata namespace, string calldata metadataURI, address owner, @@ -282,7 +280,7 @@ contract LensFactory { string calldata nftSymbol ) external returns (address) { ITokenURIProvider tokenURIProvider = new LensUsernameTokenURIProvider(); // TODO! - return USERNAME_FACTORY.deployUsername( + return NAMESPACE_FACTORY.deployNamespace( namespace, metadataURI, _deployAccessControl(owner, admins), diff --git a/contracts/dashboard/factories/UsernameFactory.sol b/contracts/dashboard/factories/NamespaceFactory.sol similarity index 56% rename from contracts/dashboard/factories/UsernameFactory.sol rename to contracts/dashboard/factories/NamespaceFactory.sol index c586c455..6bbe23af 100644 --- a/contracts/dashboard/factories/UsernameFactory.sol +++ b/contracts/dashboard/factories/NamespaceFactory.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.0; import {IAccessControl} from "./../../core/interfaces/IAccessControl.sol"; -import {Username} from "./../../core/primitives/username/Username.sol"; +import {Namespace} from "./../../core/primitives/namespace/Namespace.sol"; import {RoleBasedAccessControl} from "./../../core/access/RoleBasedAccessControl.sol"; import {RuleChange, KeyValue} from "./../../core/types/Types.sol"; import {ITokenURIProvider} from "./../../core/interfaces/ITokenURIProvider.sol"; -contract UsernameFactory { - event Lens_UsernameFactory_Deployment(address indexed username, string namespace, string metadataURI); +contract NamespaceFactory { + event Lens_NamespaceFactory_Deployment(address indexed namespaceAddress, string namespace, string metadataURI); IAccessControl internal immutable _factoryOwnedAccessControl; @@ -17,7 +17,7 @@ contract UsernameFactory { _factoryOwnedAccessControl = new RoleBasedAccessControl({owner: address(this)}); } - function deployUsername( + function deployNamespace( string memory namespace, string memory metadataURI, IAccessControl accessControl, @@ -27,12 +27,12 @@ contract UsernameFactory { string memory nftSymbol, ITokenURIProvider tokenURIProvider ) external returns (address) { - Username username = - new Username(namespace, metadataURI, _factoryOwnedAccessControl, nftName, nftSymbol, tokenURIProvider); - username.changeUsernameRules(ruleChanges); - username.setExtraData(extraData); - username.setAccessControl(accessControl); - emit Lens_UsernameFactory_Deployment(address(username), namespace, metadataURI); - return address(username); + Namespace namespacePrimitive = + new Namespace(namespace, metadataURI, _factoryOwnedAccessControl, nftName, nftSymbol, tokenURIProvider); + namespacePrimitive.changeNamespaceRules(ruleChanges); + namespacePrimitive.setExtraData(extraData); + namespacePrimitive.setAccessControl(accessControl); + emit Lens_NamespaceFactory_Deployment(address(namespacePrimitive), namespace, metadataURI); + return address(namespacePrimitive); } } diff --git a/contracts/dashboard/primitives/app/App.sol b/contracts/dashboard/primitives/app/App.sol index bdae7d61..c21b7271 100644 --- a/contracts/dashboard/primitives/app/App.sol +++ b/contracts/dashboard/primitives/app/App.sol @@ -14,7 +14,7 @@ import {ISource} from "./../../../core/interfaces/ISource.sol"; struct AppInitialProperties { address graph; address[] feeds; - address username; + address namespace; address[] groups; address defaultFeed; address[] signers; @@ -45,7 +45,7 @@ contract App is IApp, BaseSource, AccessControlled { _setTreasury(initialProps.treasury); _setGraph(initialProps.graph); _addFeeds(initialProps.feeds); - _setUsername(initialProps.username); + _setNamespace(initialProps.namespace); _addGroups(initialProps.groups); _setDefaultFeed(initialProps.defaultFeed); _addSigners(initialProps.signers); @@ -154,25 +154,25 @@ contract App is IApp, BaseSource, AccessControlled { emit Lens_App_DefaultFeedSet(feed); } - ///////////////// Username + ///////////////// Namespace - function setUsername(address username) external override { + function setNamespace(address namespace) external override { _requireAccess(msg.sender, SET_PRIMITIVES_PID); - _setUsername(username); + _setNamespace(namespace); } // In this implementation we allow to have a single graph only. - function _setUsername(address username) internal { - address usernamePreviouslySet = Core.$storage().defaultUsername; - if (usernamePreviouslySet != address(0)) { - Core._removeUsername(usernamePreviouslySet); - emit Lens_App_UsernameRemoved(usernamePreviouslySet); + function _setNamespace(address namespace) internal { + address namespacePreviouslySet = Core.$storage().defaultNamespace; + if (namespacePreviouslySet != address(0)) { + Core._removeNamespace(namespacePreviouslySet); + emit Lens_App_NamespaceRemoved(namespacePreviouslySet); } - if (username != address(0)) { - emit Lens_App_UsernameAdded(username); - Core._addUsername(username); + if (namespace != address(0)) { + emit Lens_App_NamespaceAdded(namespace); + Core._addNamespace(namespace); } - Core._setDefaultUsername(username); + Core._setDefaultNamespace(namespace); } ///////////////// Group @@ -317,8 +317,8 @@ contract App is IApp, BaseSource, AccessControlled { return Core.$storage().feeds; } - function getUsernames() external view override returns (address[] memory) { - return Core.$storage().usernames; + function getNamespaces() external view override returns (address[] memory) { + return Core.$storage().namespaces; } function getGroups() external view override returns (address[] memory) { @@ -333,8 +333,8 @@ contract App is IApp, BaseSource, AccessControlled { return Core.$storage().defaultFeed; } - function getDefaultUsername() external view override returns (address) { - return Core.$storage().defaultUsername; + function getDefaultNamespace() external view override returns (address) { + return Core.$storage().defaultNamespace; } function getDefaultGroup() external view override returns (address) { diff --git a/contracts/dashboard/primitives/app/AppCore.sol b/contracts/dashboard/primitives/app/AppCore.sol index 59a5f74a..44413ec9 100644 --- a/contracts/dashboard/primitives/app/AppCore.sol +++ b/contracts/dashboard/primitives/app/AppCore.sol @@ -22,17 +22,17 @@ library AppCore { mapping(address => ArrayStorageHelper) paymasterStorageHelper; mapping(address => ArrayStorageHelper) graphStorageHelper; mapping(address => ArrayStorageHelper) feedStorageHelper; - mapping(address => ArrayStorageHelper) usernameStorageHelper; + mapping(address => ArrayStorageHelper) namespaceStorageHelper; mapping(address => ArrayStorageHelper) groupStorageHelper; address[] signers; address[] paymasters; address[] graphs; address[] feeds; - address[] usernames; + address[] namespaces; address[] groups; address defaultGraph; address defaultFeed; - address defaultUsername; + address defaultNamespace; address defaultGroup; address defaultPaymaster; mapping(bytes32 => bytes) extraData; @@ -115,23 +115,23 @@ library AppCore { return $storage().feedStorageHelper[feed].isSet; } - ////////////// Username + ////////////// Namespace - function _addUsername(address username) internal { - _add(username, $storage().usernames, $storage().usernameStorageHelper); + function _addNamespace(address namespace) internal { + _add(namespace, $storage().namespaces, $storage().namespaceStorageHelper); } - function _removeUsername(address username) internal { - _remove(username, $storage().usernames, $storage().usernameStorageHelper); + function _removeNamespace(address namespace) internal { + _remove(namespace, $storage().namespaces, $storage().namespaceStorageHelper); } - function _setDefaultUsername(address username) internal returns (bool) { - bool wasAValuePreviouslySet = $storage().defaultUsername != address(0); - if (username != address(0)) { - // address(0) allowed as a way to remove the default username - require($storage().usernameStorageHelper[username].isSet, "NOT_FOUND"); + function _setDefaultNamespace(address namespace) internal returns (bool) { + bool wasAValuePreviouslySet = $storage().defaultNamespace != address(0); + if (namespace != address(0)) { + // address(0) allowed as a way to remove the default namespace + require($storage().namespaceStorageHelper[namespace].isSet, "NOT_FOUND"); } - $storage().defaultUsername = username; + $storage().defaultNamespace = namespace; return wasAValuePreviouslySet; } diff --git a/contracts/dashboard/primitives/app/IApp.sol b/contracts/dashboard/primitives/app/IApp.sol index bd88cd0c..fffa26af 100644 --- a/contracts/dashboard/primitives/app/IApp.sol +++ b/contracts/dashboard/primitives/app/IApp.sol @@ -15,9 +15,9 @@ interface IApp is IMetadataBased { event Lens_App_FeedRemoved(address indexed feed); event Lens_App_DefaultFeedSet(address indexed feed); - // Username - event Lens_App_UsernameAdded(address indexed username); - event Lens_App_UsernameRemoved(address indexed username); + // Namespace + event Lens_App_NamespaceAdded(address indexed namespace); + event Lens_App_NamespaceRemoved(address indexed namespace); // Group event Lens_App_GroupAdded(address indexed group); @@ -56,7 +56,7 @@ interface IApp is IMetadataBased { function setGraph(address graph) external; - function setUsername(address username) external; + function setNamespace(address namespace) external; function addSigners(address[] memory signers) external; function removeSigners(address[] memory signers) external; @@ -77,7 +77,7 @@ interface IApp is IMetadataBased { function getGraphs() external view returns (address[] memory); - function getUsernames() external view returns (address[] memory); + function getNamespaces() external view returns (address[] memory); function getSigners() external view returns (address[] memory); @@ -89,7 +89,7 @@ interface IApp is IMetadataBased { function getDefaultGraph() external view returns (address); function getDefaultFeed() external view returns (address); - function getDefaultUsername() external view returns (address); + function getDefaultNamespace() external view returns (address); function getDefaultGroup() external view returns (address); function getDefaultPaymaster() external view returns (address); } diff --git a/contracts/rules/username/SimplePaymentUsernameRule.sol b/contracts/rules/namespace/SimplePaymentNamespaceRule.sol similarity index 97% rename from contracts/rules/username/SimplePaymentUsernameRule.sol rename to contracts/rules/namespace/SimplePaymentNamespaceRule.sol index 247894af..2c191e00 100644 --- a/contracts/rules/username/SimplePaymentUsernameRule.sol +++ b/contracts/rules/namespace/SimplePaymentNamespaceRule.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.0; import {IAccessControl} from "./../../core/interfaces/IAccessControl.sol"; -import {IUsernameRule} from "./../../core/interfaces/IUsernameRule.sol"; +import {INamespaceRule} from "./../../core/interfaces/INamespaceRule.sol"; import {AccessControlLib} from "./../../core/libraries/AccessControlLib.sol"; import {Events} from "./../../core/types/Events.sol"; import {SimplePaymentRule} from "./../base/SimplePaymentRule.sol"; import {KeyValue} from "./../../core/types/Types.sol"; -contract SimplePaymentUsernameRule is SimplePaymentRule, IUsernameRule { +contract SimplePaymentNamespaceRule is SimplePaymentRule, INamespaceRule { using AccessControlLib for IAccessControl; using AccessControlLib for address; diff --git a/contracts/rules/username/TokenGatedUsernameRule.sol b/contracts/rules/namespace/TokenGatedNamespaceRule.sol similarity index 96% rename from contracts/rules/username/TokenGatedUsernameRule.sol rename to contracts/rules/namespace/TokenGatedNamespaceRule.sol index 93313c68..0f971ea6 100644 --- a/contracts/rules/username/TokenGatedUsernameRule.sol +++ b/contracts/rules/namespace/TokenGatedNamespaceRule.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.0; import {IAccessControl} from "./../../core/interfaces/IAccessControl.sol"; -import {IUsernameRule} from "./../../core/interfaces/IUsernameRule.sol"; +import {INamespaceRule} from "./../../core/interfaces/INamespaceRule.sol"; import {AccessControlLib} from "./../../core/libraries/AccessControlLib.sol"; import {Events} from "./../../core/types/Events.sol"; import {TokenGatedRule} from "./../base/TokenGatedRule.sol"; import {KeyValue} from "./../../core/types/Types.sol"; -contract TokenGatedUsernameRule is TokenGatedRule, IUsernameRule { +contract TokenGatedNamespaceRule is TokenGatedRule, INamespaceRule { using AccessControlLib for IAccessControl; using AccessControlLib for address; diff --git a/contracts/rules/username/CharsetUsernameRule.sol b/contracts/rules/namespace/UsernameCharsetNamespaceRule.sol similarity index 86% rename from contracts/rules/username/CharsetUsernameRule.sol rename to contracts/rules/namespace/UsernameCharsetNamespaceRule.sol index ac095557..11eb6ed3 100644 --- a/contracts/rules/username/CharsetUsernameRule.sol +++ b/contracts/rules/namespace/UsernameCharsetNamespaceRule.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.0; import {IAccessControl} from "./../../core/interfaces/IAccessControl.sol"; -import {IUsernameRule} from "./../../core/interfaces/IUsernameRule.sol"; +import {INamespaceRule} from "./../../core/interfaces/INamespaceRule.sol"; import {AccessControlLib} from "./../../core/libraries/AccessControlLib.sol"; import {Events} from "./../../core/types/Events.sol"; import {KeyValue} from "./../../core/types/Types.sol"; import {MetadataBased} from "./../../core/base/MetadataBased.sol"; -contract CharsetUsernameRule is IUsernameRule, MetadataBased { +contract UsernameCharsetNamespaceRule is INamespaceRule, MetadataBased { event Lens_Rule_MetadataURISet(string metadataURI); using AccessControlLib for IAccessControl; @@ -22,22 +22,22 @@ contract CharsetUsernameRule is IUsernameRule, MetadataBased { // keccak256("lens.param.key.accessControl"); bytes32 immutable ACCESS_CONTROL_PARAM_KEY = 0x6552dd4db64bdb68f2725e4865ecb072df1c2befcfb455b69e2d2b886a8e185e; - // keccak256("lens.rules.username.CharsetUsernameRule.param.key.CharsetRestrictions.allowNumeric"); - bytes32 immutable ALLOW_NUMERIC_PARAM_KEY = 0x99d79d7e6786d3f6700df19cf91a74d5ed8a7432315a6bd2c8e4b2f31d3ac48a; - // keccak256("lens.rules.username.CharsetUsernameRule.param.key.CharsetRestrictions.allowLatinLowercase"); + // keccak256("lens.rules.namespace.UsernameCharsetNamespaceRule.param.key.CharsetRestrictions.allowNumeric"); + bytes32 immutable ALLOW_NUMERIC_PARAM_KEY = 0xa5343d1f72fad751af812c7d2f314beb3946101f8926b126c90bf56185650e66; + // keccak256("lens.rules.namespace.UsernameCharsetNamespaceRule.param.key.CharsetRestrictions.allowLatinLowercase"); bytes32 immutable ALLOW_LATIN_LOWERCASE_PARAM_KEY = - 0xa735991047ce9edafbd39838f3238bb614995aa5c14aa6166b56c77068c0a7ed; - // keccak256("lens.rules.username.CharsetUsernameRule.param.key.CharsetRestrictions.allowLatinUppercase"); + 0x48000ae8df8d4602963f7fd9813736c2ad0dfa204db72c382d7763bdca24627d; + // keccak256("lens.rules.namespace.UsernameCharsetNamespaceRule.param.key.CharsetRestrictions.allowLatinUppercase"); bytes32 immutable ALLOW_LATIN_UPPERCASE_PARAM_KEY = - 0xfd3b4bccd5e9e72fc05f6dc6ad82a080cd57364c3c3af686f0cffb6659e06d21; - // keccak256("lens.rules.username.CharsetUsernameRule.param.key.CharsetRestrictions.customAllowedCharset"); + 0x3c19617bbf30f545edfbdfba272a5fa1896d806d87b89ef7b1bb6ea891fb2d79; + // keccak256("lens.rules.namespace.UsernameCharsetNamespaceRule.param.key.CharsetRestrictions.customAllowedCharset"); bytes32 immutable CUSTOM_ALLOWED_CHARSET_PARAM_KEY = - 0x6fb6492ecde426d67006445c3c9e467922fc363ab49b27688217c25c7ae5333d; - // keccak256("lens.rules.username.CharsetUsernameRule.param.key.CharsetRestrictions.customDisallowedCharset"); + 0xe6cd53e810eb73a4469a94a3ec25b5568c19ca256303d99b5a025f8d1cd515cb; + // keccak256("lens.rules.namespace.UsernameCharsetNamespaceRule.param.key.CharsetRestrictions.customDisallowedCharset"); bytes32 immutable CUSTOM_DISALLOWED_CHARSET_PARAM_KEY = - 0xae29c55eda70ddcd46fe4555b4ce2e9ef13ab1e67b6c2ab4e5b1473b5784c08e; - // keccak256("lens.rules.username.CharsetUsernameRule.param.key.CharsetRestrictions.cannotStartWith"); - bytes32 immutable CANNOT_START_WITH_PARAM_KEY = 0x9fe6896d61f7ebd0eb7ed29f076cbca24254a8736ee3d3b38389dc0c9e9893f2; + 0x7b2d46fead0a26f8c7a25e0f4a26a6cfd344f33be50d92fbb3b617b9ed829c85; + // keccak256("lens.rules.namespace.UsernameCharsetNamespaceRule.param.key.CharsetRestrictions.cannotStartWith"); + bytes32 immutable CANNOT_START_WITH_PARAM_KEY = 0xdb553ed6f7565512034b5c85634ef06a1666dc287f38cea87762d44684df1256; struct CharsetRestrictions { bool allowNumeric; /////////////// Default: true diff --git a/contracts/rules/username/LengthUsernameRule.sol b/contracts/rules/namespace/UsernameLengthNamespaceRule.sol similarity index 89% rename from contracts/rules/username/LengthUsernameRule.sol rename to contracts/rules/namespace/UsernameLengthNamespaceRule.sol index eb261b29..2e782be8 100644 --- a/contracts/rules/username/LengthUsernameRule.sol +++ b/contracts/rules/namespace/UsernameLengthNamespaceRule.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.0; import {IAccessControl} from "./../../core/interfaces/IAccessControl.sol"; -import {IUsernameRule} from "./../../core/interfaces/IUsernameRule.sol"; +import {INamespaceRule} from "./../../core/interfaces/INamespaceRule.sol"; import {AccessControlLib} from "./../../core/libraries/AccessControlLib.sol"; import {Events} from "./../../core/types/Events.sol"; import {KeyValue} from "./../../core/types/Types.sol"; import {MetadataBased} from "./../../core/base/MetadataBased.sol"; -contract LengthUsernameRule is IUsernameRule, MetadataBased { +contract UsernameLengthNamespaceRule is INamespaceRule, MetadataBased { event Lens_Rule_MetadataURISet(string metadataURI); using AccessControlLib for IAccessControl; @@ -20,10 +20,10 @@ contract LengthUsernameRule is IUsernameRule, MetadataBased { // keccak256("lens.param.key.accessControl"); bytes32 immutable ACCESS_CONTROL_PARAM_KEY = 0x6552dd4db64bdb68f2725e4865ecb072df1c2befcfb455b69e2d2b886a8e185e; - // keccak256("lens.rules.username.LengthUsernameRule.param.key.LengthRestrictions.min"); - bytes32 immutable MIN_LENGTH_PARAM_KEY = 0x422f1cf00b1079acacf4b218aeed45c02143aca53f622b7ab03d6960ab052fc3; - // keccak256("lens.rules.username.LengthUsernameRule.param.key.LengthRestrictions.max"); - bytes32 immutable MAX_LENGTH_PARAM_KEY = 0x07014494232a11e71c003affb5e107b669a9b2b4c523a50097f41c6b95916081; + // keccak256("lens.rules.namespace.UsernameLengthNamespaceRule.param.key.LengthRestrictions.min"); + bytes32 immutable MIN_LENGTH_PARAM_KEY = 0xf24966807c09d7889bd35e72626011103391604d2e7e592296209a0f83709f53; + // keccak256("lens.rules.namespace.UsernameLengthNamespaceRule.param.key.LengthRestrictions.max"); + bytes32 immutable MAX_LENGTH_PARAM_KEY = 0xb03e5fe3b62f2c4cdf212dd7fcbca4b05bbf4adbeba508c61423620b69a58b19; struct LengthRestrictions { uint8 min; diff --git a/contracts/rules/username/ReservedUsernameRule.sol b/contracts/rules/namespace/UsernameReservedNamespaceRule.sol similarity index 83% rename from contracts/rules/username/ReservedUsernameRule.sol rename to contracts/rules/namespace/UsernameReservedNamespaceRule.sol index 148e3c93..6cab3c57 100644 --- a/contracts/rules/username/ReservedUsernameRule.sol +++ b/contracts/rules/namespace/UsernameReservedNamespaceRule.sol @@ -3,26 +3,26 @@ pragma solidity ^0.8.0; import {IAccessControl} from "./../../core/interfaces/IAccessControl.sol"; -import {IUsernameRule} from "./../../core/interfaces/IUsernameRule.sol"; +import {INamespaceRule} from "./../../core/interfaces/INamespaceRule.sol"; import {AccessControlLib} from "./../../core/libraries/AccessControlLib.sol"; import {Events} from "./../../core/types/Events.sol"; import {KeyValue} from "./../../core/types/Types.sol"; import {MetadataBased} from "./../../core/base/MetadataBased.sol"; -contract ReservedUsernameRule is IUsernameRule, MetadataBased { +contract UsernameReservedNamespaceRule is INamespaceRule, MetadataBased { event Lens_Rule_MetadataURISet(string metadataURI); using AccessControlLib for IAccessControl; using AccessControlLib for address; // TODO: Think about renaming Username primitive to Namespace or something else - event Lens_ReservedUsernameRule_UsernameReserved( + event Lens_UsernameReservedNamespaceRule_UsernameReserved( address indexed usernamePrimitive, bytes32 indexed configSalt, string indexed indexedUsername, string username ); - event Lens_ReservedUsernameRule_UsernameReleased( + event Lens_UsernameReservedNamespaceRule_UsernameReleased( address indexed usernamePrimitive, bytes32 indexed configSalt, string indexed indexedUsername, string username ); - event Lens_ReservedUsernameRule_ReservedUsernameCreated( + event Lens_UsernameReservedNamespaceRule_ReservedUsernameCreated( address indexed usernamePrimitive, bytes32 indexed configSalt, string indexed indexedUsername, @@ -33,10 +33,10 @@ contract ReservedUsernameRule is IUsernameRule, MetadataBased { // keccak256("lens.param.key.accessControl"); bytes32 immutable ACCESS_CONTROL_PARAM_KEY = 0x6552dd4db64bdb68f2725e4865ecb072df1c2befcfb455b69e2d2b886a8e185e; - // keccak256("lens.param.key.usernamesToReserve"); - bytes32 immutable USERNAMES_TO_RESERVE_PARAM_KEY = 0xe35845d5270ebd172ba5dfaf14a7256cbc847d131e6a9d37dcd9bce7c75e9e77; - // keccak256("lens.param.key.usernamesToRelease"); - bytes32 immutable USERNAMES_TO_RELEASE_PARAM_KEY = 0x68f854736312031d89be36bdf38f9d77e90822b1a6417823a39f8721c4db9cb2; + // keccak256("lens.rules.namespace.UsernameReservedNamespaceRule.param.key.usernamesToReserve"); + bytes32 immutable USERNAMES_TO_RESERVE_PARAM_KEY = 0xac73ea9176302dedf93d018cb2851aabed8378e612d5c8f094b84162baf60a54; + // keccak256("lens.rules.namespace.UsernameReservedNamespaceRule.param.key.usernamesToRelease"); + bytes32 immutable USERNAMES_TO_RELEASE_PARAM_KEY = 0xf39a11cac75c11509a76f28c17d7d93727c605b6426fb4783e74703c68005563; uint256 constant CREATE_RESERVED_USERNAME_PID = uint256(keccak256("CREATE_RESERVED_USERNAME")); @@ -62,7 +62,7 @@ contract ReservedUsernameRule is IUsernameRule, MetadataBased { for (uint256 j = 0; j < usernamesToReserve.length; j++) { require(!_isUsernameReserved[msg.sender][configSalt][usernamesToReserve[j]]); _isUsernameReserved[msg.sender][configSalt][usernamesToReserve[j]] = true; - emit Lens_ReservedUsernameRule_UsernameReserved( + emit Lens_UsernameReservedNamespaceRule_UsernameReserved( msg.sender, configSalt, usernamesToReserve[j], usernamesToReserve[j] ); } @@ -71,7 +71,7 @@ contract ReservedUsernameRule is IUsernameRule, MetadataBased { for (uint256 j = 0; j < usernamesToRelease.length; j++) { require(_isUsernameReserved[msg.sender][configSalt][usernamesToRelease[j]]); _isUsernameReserved[msg.sender][configSalt][usernamesToRelease[j]] = false; - emit Lens_ReservedUsernameRule_UsernameReleased( + emit Lens_UsernameReservedNamespaceRule_UsernameReleased( msg.sender, configSalt, usernamesToRelease[j], usernamesToRelease[j] ); } @@ -91,7 +91,7 @@ contract ReservedUsernameRule is IUsernameRule, MetadataBased { ) external override { if (_isUsernameReserved[msg.sender][configSalt][username]) { _accessControl[msg.sender][configSalt].requireAccess(originalMsgSender, CREATE_RESERVED_USERNAME_PID); - emit Lens_ReservedUsernameRule_ReservedUsernameCreated( + emit Lens_UsernameReservedNamespaceRule_ReservedUsernameCreated( msg.sender, configSalt, username, username, account, originalMsgSender ); } diff --git a/deploy/deployAux.ts b/deploy/deployAux.ts index d740ddda..dc584174 100644 --- a/deploy/deployAux.ts +++ b/deploy/deployAux.ts @@ -26,7 +26,7 @@ export const emptySourceStamp = { export interface AppInitialProperties { graph: string; feeds: string[]; - username: string; + namespace: string; groups: string[]; defaultFeed: string; signers: string[]; @@ -52,12 +52,12 @@ export async function deployLensPrimitives() { const feed = await deployLensFeed(lensFactory); const group = await deployLensGroup(lensFactory); const graph = await deployLensGraph(lensFactory); - const username = await deployLensUsername(lensFactory); + const namespace = await deployLensNamespace(lensFactory); const initialProperties: AppInitialProperties = { graph, feeds: [feed], - username, + namespace, groups: [group], defaultFeed: feed, signers: [], @@ -189,23 +189,23 @@ async function deployLensGraph(lensFactory: ethers.Contract): Promise { return graphAddress; } -export async function deployLensUsername( +export async function deployLensNamespace( lensFactory: ethers.Contract, noVerify: Boolean = false ): Promise { - const contractName = 'Username'; + const contractName = 'Namespace'; const existingContract = loadContractFromAddressBook(contractName); if (existingContract && existingContract.address) { console.log(`${contractName} already deployed at ${existingContract.address}. Skipping...`); return existingContract.address; } - console.log('Deploying Username'); + console.log('Deploying Namespace'); const namespace = 'lens'; const nftName = 'nftName'; const nftSymbol = 'nftSymbol'; - const transaction = await lensFactory.deployUsername( + const transaction = await lensFactory.deployNamespace( namespace, metadataURI, getWallet().address, @@ -218,7 +218,7 @@ export async function deployLensUsername( const txReceipt = (await transaction.wait()) as ethers.TransactionReceipt; const events = parseLensContractDeployedEventsFromReceipt(txReceipt); - const usernameAddress = getAddressFromEvents(events, 'username'); + const namespaceAddress = getAddressFromEvents(events, 'namespace'); const accessControlAddress = getAddressFromEvents(events, 'access-control'); const lensUsernameTokenURIProviderAddress = getAddressFromEvents( events, @@ -226,7 +226,7 @@ export async function deployLensUsername( ); if (!noVerify) { - await verifyPrimitive('Username', usernameAddress, [ + await verifyPrimitive('Namespace', namespaceAddress, [ namespace, metadataURI, accessControlAddress, @@ -237,12 +237,12 @@ export async function deployLensUsername( } saveContractToAddressBook({ - contractName: 'Username', + contractName: 'Namespace', contractType: ContractType.Primitive, - address: usernameAddress + address: namespaceAddress }); - return usernameAddress; + return namespaceAddress; } export async function deployLensApp( diff --git a/deploy/deployFactories.ts b/deploy/deployFactories.ts index e1cdb543..795ae33c 100644 --- a/deploy/deployFactories.ts +++ b/deploy/deployFactories.ts @@ -10,7 +10,7 @@ export default async function deployFactories(): Promise { { contractName: 'FeedFactory', contractType: ContractType.Factory }, { contractName: 'GraphFactory', contractType: ContractType.Factory }, { contractName: 'GroupFactory', contractType: ContractType.Factory }, - { contractName: 'UsernameFactory', contractType: ContractType.Factory }, + { contractName: 'NamespaceFactory', contractType: ContractType.Factory }, { contractName: 'AccountBlockingRule', contractType: ContractType.Rule, @@ -36,7 +36,7 @@ export default async function deployFactories(): Promise { deployedContracts['GroupFactory'].address, deployedContracts['FeedFactory'].address, deployedContracts['GraphFactory'].address, - deployedContracts['UsernameFactory'].address, + deployedContracts['NamespaceFactory'].address, deployedContracts['AccountBlockingRule'].address, deployedContracts['GroupGatedFeedRule'].address, ]; diff --git a/deploy/deployRules.ts b/deploy/deployRules.ts index ace9b935..8de187d1 100644 --- a/deploy/deployRules.ts +++ b/deploy/deployRules.ts @@ -63,24 +63,29 @@ export async function deployRules(): Promise { contractType: ContractType.Rule, constructorArguments: [metadataURI], }, - // Username Rules + // Namespace Rules { - contractName: 'CharsetUsernameRule', + contractName: 'UsernameCharsetNamespaceRule', contractType: ContractType.Rule, constructorArguments: [metadataURI], }, { - contractName: 'LengthUsernameRule', + contractName: 'UsernameLengthNamespaceRule', contractType: ContractType.Rule, constructorArguments: [metadataURI], }, { - contractName: 'SimplePaymentUsernameRule', + contractName: 'UsernameReservedNamespaceRule', contractType: ContractType.Rule, constructorArguments: [metadataURI], }, { - contractName: 'TokenGatedUsernameRule', + contractName: 'SimplePaymentNamespaceRule', + contractType: ContractType.Rule, + constructorArguments: [metadataURI], + }, + { + contractName: 'TokenGatedNamespaceRule', contractType: ContractType.Rule, constructorArguments: [metadataURI], }, From f5dd9b2140a405201b4c86f15baa9eea3b5be2f3 Mon Sep 17 00:00:00 2001 From: vicnaum Date: Sun, 29 Dec 2024 21:28:13 +0100 Subject: [PATCH 2/2] misc: new deployment --- addressBook.json | 131 ++++++++++++++++++++++++----------------------- contracts.env | 71 ++++++++++++------------- 2 files changed, 104 insertions(+), 98 deletions(-) diff --git a/addressBook.json b/addressBook.json index 5a6d754a..4ea61f6b 100644 --- a/addressBook.json +++ b/addressBook.json @@ -1,177 +1,182 @@ { "AccessControlFactory": { "contractType": 0, - "address": "0xAB42fFa42BB970E91c319fa2A9788fef7383025f", + "address": "0x0eFacc862cB7eB8066AA9e913e9C291fc683f4A7", "bytecodeHash": "0xffd13eadfff388febdb5870c599cc093f6fbf017bd444ceb3632354fbacf64d9" }, "AccountFactory": { "contractType": 0, - "address": "0xe5f7A8bD9140314395B101E48D5218b4f7c0BC9b", + "address": "0x6b01aC7b28eB753EC109CF05025504fddC7AB16b", "bytecodeHash": "0x778c4a339b3db45d0e3598efa36c14c62ab41bbc39e5c3120281eb9a16538f5e" }, "AppFactory": { "contractType": 0, - "address": "0xFb89E2Ce26cb9294Fa70fB3BD04562D2F510E1e7", - "bytecodeHash": "0x76270a7bf794505b1b19e14c58f558e043cfacf43c8c7210c064267aecf82fe1" + "address": "0xEE15DDe0B51988F2e83F8072fFA078eCcfa9E442", + "bytecodeHash": "0xcbe1ffe3266bbcd79c801a81075960f7dcf4e09a57614c4858ebe5fcc286fa0c" }, "FeedFactory": { "contractType": 0, - "address": "0x3173760141462F4b9ec34a9e25816e16FD04dc19", - "bytecodeHash": "0x70ee947e41895cfb03e90d4faa73e6f11bcfb19ed75a410089493a4c4daac7b9" + "address": "0xA892F9967B7813F37ecBE7d422d77bE11afe1364", + "bytecodeHash": "0xda740010913b751d8ce559abe32941342a371fe4a8cb17bf0c2134f5fd68b3d4" }, "GraphFactory": { "contractType": 0, - "address": "0xD418cA6c563F2ec322cB31c16a5315069D24de87", - "bytecodeHash": "0x1322c4e1072d1510bbfbbd31bd873c75daaf35f8c44b6059c18fde5f484f8aed" + "address": "0xa6421e217c47a471B6a74F55825E0d6b8AC3970e", + "bytecodeHash": "0xd954a2fd3a269c2fd2c8b752d30c7473cb10e486a7a32e0b0d9690348114a330" }, "GroupFactory": { "contractType": 0, - "address": "0xC533562eA7369397F78ABF6BC6cC587e46fB663D", + "address": "0xfD9FBE388263b284ab5Ced67Ef2d32b5Ef4a2654", "bytecodeHash": "0x70c66f88f40e5090990710d0a5e6e7041dae94db21b4e1a50ffded638715d8b6" }, - "UsernameFactory": { + "NamespaceFactory": { "contractType": 0, - "address": "0x6828995636f35B49B6c2c0f45E25F528FEA3866F", - "bytecodeHash": "0xe1505e5c325931364b4e1665ca98f17784095c1079104818b52191459e3e360b" + "address": "0x220C9D5715aa5d6E1384640a6c02001cD9CFb88F", + "bytecodeHash": "0x064841050c0b9b71552c7f4105d542712ce49bb844876229ae8765b530f55a48" }, - "UserBlockingRule": { + "AccountBlockingRule": { "contractType": 4, - "address": "0xA85FC9625a5c525742Fe2716464Fc5F08179D1b0", - "bytecodeHash": "0x5a85a452e3bdc2ca2a059b16184cb3c64e8ff8baf8f4f4c4441f6144c149a969" + "address": "0x8e9cd529e17EE58df01A324A19a81e3b602D5Ac9", + "bytecodeHash": "0x174c72361bf152dc4140e50db5ee6002c6517b3a8f631e525b2af6a884d529b0" + }, + "GroupGatedFeedRule": { + "contractType": 4, + "address": "0x72Af457f40ae9a15EC59b5E11dACdD61823365b6", + "bytecodeHash": "0x777efb43597c14a63e78b741498acf18e334890cc1b3ba7a36c961d319163dec" }, "LensFactory": { "contractType": 0, - "address": "0x6F86fAb76E2b2F4d71C4e25f9Df507707ea2544A", - "bytecodeHash": "0x611f09798c92d2dcf640f2d09b2f8e9729232bb7eb952a26b2d9c3e6fff09891" + "address": "0xCAe7bA1049eF73C74Aed579cb936232A391255DB", + "bytecodeHash": "0x5a26f5336b4faf3f56d59ed323b89e5ac1aba25cf96d9b8070c3cb127fa19c8f" }, "Account": { "contractName": "Account", "contractType": 5, - "address": "0xc1B939e2AdBa810A3Bd80C043A51d8aFFe8121a8" + "address": "0xd5947f60c65B35237543e553d2c55E4066EcF28f" }, "Feed": { "contractName": "Feed", "contractType": 1, - "address": "0x4b21B56e8e36714aF0634a460fc637896E62aB14" + "address": "0xe31029F1A348E4Fe90d0cF707c3D855ADB4C7090" }, "Group": { "contractName": "Group", "contractType": 1, - "address": "0xb9226FF33c025D761E903cB864E2F6a173E559c5" + "address": "0x2F1264d2bFc91c79d0928160C2ddf08F3D0B5E0f" }, "Graph": { "contractName": "Graph", "contractType": 1, - "address": "0x9b82039E352d5d71CCf09cA71d324F9653194859" + "address": "0x08391B34C2d90c9313ADc18DA475a740E9606ce5" }, - "Username": { - "contractName": "Username", + "Namespace": { + "contractName": "Namespace", "contractType": 1, - "address": "0x380a23c0B0DB6B0eD531bDA2b27d1d963F3bA64D" + "address": "0xa86662eaF0D60F5DAF58f952982018e2963c1F02" }, "App": { "contractName": "App", "contractType": 5, - "address": "0x8d2bd7284C16DC21BD0768aC4EaFc516FAbbAC6B" + "address": "0x9E7Eef88496e628664c45f064623c68DCE440428" }, "ActionHub": { "contractName": "ActionHub", "contractType": 2, - "address": "0xd578d4C9b85b421Ac320e6d4b97Bd062f783664B" + "address": "0x7455aE4C8D1DdD792Af00525004E12d68a613A5B" }, "OwnerAdminOnlyAccessControl": { "contractName": "OwnerAdminOnlyAccessControl", "contractType": 2, - "address": "0x23651C52835C09017edB8906dc265c19EdAcFa34" - }, - "GroupGatedFeedRule": { - "contractType": 4, - "address": "0x2a021Fe75AB34f638e6AF41B3A63C4EEF181C875", - "bytecodeHash": "0xb2661ccd5e3a152ff5d53235e77f5a1631eb2e1b41a204905bbd4979ff84fb00" + "address": "0x68f7Dd2edF6A57aD9653Cc4bD44EA580A00B9231" }, "RestrictedSignersFeedRule": { "contractType": 4, - "address": "0xF5992a64513111B7557f951f2345c1E8DA6B0E47", - "bytecodeHash": "0xa0147cf3f8841a85efb4b0f2873f1d0eeb4a3a03eeffdb3ed103506d26503509" + "address": "0x6F1904063A58260184F8cc40F3030E43913056C0", + "bytecodeHash": "0x400b2bd1ad0cea347d55cb4368d98eb7153a21d11315f052d07f069bdec2e763" }, "SimplePaymentFeedRule": { "contractType": 4, - "address": "0x410F26C7451Cb7d30d7d48228fb27C46Dbd90324", - "bytecodeHash": "0x5a2f5ebb5bd387a6ac49e3e41953708d03a75622f9fa367f2fdfbb6be37ff2eb" + "address": "0x9f0419f3F5ba9C5c2C57fA8e4b99db3b9bb90c29", + "bytecodeHash": "0x5ced359378d0da2a68d2def262990f33a87b254de6033f30cab7bd2f8baeca98" }, "TokenGatedFeedRule": { "contractType": 4, - "address": "0x210b850191B766bFc2788138C0b26816983d927a", - "bytecodeHash": "0xdf46990ec07f3f62ab8b5e78d09ef15494275cc154dc3dae61fc427c95330409" + "address": "0xbFaD70775C3A96E22868B969b11b8B0dd9F46509", + "bytecodeHash": "0x7c880367a6ef7ed4ed5de9559ac4e229ff1da4d4d4010d07b24ad13b2dd855be" }, "FollowersOnlyPostRule": { "contractType": 4, - "address": "0xD51C7BA9f5f4743eff2371a97F889FBA928ABFB2", - "bytecodeHash": "0xcb410be762584d2f6a0288f412700d2148b9a41ac19e9f126905e03bebd5dd37" + "address": "0x6e54672c0Acf85C5e2644bA04789D21C49AfAa6C", + "bytecodeHash": "0xe8af4e205d2cdf5c5b7ac18f28ac49a18bc0e3603994bfad24e3ea63ffecadef" }, "RestrictedSignersGraphRule": { "contractType": 4, - "address": "0x18A328E1c1A1c9234F22165527405B7DF2B645fB", - "bytecodeHash": "0xf46df3cbf6e5c562f111f9dfdc2c9d10243700b77733fa92aa89ac9725a85dde" + "address": "0x05AF0e183F076b616DeEb8ac8551976aE6ebDB70", + "bytecodeHash": "0x4f83be11a26da7f0231cf14c9a311b760afd0655b1d5e5d26a9d690769b0b767" }, "TokenGatedGraphRule": { "contractType": 4, - "address": "0xa59Ad7606589C14EE24dA32CDBc5BBD34BdD38aA", + "address": "0x66D8e80F4Ab08F6A2d4c22d2A302b73fc593693f", "bytecodeHash": "0x826b73493898bc53802267665a2cf09b46d199ef6915e3a7e509428a42a3638b" }, "SimplePaymentFollowRule": { "contractType": 4, - "address": "0x17f5fc7b819e62990F264EA6F6f0e6700b095802", + "address": "0x812F10F2e2Bd6399dDFB2aBd4C1e61Af75de4191", "bytecodeHash": "0x69d571614d26b3dd63e324a9943c38805a76fcb81c5ef4f347fe4cd36c7cb870" }, "TokenGatedFollowRule": { "contractType": 4, - "address": "0x8a018956dEc11498b1ede8D6fd238920BE0672FF", + "address": "0xD4d5884Eff441A02e3740E36AB1852DB1532Dd41", "bytecodeHash": "0x82711f6b88c46dca799abc70d63748a861ac63092a2c6af8b39722968b1f1b80" }, "MembershipApprovalGroupRule": { "contractType": 4, - "address": "0x6753E5e5AC71cbdD276f6a92219fF7E9d48B44c4", + "address": "0x90c98c621f4AcD143391ab025A1E0EBd35d6df73", "bytecodeHash": "0x017565ec00a0a78377dc64072f55407227b85372e2de7685a5dbc143a7c08a31" }, "SimplePaymentGroupRule": { "contractType": 4, - "address": "0xA6b387c901c4eb157e5f80BBBDDAf8C1828bEadC", + "address": "0x072c62379063c4243916C9f702E03f7520fC8727", "bytecodeHash": "0x54c7cb0f133752e373f94ca047962614132491122b620cb269261f0d2f86f78b" }, "TokenGatedGroupRule": { "contractType": 4, - "address": "0xFCd7d824B072CE2F1976f9aE7bAa19e61D63F8b0", + "address": "0x28C8cf984d4A0baae08b698De7d0F8E556C262f0", "bytecodeHash": "0x148c0b00fe5cead20bea3feffa2a25d31d3cb913a12b155fb5e08956ce15aacc" }, - "CharsetUsernameRule": { + "UsernameCharsetNamespaceRule": { + "contractType": 4, + "address": "0xcBfB0b8d631eA473B7e5AC2C85862305549f79CF", + "bytecodeHash": "0x8c2088fea6dbc4c93bb38188800c2c341cd5c8d5a4ee8c6d43508b819d298875" + }, + "UsernameLengthNamespaceRule": { "contractType": 4, - "address": "0x0904cDb1Bb2cd7EeC7656ae3f6df3D0cf0631adC", - "bytecodeHash": "0xbeff9bb2a713b44d80263cdee74a510568bdadc68da1f469bd9abc5d488022b9" + "address": "0xd380BbcF2D6131CC2B79dD207a0336C3497ec8EE", + "bytecodeHash": "0x057af7a3c70304d9800b0ce405c00cd5460a13ff627ef22d3197cc0d64596c67" }, - "LengthUsernameRule": { + "UsernameReservedNamespaceRule": { "contractType": 4, - "address": "0x63cfCd84881602a8e98FDd30Ca234A61b806a2b8", - "bytecodeHash": "0xe4a933e09dd68e38609728160eaad3d72a99ac87adf25565d5c9706345dfcf2a" + "address": "0x1B8F4cA863F9B02B552ce0d4057656Ea9fe7e221", + "bytecodeHash": "0x70d57c078f3f0c8feece0c82f481a3d3c3bf5ec07a0f13ef4ecc02df981b9c28" }, - "SimplePaymentUsernameRule": { + "SimplePaymentNamespaceRule": { "contractType": 4, - "address": "0x18Bc249FD00438Dc62A508b1133e438DbFE1f025", - "bytecodeHash": "0x4fa55f756520a7eb4048f56ef47405c77e29c0f237a47cba912f3d8269004e5d" + "address": "0x4FcAD39491FD4c5fa9E60230Fbaa8D65c5fe4aCb", + "bytecodeHash": "0x84a7be2091b8924eac02ca260cdf4c9f28b7325649eb8c76cd85f870c61dd939" }, - "TokenGatedUsernameRule": { + "TokenGatedNamespaceRule": { "contractType": 4, - "address": "0xc7f03D448144F888e4D87560D265c85d3e013EA5", - "bytecodeHash": "0xd63f0930e78395f2636668b4ef8c66425460eb183dfcda9f83ca90645b3c8344" + "address": "0xD562374d88ef53Caee721bFd7cBF100a3a447d79", + "bytecodeHash": "0x5af79c7e775cca6017f3205381dcf0d1010047bf6d15af5d76dab4e89cb06005" }, "TippingAccountAction": { "contractType": 3, - "address": "0xD310825958418fd133d17C6c924d0Dc417d2AEdb", + "address": "0x99D7933Cb4D3e45EcC543Eb3C66547540479BF70", "bytecodeHash": "0xb77a6ee82ea8fe92064c204104e69ca80cc6246b7b5624eb364f1f9c5e61ec21" }, "SimpleCollectAction": { "contractType": 3, - "address": "0xd34a5E56B0AD3d8824CbDB91f8dB07ce9bC6F735", - "bytecodeHash": "0xdcc4e7bd9875501c109949c230fac09375bc6e1ac08a7ba78ce7fe09bd9d7a89" + "address": "0xBF83e09560544776EA0644864F9FEB2b25337D84", + "bytecodeHash": "0xbb7a0f171a1c76ecbaf665f42b0f5cf2476d103abb3afa5cc16f4eee72ccb015" } } \ No newline at end of file diff --git a/contracts.env b/contracts.env index d2718f6e..7c7ea371 100644 --- a/contracts.env +++ b/contracts.env @@ -1,46 +1,47 @@ # CONTRACTS -ACCESS_CONTROL_FACTORY="0xAB42fFa42BB970E91c319fa2A9788fef7383025f" -ACCOUNT_FACTORY="0xe5f7A8bD9140314395B101E48D5218b4f7c0BC9b" -APP_FACTORY="0xFb89E2Ce26cb9294Fa70fB3BD04562D2F510E1e7" -FEED_FACTORY="0x3173760141462F4b9ec34a9e25816e16FD04dc19" -GRAPH_FACTORY="0xD418cA6c563F2ec322cB31c16a5315069D24de87" -GROUP_FACTORY="0xC533562eA7369397F78ABF6BC6cC587e46fB663D" -USERNAME_FACTORY="0x6828995636f35B49B6c2c0f45E25F528FEA3866F" -LENS_FACTORY="0x6F86fAb76E2b2F4d71C4e25f9Df507707ea2544A" +ACCESS_CONTROL_FACTORY="0x0eFacc862cB7eB8066AA9e913e9C291fc683f4A7" +ACCOUNT_FACTORY="0x6b01aC7b28eB753EC109CF05025504fddC7AB16b" +APP_FACTORY="0xEE15DDe0B51988F2e83F8072fFA078eCcfa9E442" +FEED_FACTORY="0xA892F9967B7813F37ecBE7d422d77bE11afe1364" +GRAPH_FACTORY="0xa6421e217c47a471B6a74F55825E0d6b8AC3970e" +GROUP_FACTORY="0xfD9FBE388263b284ab5Ced67Ef2d32b5Ef4a2654" +NAMESPACE_FACTORY="0x220C9D5715aa5d6E1384640a6c02001cD9CFb88F" +LENS_FACTORY="0xCAe7bA1049eF73C74Aed579cb936232A391255DB" # LENS GLOBAL PRIMITIVES -FEED="0x4b21B56e8e36714aF0634a460fc637896E62aB14" -GROUP="0xb9226FF33c025D761E903cB864E2F6a173E559c5" -GRAPH="0x9b82039E352d5d71CCf09cA71d324F9653194859" -USERNAME="0x380a23c0B0DB6B0eD531bDA2b27d1d963F3bA64D" +FEED="0xe31029F1A348E4Fe90d0cF707c3D855ADB4C7090" +GROUP="0x2F1264d2bFc91c79d0928160C2ddf08F3D0B5E0f" +GRAPH="0x08391B34C2d90c9313ADc18DA475a740E9606ce5" +NAMESPACE="0xa86662eaF0D60F5DAF58f952982018e2963c1F02" # AUX -ACTION_HUB="0xd578d4C9b85b421Ac320e6d4b97Bd062f783664B" -OWNER_ADMIN_ONLY_ACCESS_CONTROL="0x23651C52835C09017edB8906dc265c19EdAcFa34" +ACTION_HUB="0x7455aE4C8D1DdD792Af00525004E12d68a613A5B" +OWNER_ADMIN_ONLY_ACCESS_CONTROL="0x68f7Dd2edF6A57aD9653Cc4bD44EA580A00B9231" # ACTIONS -TIPPING_ACCOUNT_ACTION="0xD310825958418fd133d17C6c924d0Dc417d2AEdb" -SIMPLE_COLLECT_ACTION="0xd34a5E56B0AD3d8824CbDB91f8dB07ce9bC6F735" +TIPPING_ACCOUNT_ACTION="0x99D7933Cb4D3e45EcC543Eb3C66547540479BF70" +SIMPLE_COLLECT_ACTION="0xBF83e09560544776EA0644864F9FEB2b25337D84" # RULES -USER_BLOCKING_RULE="0xA85FC9625a5c525742Fe2716464Fc5F08179D1b0" -GROUP_GATED_FEED_RULE="0x2a021Fe75AB34f638e6AF41B3A63C4EEF181C875" -RESTRICTED_SIGNERS_FEED_RULE="0xF5992a64513111B7557f951f2345c1E8DA6B0E47" -SIMPLE_PAYMENT_FEED_RULE="0x410F26C7451Cb7d30d7d48228fb27C46Dbd90324" -TOKEN_GATED_FEED_RULE="0x210b850191B766bFc2788138C0b26816983d927a" -FOLLOWERS_ONLY_POST_RULE="0xD51C7BA9f5f4743eff2371a97F889FBA928ABFB2" -RESTRICTED_SIGNERS_GRAPH_RULE="0x18A328E1c1A1c9234F22165527405B7DF2B645fB" -TOKEN_GATED_GRAPH_RULE="0xa59Ad7606589C14EE24dA32CDBc5BBD34BdD38aA" -SIMPLE_PAYMENT_FOLLOW_RULE="0x17f5fc7b819e62990F264EA6F6f0e6700b095802" -TOKEN_GATED_FOLLOW_RULE="0x8a018956dEc11498b1ede8D6fd238920BE0672FF" -MEMBERSHIP_APPROVAL_GROUP_RULE="0x6753E5e5AC71cbdD276f6a92219fF7E9d48B44c4" -SIMPLE_PAYMENT_GROUP_RULE="0xA6b387c901c4eb157e5f80BBBDDAf8C1828bEadC" -TOKEN_GATED_GROUP_RULE="0xFCd7d824B072CE2F1976f9aE7bAa19e61D63F8b0" -CHARSET_USERNAME_RULE="0x0904cDb1Bb2cd7EeC7656ae3f6df3D0cf0631adC" -LENGTH_USERNAME_RULE="0x63cfCd84881602a8e98FDd30Ca234A61b806a2b8" -SIMPLE_PAYMENT_USERNAME_RULE="0x18Bc249FD00438Dc62A508b1133e438DbFE1f025" -TOKEN_GATED_USERNAME_RULE="0xc7f03D448144F888e4D87560D265c85d3e013EA5" +ACCOUNT_BLOCKING_RULE="0x8e9cd529e17EE58df01A324A19a81e3b602D5Ac9" +GROUP_GATED_FEED_RULE="0x72Af457f40ae9a15EC59b5E11dACdD61823365b6" +RESTRICTED_SIGNERS_FEED_RULE="0x6F1904063A58260184F8cc40F3030E43913056C0" +SIMPLE_PAYMENT_FEED_RULE="0x9f0419f3F5ba9C5c2C57fA8e4b99db3b9bb90c29" +TOKEN_GATED_FEED_RULE="0xbFaD70775C3A96E22868B969b11b8B0dd9F46509" +FOLLOWERS_ONLY_POST_RULE="0x6e54672c0Acf85C5e2644bA04789D21C49AfAa6C" +RESTRICTED_SIGNERS_GRAPH_RULE="0x05AF0e183F076b616DeEb8ac8551976aE6ebDB70" +TOKEN_GATED_GRAPH_RULE="0x66D8e80F4Ab08F6A2d4c22d2A302b73fc593693f" +SIMPLE_PAYMENT_FOLLOW_RULE="0x812F10F2e2Bd6399dDFB2aBd4C1e61Af75de4191" +TOKEN_GATED_FOLLOW_RULE="0xD4d5884Eff441A02e3740E36AB1852DB1532Dd41" +MEMBERSHIP_APPROVAL_GROUP_RULE="0x90c98c621f4AcD143391ab025A1E0EBd35d6df73" +SIMPLE_PAYMENT_GROUP_RULE="0x072c62379063c4243916C9f702E03f7520fC8727" +TOKEN_GATED_GROUP_RULE="0x28C8cf984d4A0baae08b698De7d0F8E556C262f0" +USERNAME_CHARSET_NAMESPACE_RULE="0xcBfB0b8d631eA473B7e5AC2C85862305549f79CF" +USERNAME_LENGTH_NAMESPACE_RULE="0xd380BbcF2D6131CC2B79dD207a0336C3497ec8EE" +USERNAME_RESERVED_NAMESPACE_RULE="0x1B8F4cA863F9B02B552ce0d4057656Ea9fe7e221" +SIMPLE_PAYMENT_NAMESPACE_RULE="0x4FcAD39491FD4c5fa9E60230Fbaa8D65c5fe4aCb" +TOKEN_GATED_NAMESPACE_RULE="0xD562374d88ef53Caee721bFd7cBF100a3a447d79" # MISC -ACCOUNT="0xc1B939e2AdBa810A3Bd80C043A51d8aFFe8121a8" -APP="0x8d2bd7284C16DC21BD0768aC4EaFc516FAbbAC6B" +ACCOUNT="0xd5947f60c65B35237543e553d2c55E4066EcF28f" +APP="0x9E7Eef88496e628664c45f064623c68DCE440428"