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

fix: Rewards v2 audit fixes #346

Merged
merged 2 commits into from
Jan 3, 2025
Merged

fix: Rewards v2 audit fixes #346

merged 2 commits into from
Jan 3, 2025

Conversation

0xrajath
Copy link

@0xrajath 0xrajath commented Jan 2, 2025

Motivation

As part of the Rewards v2 SigmaPrime audit, we need to tackle issue ELSC2-05: Missing SafeERC20 Usage For Token Interactions

Modifications

  • Use safeTransferFrom instead of transferFrom
  • Use safeIncreaseAllowance instead of approve (allowance + value)

Result

Rewards v2 audit fixes.

@0xrajath 0xrajath self-assigned this Jan 2, 2025
@0xrajath 0xrajath merged commit 027226b into dev Jan 3, 2025
3 checks passed
@0xrajath 0xrajath deleted the rajath/rewards-v2-audit-fixes branch January 3, 2025 14:54
daring5920 added a commit to 0xJomo/eigenlayer-middleware-fork that referenced this pull request Jan 6, 2025
* perf: refactor to modifers to use internal functions (Layr-Labs#272)

* perf: refactor index registry to use internal functions for modifier (Layr-Labs#269)

* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function

* perf: refactor apk modifiers to use internal functions (Layr-Labs#268)

* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function

* perf: refactor modifiers to use internal functions for stake registry (Layr-Labs#266)

* fix: deprecated struct field for earning receiver

* refactor: require statements to internal functions

* test: update revert reason strings

* fix: storage layout (Layr-Labs#275)

updated inheritance to allow the EigenDAServiceManager to maintain its current storage layout

* feat: reward initiator for ECDSAServiceManagerBase (Layr-Labs#274)

* feat: reward initiator for ECDSAServiceManagerBase

* fix: update gap

* feat: changes to onlyRewardsInitiator modifier

* fix: error code

* fix: comment typos in IServiceManagerUI (Layr-Labs#278)

* fix: correct index get operator restakable strategies (Layr-Labs#280)

* fix: add unit tests for ECDSAServiceManager and fix index in getOperatorRestakableStrategies

* chore: formatter

* chore: formatter

* chore: update dev to eigenlayer contracts dev (Layr-Labs#282)

* chore: update to latest eigenlayer-contracts dev

* fix: update mocks

* fix: increase gas limit

* fix: overflow (Layr-Labs#290)

* feat: mainnet rewards release tag (Layr-Labs#297)

* build: update core submodule to new release (Layr-Labs#298)

* build: update core submodule to new release

* fix: flakey tests from pepe upgrade

* add overrides (Layr-Labs#302)

Co-authored-by: steven <[email protected]>

* onchain socket (Layr-Labs#307)

* feat: onchain socket

moves sockets onchain to SM

* feat: socket registry

- move storage to new registry
- leave event in RegCoord
- trim bytecode from error strings

* fix: internal function

internal function to update socket

* chore: bump dependency with core to v0.4.3-mainnet-rewards-programmatic-incentives (Layr-Labs#314)

* chore: bump core dep

* fix: intefface changes from dependency bump

* test: vm.skip stale stake case

* feat: ejection policy change (Layr-Labs#313)

* feat: ejection stake capping

* fix: behavior

* feat: Rewards v2 (Layr-Labs#315)

* chore: bump up eigenlayer contracts dependency

* feat: createAVSPerformanceRewardsSubmission in AVSServiceManager

* feat: setClaimerFor

* feat: updated IServiceManager

* fix: onlyOwner for setClaimerFor

* refactor: commission to split terminology

* test: not owner

* test: erc20 not approved

* test: single submission

* test: multiple submissions

* test: setClaimer

* chore: updated events

* chore: updated submodules

* ejector fix (Layr-Labs#322)

* fix: ejector

* fix: ejector

* fix: nit

* fix: for real this time

* test: fix

* fix: ejector owner (Layr-Labs#326)

* test: socket registry (Layr-Labs#327)

* docs: fix typos and add note that large array may cause revert (Layr-Labs#323)

* fix: Rewards v2 audit fixes (Layr-Labs#346)

* fix: using SafeERC20

* docs: comment

---------

Co-authored-by: steven <[email protected]>
Co-authored-by: quaq <[email protected]>
Co-authored-by: Gajesh Naik <[email protected]>
Co-authored-by: Samuel Laferriere <[email protected]>
Co-authored-by: Madhur Shrimal <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Gautham Anant <[email protected]>
Co-authored-by: Rajath Alex <[email protected]>
Co-authored-by: Nadir Akhtar <[email protected]>
daring5920 added a commit to 0xJomo/eigenlayer-middleware-fork that referenced this pull request Jan 6, 2025
* perf: refactor to modifers to use internal functions (Layr-Labs#272)

* perf: refactor index registry to use internal functions for modifier (Layr-Labs#269)

* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function

* perf: refactor apk modifiers to use internal functions (Layr-Labs#268)

* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function

* perf: refactor modifiers to use internal functions for stake registry (Layr-Labs#266)

* fix: deprecated struct field for earning receiver

* refactor: require statements to internal functions

* test: update revert reason strings

* fix: storage layout (Layr-Labs#275)

updated inheritance to allow the EigenDAServiceManager to maintain its current storage layout

* feat: reward initiator for ECDSAServiceManagerBase (Layr-Labs#274)

* feat: reward initiator for ECDSAServiceManagerBase

* fix: update gap

* feat: changes to onlyRewardsInitiator modifier

* fix: error code

* fix: comment typos in IServiceManagerUI (Layr-Labs#278)

* fix: correct index get operator restakable strategies (Layr-Labs#280)

* fix: add unit tests for ECDSAServiceManager and fix index in getOperatorRestakableStrategies

* chore: formatter

* chore: formatter

* chore: update dev to eigenlayer contracts dev (Layr-Labs#282)

* chore: update to latest eigenlayer-contracts dev

* fix: update mocks

* fix: increase gas limit

* fix: overflow (Layr-Labs#290)

* feat: mainnet rewards release tag (Layr-Labs#297)

* build: update core submodule to new release (Layr-Labs#298)

* build: update core submodule to new release

* fix: flakey tests from pepe upgrade

* add overrides (Layr-Labs#302)

Co-authored-by: steven <[email protected]>

* onchain socket (Layr-Labs#307)

* feat: onchain socket

moves sockets onchain to SM

* feat: socket registry

- move storage to new registry
- leave event in RegCoord
- trim bytecode from error strings

* fix: internal function

internal function to update socket

* chore: bump dependency with core to v0.4.3-mainnet-rewards-programmatic-incentives (Layr-Labs#314)

* chore: bump core dep

* fix: intefface changes from dependency bump

* test: vm.skip stale stake case

* feat: ejection policy change (Layr-Labs#313)

* feat: ejection stake capping

* fix: behavior

* feat: Rewards v2 (Layr-Labs#315)

* chore: bump up eigenlayer contracts dependency

* feat: createAVSPerformanceRewardsSubmission in AVSServiceManager

* feat: setClaimerFor

* feat: updated IServiceManager

* fix: onlyOwner for setClaimerFor

* refactor: commission to split terminology

* test: not owner

* test: erc20 not approved

* test: single submission

* test: multiple submissions

* test: setClaimer

* chore: updated events

* chore: updated submodules

* ejector fix (Layr-Labs#322)

* fix: ejector

* fix: ejector

* fix: nit

* fix: for real this time

* test: fix

* fix: ejector owner (Layr-Labs#326)

* test: socket registry (Layr-Labs#327)

* docs: fix typos and add note that large array may cause revert (Layr-Labs#323)

* fix: Rewards v2 audit fixes (Layr-Labs#346)

* fix: using SafeERC20

* docs: comment

---------

Co-authored-by: steven <[email protected]>
Co-authored-by: quaq <[email protected]>
Co-authored-by: Gajesh Naik <[email protected]>
Co-authored-by: Samuel Laferriere <[email protected]>
Co-authored-by: Madhur Shrimal <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Gautham Anant <[email protected]>
Co-authored-by: Rajath Alex <[email protected]>
Co-authored-by: Nadir Akhtar <[email protected]>
daring5920 added a commit to 0xJomo/eigenlayer-middleware-fork that referenced this pull request Jan 6, 2025
* perf: refactor to modifers to use internal functions (Layr-Labs#272)

* perf: refactor index registry to use internal functions for modifier (Layr-Labs#269)

* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function

* perf: refactor apk modifiers to use internal functions (Layr-Labs#268)

* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function

* perf: refactor modifiers to use internal functions for stake registry (Layr-Labs#266)

* fix: deprecated struct field for earning receiver

* refactor: require statements to internal functions

* test: update revert reason strings

* fix: storage layout (Layr-Labs#275)

updated inheritance to allow the EigenDAServiceManager to maintain its current storage layout

* feat: reward initiator for ECDSAServiceManagerBase (Layr-Labs#274)

* feat: reward initiator for ECDSAServiceManagerBase

* fix: update gap

* feat: changes to onlyRewardsInitiator modifier

* fix: error code

* fix: comment typos in IServiceManagerUI (Layr-Labs#278)

* fix: correct index get operator restakable strategies (Layr-Labs#280)

* fix: add unit tests for ECDSAServiceManager and fix index in getOperatorRestakableStrategies

* chore: formatter

* chore: formatter

* chore: update dev to eigenlayer contracts dev (Layr-Labs#282)

* chore: update to latest eigenlayer-contracts dev

* fix: update mocks

* fix: increase gas limit

* fix: overflow (Layr-Labs#290)

* feat: mainnet rewards release tag (Layr-Labs#297)

* build: update core submodule to new release (Layr-Labs#298)

* build: update core submodule to new release

* fix: flakey tests from pepe upgrade

* add overrides (Layr-Labs#302)

Co-authored-by: steven <[email protected]>

* onchain socket (Layr-Labs#307)

* feat: onchain socket

moves sockets onchain to SM

* feat: socket registry

- move storage to new registry
- leave event in RegCoord
- trim bytecode from error strings

* fix: internal function

internal function to update socket

* chore: bump dependency with core to v0.4.3-mainnet-rewards-programmatic-incentives (Layr-Labs#314)

* chore: bump core dep

* fix: intefface changes from dependency bump

* test: vm.skip stale stake case

* feat: ejection policy change (Layr-Labs#313)

* feat: ejection stake capping

* fix: behavior

* feat: Rewards v2 (Layr-Labs#315)

* chore: bump up eigenlayer contracts dependency

* feat: createAVSPerformanceRewardsSubmission in AVSServiceManager

* feat: setClaimerFor

* feat: updated IServiceManager

* fix: onlyOwner for setClaimerFor

* refactor: commission to split terminology

* test: not owner

* test: erc20 not approved

* test: single submission

* test: multiple submissions

* test: setClaimer

* chore: updated events

* chore: updated submodules

* ejector fix (Layr-Labs#322)

* fix: ejector

* fix: ejector

* fix: nit

* fix: for real this time

* test: fix

* fix: ejector owner (Layr-Labs#326)

* test: socket registry (Layr-Labs#327)

* docs: fix typos and add note that large array may cause revert (Layr-Labs#323)

* fix: Rewards v2 audit fixes (Layr-Labs#346)

* fix: using SafeERC20

* docs: comment

---------

Co-authored-by: steven <[email protected]>
Co-authored-by: quaq <[email protected]>
Co-authored-by: Gajesh Naik <[email protected]>
Co-authored-by: Samuel Laferriere <[email protected]>
Co-authored-by: Madhur Shrimal <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Gautham Anant <[email protected]>
Co-authored-by: Rajath Alex <[email protected]>
Co-authored-by: Nadir Akhtar <[email protected]>
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.

3 participants