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: state dump issue #94

Closed
wants to merge 3 commits into from
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
2 changes: 1 addition & 1 deletion contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ optimizer_runs = 200
# Whether or not to use the Yul intermediate representation compilation pipeline
via_ir = false
# Override the Solidity version (this overrides `auto_detect_solc`)
solc_version = '0.8.12'
solc_version = '0.8.27'

[fmt]
bracket_spacing = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"avsDirectory": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
"avsDirectoryImplementation": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
"baseStrategyImplementation": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44",
"delayedWithdrawalRouter": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
"delayedWithdrawalRouterImplementation": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
"delegation": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
"delegationImplementation": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
"eigenLayerPauserReg": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
Expand All @@ -14,6 +12,8 @@
"eigenPodManager": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853",
"eigenPodManagerImplementation": "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
"emptyContract": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
"rewardsCoordinator": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
"rewardsCoordinatorImplementation": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
"slasher": "0x0165878A594ca255338adfa4d48449f69242Eb8F",
"slasherImplementation": "0x9A676e781A523b5d0C0e43731313A708CB607508",
"strategies": "",
Expand Down
2 changes: 1 addition & 1 deletion contracts/script/utils/Utils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.12;
pragma solidity ^0.8.12;

import "@eigenlayer-middleware/src/interfaces/IRegistryCoordinator.sol";
import "@eigenlayer/contracts/strategies/StrategyBase.sol";
Expand Down
26 changes: 25 additions & 1 deletion operator/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,20 @@
} else {
o.logger.Infof("Registered operator with eigenlayer")
}

// TODO(samlaf): shouldn't hardcode number here
amount := big.NewInt(1000)
// Approve tokens
tx, err = contractErc20Mock.Approve(txOpts, strategyAddr, amount)

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: tx

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: contractErc20Mock

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: txOpts

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: strategyAddr

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: tx

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: contractErc20Mock

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: txOpts

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: strategyAddr
if err != nil {
o.logger.Error("Error assembling Approve tx", "err", err)
return err

Check failure on line 42 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

too many return values

Check failure on line 42 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

too many return values
}
_, err = o.avsWriter.TxMgr.Send(context.Background(), tx)

Check failure on line 44 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: tx

Check failure on line 44 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: tx
if err != nil {
o.logger.Error("Error submitting Approve tx", "err", err)
return err

Check failure on line 47 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

too many return values

Check failure on line 47 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

too many return values
}

err = o.DepositIntoStrategy(mockTokenStrategyAddr, amount)
if err != nil {
o.logger.Fatal("Error depositing into strategy", "err", err)
Expand Down Expand Up @@ -85,6 +96,19 @@
return err
}

// Approve tokens
tx, err = contractErc20Mock.Approve(txOpts, strategyAddr, amount)
if err != nil {
o.logger.Error("Error assembling Approve tx", "err", err)
return err
}
_, err = o.avsWriter.TxMgr.Send(context.Background(), tx)
if err != nil {
o.logger.Error("Error submitting Approve tx", "err", err)
return err
}

// Deposit into strategy
_, err = o.eigenlayerWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount)
if err != nil {
o.logger.Errorf("Error depositing into strategy", "err", err)
Expand Down
2 changes: 1 addition & 1 deletion tests/anvil/avs-and-eigenlayer-deployed-anvil-state.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/anvil/deploy-avs-save-anvil-state.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jq '.number = "'$(cast block-number)'"' $GENESIS_FILE >$TMP_GENESIS_FILE
mv $TMP_GENESIS_FILE $GENESIS_FILE

# we also do this here to make sure the operator has funds to register with the eigenlayer contracts
cast send 0x860B6912C2d0337ef05bbC89b0C2CB6CbAEAB4A5 --value 10ether --private-key 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6
# cast send 0x860B6912C2d0337ef05bbC89b0C2CB6CbAEAB4A5 --value 10ether --private-key 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 --data 0x
2 changes: 1 addition & 1 deletion tests/anvil/eigenlayer-deployed-anvil-state.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/anvil/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
}
},
"number": "7",
"number": "6",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"config": {
Expand Down
Loading