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

M05 #27

Merged
merged 29 commits into from Jul 31, 2023
Merged

M05 #27

merged 29 commits into from Jul 31, 2023

Conversation

sfeyal
Copy link
Contributor

@sfeyal sfeyal commented Jun 21, 2023

No description provided.

src/ISphereXEngine.sol Show resolved Hide resolved
src/SphereXEngine.sol Outdated Show resolved Hide resolved
src/SphereXEngine.sol Outdated Show resolved Hide resolved
src/SphereXEngine.sol Outdated Show resolved Hide resolved
src/SphereXEngine.sol Outdated Show resolved Hide resolved
src/SphereXEngine.sol Outdated Show resolved Hide resolved
src/SphereXEngine.sol Show resolved Hide resolved
src/SphereXProtected.sol Outdated Show resolved Hide resolved
src/SphereXProtected.sol Show resolved Hide resolved
src/SphereXProtectedBase.sol Show resolved Hide resolved
event TxStartedAtIrregularDepth();
event ConfigureRules(bytes8 oldRules, bytes8 newRules);
event AddedAllowedSenders(address[] senders);
event AddedAllowedSendersOnchain(address sender);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either change to (address[] senders) or the name to AddedAllowedSenderOnchain

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the second


/**
* @title SphereX base Customer contract template
* @dev notice this is an abstract
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the notice?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

/**
* @dev used when the client uses a proxy - should be called by the inhereter initialization
*/
function __SphereXProtected_init(address admin, address operator ,address engine) internal virtual {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is virtual?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to let the client inherit and change the initialization process if he wishes

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we want him to have the option of chaining the protected init process?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not a matter of will but a matter of convention

@@ -32,7 +32,11 @@ contract SphereXEngine is ISphereXEngine, AccessControlDefaultAdminRules {
bytes32 internal constant DEACTIVATED = bytes32(0);
uint64 internal constant RULES_1_AND_2_TOGETHER = 3;

// the index of the addAllowedSenderOnChain in the call flow
int256 internal constant ADD_ALLOWED_SENDER_ONCHAIN_INDEX = 5000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure 5000 is a good value. Maybe consider something around MAX_INT256

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or hash of something

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Michaelr-spherex check the change does not brake your life

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will not. I just want to know the final value to adjust to it

ArielTM

This comment was marked as resolved.

test/Utils/CostumerContract.sol Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/SphereXEngine.sol Show resolved Hide resolved
src/SphereXProtectedBase.sol Outdated Show resolved Hide resolved
@@ -377,16 +377,17 @@ contract SphereXProtectedTest is Test, CFUtils {
SomeContract(someContract).someFunc();
}

function test_factoryEngineDisabledr() public {
function test_factoryEngineDisabled() public {
spherex_engine.grantRole(spherex_engine.SENDER_ADDER_ROLE(), address(costumer_contract));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operator should be able to grant this role, not the admin

test/SphereXProtected.t.sol Show resolved Hide resolved
@@ -165,6 +165,10 @@ contract SphereXEngine is ISphereXEngine, AccessControlDefaultAdminRules {
emit RemovedAllowedPatterns(patterns);
}

function grantSenderAdderRole(address newSenderAdder) external onlyOperator {
super._grantRole(SENDER_ADDER_ROLE, newSenderAdder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is super necessary? I think it's just when you have the same function name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, and fixed test

@sfeyal sfeyal changed the base branch from L12 to collecting-storage-internal-functions July 4, 2023 07:21
@sfeyal sfeyal merged commit 4a33354 into collecting-storage-internal-functions Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants