Skip to content

fix(contracts): check address are not zero in initialization - #1094

Merged
JuArce merged 9 commits into
stagingfrom
1020-fixcontracts-batcherpaymentservice-contract-does-not-check-that-an-address-is-not-equal-to-address0-during-constructor-or-initialization
Sep 30, 2024
Merged

fix(contracts): check address are not zero in initialization#1094
JuArce merged 9 commits into
stagingfrom
1020-fixcontracts-batcherpaymentservice-contract-does-not-check-that-an-address-is-not-equal-to-address0-during-constructor-or-initialization

Conversation

@MarcosNicolau

@MarcosNicolauMarcosNicolau commented Sep 25, 2024

Copy link
Copy Markdown
Collaborator

Changes
This pr adds checks to make sure addresses are not zero while initializing the contracts.

Solves audit from fuzzing-labs.

Closes#1020
Closes#1002
Closes#1109

@github-actions

github-actionsBot commented Sep 25, 2024

Copy link
Copy Markdown

Changes to gas cost

Generated at commit: 6e73b22909a88766d05759f846bac06f70bb1d76, compared to commit: 4b2fabe8efd54cc36a600f08767aaaeec90cd991

🧾 Summary (10% most significant diffs)

ContractMethodAvg (+/-)%
AlignedLayerServiceManagercreateNewTask+255 ❌+0.35%

Full diff report 👇
ContractDeployment Cost (+/-)MethodMin (+/-)%Avg (+/-)%Median (+/-)%Max (+/-)%# Calls (+/-)
AlignedLayerServiceManager4,681,797 (+52,382)createNewTask
receive
53,835 (+12)
21,169 (0)
+0.02%
0.00%
73,908 (+255)
44,877 (+280)
+0.35%
+0.63%
74,011 (+42)
45,064 (0)
+0.06%
0.00%
74,965 (+219)
45,064 (0)
+0.29%
0.00%
256 (0)
256 (0)
RegistryCoordinatorHarness5,846,016 (+17,263)

Comment threadcontracts/src/core/AlignedLayerServiceManager.sol

@uri-99uri-99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Every time any contract changes, we should push the new anvil-state to make sure we can simply run make anvil_start on a branch and know we are dealing with the current branch's contracts.

For this, you must push the .json file generated when running make anvil_deploy_aligned_contracts

The rest seems OK

@MarcosNicolau
MarcosNicolauforce-pushed the 1020-fixcontracts-batcherpaymentservice-contract-does-not-check-that-an-address-is-not-equal-to-address0-during-constructor-or-initialization branch from 3bac7b4 to e2730eeCompareSeptember 30, 2024 12:39
@MarcosNicolau
MarcosNicolauforce-pushed the 1020-fixcontracts-batcherpaymentservice-contract-does-not-check-that-an-address-is-not-equal-to-address0-during-constructor-or-initialization branch from c8abcff to d081866CompareSeptember 30, 2024 12:54
…ontract-does-not-check-that-an-address-is-not-equal-to-address0-during-constructor-or-initialization
@JuArce
JuArce merged commit 014bd4d into stagingSep 30, 2024
@JuArce
JuArce deleted the 1020-fixcontracts-batcherpaymentservice-contract-does-not-check-that-an-address-is-not-equal-to-address0-during-constructor-or-initialization branch September 30, 2024 19:52
@OppenOppen mentioned this pull request Sep 30, 2024
PatStiles pushed a commit that referenced this pull request Oct 1, 2024
Co-authored-by: Urix <43704209+uri-99@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@MarcosNicolau@PatStiles@uri-99@JuArce@IAvecilla