Skip to content

Commit

Permalink
fix: Typo
Browse files Browse the repository at this point in the history
Co-authored-by: crStiv
  • Loading branch information
donosonaumczuk committed Dec 24, 2024
1 parent f50953f commit a4e9313
Showing 1 changed file with 64 additions and 22 deletions.
86 changes: 64 additions & 22 deletions contracts/dashboard/primitives/app/AppCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ library AppCore {
// Storage

struct Storage {
string metadataURI; // Name, description, logo, other attribiutes like category/topic, etc.
string metadataURI; // Name, description, logo, other attributes like category/topic, etc.
bool sourceStampVerificationEnabled;
address treasury; // Can also be defined as a permission in the AC... and allow multiple revenue recipients!
mapping(address => ArrayStorageHelper) signerStorageHelper;
Expand Down Expand Up @@ -72,15 +72,21 @@ library AppCore {

////////////// Graph

function _addGraph(address graph) internal {
function _addGraph(
address graph
) internal {
_add(graph, $storage().graphs, $storage().graphStorageHelper);
}

function _removeGraph(address graph) internal {
function _removeGraph(
address graph
) internal {
_remove(graph, $storage().graphs, $storage().graphStorageHelper);
}

function _setDefaultGraph(address graph) internal returns (bool) {
function _setDefaultGraph(
address graph
) internal returns (bool) {
bool wasAValuePreviouslySet = $storage().defaultGraph != address(0);
if (graph != address(0)) {
// address(0) allowed as a way to remove the default graph
Expand All @@ -92,29 +98,41 @@ library AppCore {

////////////// Feed

function _addFeed(address feed) internal {
function _addFeed(
address feed
) internal {
_add(feed, $storage().feeds, $storage().feedStorageHelper);
}

function _removeFeed(address feed) internal {
function _removeFeed(
address feed
) internal {
_remove(feed, $storage().feeds, $storage().feedStorageHelper);
}

function _setDefaultFeed(address feed) internal {
function _setDefaultFeed(
address feed
) internal {
$storage().defaultFeed = feed;
}

////////////// Username

function _addUsername(address username) internal {
function _addUsername(
address username
) internal {
_add(username, $storage().usernames, $storage().usernameStorageHelper);
}

function _removeUsername(address username) internal {
function _removeUsername(
address username
) internal {
_remove(username, $storage().usernames, $storage().usernameStorageHelper);
}

function _setDefaultUsername(address username) internal returns (bool) {
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
Expand All @@ -126,15 +144,21 @@ library AppCore {

////////////// Group

function _addGroup(address group) internal {
function _addGroup(
address group
) internal {
_add(group, $storage().groups, $storage().groupStorageHelper);
}

function _removeGroup(address group) internal {
function _removeGroup(
address group
) internal {
_remove(group, $storage().groups, $storage().groupStorageHelper);
}

function _setDefaultGroup(address group) internal {
function _setDefaultGroup(
address group
) internal {
if (group != address(0)) {
// address(0) allowed as a way to remove the default group
require($storage().groupStorageHelper[group].isSet, "NOT_FOUND");
Expand All @@ -144,15 +168,21 @@ library AppCore {

////////////// Paymaster

function _addPaymaster(address paymaster) internal {
function _addPaymaster(
address paymaster
) internal {
_add(paymaster, $storage().paymasters, $storage().paymasterStorageHelper);
}

function _removePaymaster(address paymaster) internal {
function _removePaymaster(
address paymaster
) internal {
_remove(paymaster, $storage().paymasters, $storage().paymasterStorageHelper);
}

function _setDefaultPaymaster(address paymaster) internal returns (bool) {
function _setDefaultPaymaster(
address paymaster
) internal returns (bool) {
bool wasAValuePreviouslySet = $storage().defaultPaymaster != address(0);
if (paymaster != address(0)) {
// address(0) allowed as a way to remove the default paymaster
Expand All @@ -164,33 +194,45 @@ library AppCore {

////////////// Signer

function _addSigner(address signer) internal {
function _addSigner(
address signer
) internal {
_add(signer, $storage().signers, $storage().signerStorageHelper);
}

function _removeSigner(address signer) internal {
function _removeSigner(
address signer
) internal {
_remove(signer, $storage().signers, $storage().signerStorageHelper);
}

////////////// Treasury

function _setTreasury(address treasury) internal {
function _setTreasury(
address treasury
) internal {
$storage().treasury = treasury;
}

////////////// Metadata URI

function _setMetadataURI(string memory metadataURI) internal {
function _setMetadataURI(
string memory metadataURI
) internal {
$storage().metadataURI = metadataURI;
}

////////////// Extra Data

function setExtraData(KeyValue memory extraDataToSet) external returns (bool) {
function setExtraData(
KeyValue memory extraDataToSet
) external returns (bool) {
return _setExtraData(extraDataToSet);
}

function _setExtraData(KeyValue memory extraDataToSet) internal returns (bool) {
function _setExtraData(
KeyValue memory extraDataToSet
) internal returns (bool) {
return $storage().extraData.set(extraDataToSet);
}
}

0 comments on commit a4e9313

Please sign in to comment.