Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update mock custom entitlement to take in users and params #1013

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ pragma solidity ^0.8.23;
import {Deployer} from "contracts/scripts/common/Deployer.s.sol";
import {MockCustomEntitlement} from "contracts/test/mocks/MockCustomEntitlement.sol";

contract DeployCustomEntitlementExample is Deployer {
contract DeployMockCustomEntitlement is Deployer {
function versionName() public pure override returns (string memory) {
return "customEntitlementExample";
return "mockCustomEntitlement";
}

function __deploy(address deployer) public override returns (address) {
Expand Down
9 changes: 9 additions & 0 deletions contracts/src/spaces/entitlements/ICustomEntitlement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@ interface ICustomEntitlement is IERC165 {
/// @param user address of the user to check
/// @return whether the user is entitled to the permission
function isEntitled(address[] memory user) external view returns (bool);

/// @notice checks whether a user is has a given permission for a channel or a space
/// @param users addresses of the users to check
/// @param entitledData data to pass to the entitlement check
/// @return whether the user is entitled to the permission
function isEntitled(
address[] memory users,
bytes memory entitledData
) external view returns (bool);
}
7 changes: 7 additions & 0 deletions contracts/test/mocks/MockCustomEntitlement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ contract MockCustomEntitlement is ICustomEntitlement {
return false;
}

function isEntitled(
address[] memory,
bytes memory
) external pure override returns (bool) {
return true;
}

function supportsInterface(
bytes4 interfaceId
) public view virtual override returns (bool) {
Expand Down
2 changes: 1 addition & 1 deletion core/contracts/base/channels.go

Large diffs are not rendered by default.

53 changes: 42 additions & 11 deletions core/contracts/base/deploy/mock_custom_entitlement.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 41 additions & 10 deletions core/contracts/base/i_custom_entitlement.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/generated/dev/abis/Architect.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions packages/generated/dev/abis/Architect.metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@
"@prb/math/=lib/@prb/math/src/",
"@prb/test/=lib/@prb/test/src/",
"account-abstraction/=lib/account-abstraction/contracts/",
"base64/=lib/base64/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"hardhat-deploy/=lib/hardhat-deploy/",
Expand Down Expand Up @@ -908,10 +909,10 @@
"license": "MIT"
},
"contracts/src/spaces/facets/entitlements/IEntitlementsManager.sol": {
"keccak256": "0x3be8ab93ad7f1417c0b0f6aa3f74dca36034464085d40fd2e94f3b31ff5be03d",
"keccak256": "0x3a706517df398a51e19fac4a3c1987886605b8a8fdff319dbe8acc8efb786d30",
"urls": [
"bzz-raw://4e97436fca686896a1ffc56dd64f58997775bef504e0568c62ba4d103a99939c",
"dweb:/ipfs/QmWn5wvuuEFDhnqXJcJVb69ndDmhUMXWdUGYKR2VBfLsEw"
"bzz-raw://7ba8da65886f17602bad12eac53f57079321b88030d77be1437d5a77b51b7763",
"dweb:/ipfs/QmZWdoM6Drtd9XaPJ8UxBQLSSrqBPViE5UvukDw3i7rah3"
],
"license": "MIT"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/generated/dev/abis/Channels.bin

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/generated/dev/abis/Channels.json

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions packages/generated/dev/abis/Channels.metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,7 @@
"@prb/math/=lib/@prb/math/src/",
"@prb/test/=lib/@prb/test/src/",
"account-abstraction/=lib/account-abstraction/contracts/",
"base64/=lib/base64/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"hardhat-deploy/=lib/hardhat-deploy/",
Expand Down Expand Up @@ -1271,10 +1272,10 @@
"license": "MIT"
},
"contracts/src/spaces/facets/Entitled.sol": {
"keccak256": "0x90204085688bf4dd1e1b6ca30684ee37db79210070c405406898c8a77d50bfce",
"keccak256": "0xca49627508cf6ce3b13e8f940eb42bd7ba7ff099b6553d8c955d033706f01e21",
"urls": [
"bzz-raw://b9b194cc9977b03fbccc81529147a0fce7857893c8146927570c1ee5a28aa900",
"dweb:/ipfs/QmZMvPPj5ZPYaRQaSraBkv3PSMeUZ4wN1tQ9EVvwW6SL4r"
"bzz-raw://3b06c1964b177029adac40ff553cc9c2dccffa38d3fa5c28f6eb6a35f3983d49",
"dweb:/ipfs/QmaYwyL49DHRjwLZnHK3ePv6u8yzFXGwSsFuriYCeQEwCE"
],
"license": "MIT"
},
Expand Down Expand Up @@ -1375,10 +1376,10 @@
"license": "MIT"
},
"contracts/src/spaces/facets/entitlements/EntitlementsManagerStorage.sol": {
"keccak256": "0x688692231af49bcca80f7da97be12d448b0c20a4338d259d5f654b95c5b046ca",
"keccak256": "0x932608993bef144e63002ddef41a5c3cd3e800b49f7b18e0614da4912800d22d",
"urls": [
"bzz-raw://be9964e110363bf68fb4bbb8ff230fecf8c26e695077910ba07163db57030a8e",
"dweb:/ipfs/QmNS3eUqCQU7H48LtW6hrB9xPGy9DrKCqh7JKWsAtje5dK"
"bzz-raw://97e1e32435b60f4697a98679884b36c6912cc31a942bf2c92af6590c58c64ca9",
"dweb:/ipfs/QmNWcuZvzPqgQk2cLsmq7T71oMZGh22Mx1BwKz6Sj1cMAu"
],
"license": "MIT"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/generated/dev/abis/Diamond.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/generated/dev/abis/Diamond.metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@
"@prb/math/=lib/@prb/math/src/",
"@prb/test/=lib/@prb/test/src/",
"account-abstraction/=lib/account-abstraction/contracts/",
"base64/=lib/base64/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"hardhat-deploy/=lib/hardhat-deploy/",
Expand Down
2 changes: 1 addition & 1 deletion packages/generated/dev/abis/DiamondCutFacet.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@
"@prb/math/=lib/@prb/math/src/",
"@prb/test/=lib/@prb/test/src/",
"account-abstraction/=lib/account-abstraction/contracts/",
"base64/=lib/base64/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"hardhat-deploy/=lib/hardhat-deploy/",
Expand Down
Loading
Loading