Skip to content

Commit

Permalink
fixing typos & changeset (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
peersky authored Nov 20, 2024
1 parent 6c094d3 commit ceecabe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-impalas-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@peeramid-labs/eds": patch
---

fixed typos
2 changes: 1 addition & 1 deletion src/abstracts/Distributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ abstract contract Distributor is IDistributor, CodeIndexer, ERC165 {
if (!distributionsSet.contains(distributionId)) revert DistributionNotFound(distributionId);
LibSemver.VersionRequirement memory oldRequirement = versionRequirements[distributionId];
if (LibSemver.toUint256(oldRequirement.version) == 0) {
revert UniversionedDistribution(distributionId);
revert UnversionedDistribution(distributionId);
}
if (LibSemver.toUint256(newRequirement.version) == 0) {
revert InvalidVersionRequested(distributionId, LibSemver.toString(newRequirement.version));
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface IDistributor is IERC7746, IERC165 {
error RepositoryAlreadyExists(address repository);
error VersionOutdated(bytes32 distributionId, string version);
error InvalidInstance(address instance);
error UniversionedDistribution(bytes32 distributionId);
error UnversionedDistribution(bytes32 distributionId);

/**
* @notice Emitted when the version of the distributor is changed.
Expand Down Expand Up @@ -52,7 +52,7 @@ interface IDistributor is IERC7746, IERC165 {
* @notice Event emitted when a new distribution is instantiated.
* @param distributionId The unique identifier of the distribution.
* @param newInstanceId The unique identifier of the instance.
* @param version The version of the distribution, taken either from IDsitribution or from IRepository.
* @param version The version of the distribution, taken either from IDistribution or from IRepository.
* @param instances The addresses of the instances that were created.
* @param args The arguments that were used for instantiation.
* @dev It MUST emit when {IDistributor.instantiate} is called.
Expand Down
18 changes: 9 additions & 9 deletions src/managers/SimpleAccessManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
contract SimpleAccessManager is Initializable, IERC7746, ERC165 {
struct MethodSettings {
bool isDistributionOnly;
mapping(address => bool) dissallowedAddresses;
mapping(address => bool) disallowedAddresses;
}

struct Storage {
Expand All @@ -29,7 +29,7 @@ contract SimpleAccessManager is Initializable, IERC7746, ERC165 {

struct SimpleAccessManagerInitializer {
bytes4 selector;
address[] dissallowedAddresses;
address[] disallowedAddresses;
bool distributionComponentsOnly;
}

Expand All @@ -52,17 +52,17 @@ contract SimpleAccessManager is Initializable, IERC7746, ERC165 {
for (uint256 i; i < length; ++i) {
s.methodSettings[methodSettings[i].selector].isDistributionOnly = methodSettings[i]
.distributionComponentsOnly;
uint256 dissalowedMethodsLength = methodSettings[i].dissallowedAddresses.length;
for (uint256 j; j < dissalowedMethodsLength; ++j) {
s.methodSettings[methodSettings[i].selector].dissallowedAddresses[
methodSettings[i].dissallowedAddresses[j]
uint256 disallowedMethodsLength = methodSettings[i].disallowedAddresses.length;
for (uint256 j; j < disallowedMethodsLength; ++j) {
s.methodSettings[methodSettings[i].selector].disallowedAddresses[
methodSettings[i].disallowedAddresses[j]
] = true;
}
}
}

error OnlyTargetAllowed(address sender, address target);
error dissallowedAddress(address sender, bytes4 selector);
error disallowedAddress(address sender, bytes4 selector);

function beforeCall(
bytes memory,
Expand All @@ -75,8 +75,8 @@ contract SimpleAccessManager is Initializable, IERC7746, ERC165 {
if (msg.sender != s.target) {
revert OnlyTargetAllowed(msg.sender, s.target);
}
if (s.methodSettings[selector].dissallowedAddresses[sender]) {
revert dissallowedAddress(sender, selector);
if (s.methodSettings[selector].disallowedAddresses[sender]) {
revert disallowedAddress(sender, selector);
} else {
if (s.methodSettings[selector].isDistributionOnly) {
return s.distributor.beforeCall(abi.encode(msg.sender), selector, sender, value, data);
Expand Down

0 comments on commit ceecabe

Please sign in to comment.