Skip to content

Commit

Permalink
move gnosis + eigenlayer into external/integrations (#374)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 2f2f29b623be47ef4ada6958426e015bd8dfb6ad
  • Loading branch information
mattstam committed May 1, 2023
1 parent 5b8eefe commit ff6106c
Show file tree
Hide file tree
Showing 22 changed files with 75 additions and 13 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions external/examples/drills/DrillLightClient.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pragma solidity 0.8.16;

import {LightClient} from "src/lightclient/LightClient.sol";
import {Ownable} from "openzeppelin-contracts/access/Ownable.sol";

/// @title DrillLightClient
/// @dev This contract is used solely for testing purposes and should not be used by production contracts.
contract DrillLightClient is LightClient, Ownable {
constructor(address emitter) LightClient(0, 0, 0, 0, 0, 0, 0, 0) Ownable() {
transferOwnership(emitter);
}

function emitFakeHeadUpdateEvent(uint256 _slot, bytes32 _root) external onlyOwner {
emit HeadUpdate(_slot, _root);
}

function emitFakeSyncCommitteeUpdateEvent(uint256 _period, bytes32 _root) external onlyOwner {
emit SyncCommitteeUpdate(_period, _root);
}
}
33 changes: 33 additions & 0 deletions external/examples/drills/DrillTelepathyRouter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pragma solidity 0.8.16;

import {TargetAMB} from "src/amb/TargetAMB.sol";
import {TelepathyStorage} from "src/amb/TelepathyStorage.sol";
import {TelepathyAccess} from "src/amb/TelepathyAccess.sol";
import {Ownable} from "openzeppelin-contracts/access/Ownable.sol";

/// @title DrillTelepathy
/// @dev This contract is used solely for testing purposes and should not be used by production contracts.
contract DrillTelepathyRouter is TelepathyStorage, TargetAMB {
address guardian;
address emitter;

constructor(address _guardian, address _emitter) {
guardian = _guardian;
emitter = _emitter;
}

function freezeAll() external view {
require(msg.sender == guardian);
}

function emitFakeExecutedMessageEvent(
uint16 _chainId,
uint64 _nonce,
bytes32 _msgHash,
bytes memory _message,
bool _status
) external {
require(msg.sender == emitter);
emit ExecutedMessage(_chainId, _nonce, _msgHash, _message, _status);
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ pragma solidity 0.8.16;

import {ILightClient} from "src/lightclient/interfaces/ILightClient.sol";
import {SSZ} from "src/libraries/SimpleSerialize.sol";
import {ILightClientUpdater} from "src/integrations/eigenlayer/ILightClientUpdater.sol";
import {ILightClientUpdater} from "external/integrations/eigenlayer/ILightClientUpdater.sol";
import {EigenLayerBeaconOracleStorage} from
"src/integrations/eigenlayer/EigenLayerBeaconOracleStorage.sol";
"external/integrations/eigenlayer/EigenLayerBeaconOracleStorage.sol";
import {ReentrancyGuardUpgradeable} from
"openzeppelin-contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {AccessControlUpgradeable} from

import {ILightClient} from "src/lightclient/interfaces/ILightClient.sol";

import {EigenLayerBeaconOracle} from "src/integrations/eigenlayer/EigenLayerBeaconOracle.sol";
import {EigenLayerBeaconOracle} from "external/integrations/eigenlayer/EigenLayerBeaconOracle.sol";

/// @title EigenLayer Beacon Oracle Proxy
/// @author Succinct Labs
Expand Down
25 changes: 17 additions & 8 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[profile.default]
src = 'examples'
src = 'src'
out = 'out'
libs = ['lib']
solc_version = "0.8.16"
verbosity = 3
fs_permissions = [{ access = "read-write", path = "./"}]

# https://book.getfoundry.sh/reference/config/formatter#line_length
[fmt]
line_length = 100
tab_width = 4
func_attrs_with_params_multiline = true
ignore = ["lib/**"]
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
[profile.external]
src = 'external'
out = 'out'
libs = ['lib']
solc_version = "0.8.16"
verbosity = 3
fs_permissions = [{ access = "read-write", path = "./"}]

[profile.misc]
src = 'misc'
Expand All @@ -21,3 +21,12 @@ libs = ['lib']
solc_version = "0.8.16"
verbosity = 3
fs_permissions = [{ access = "read-write", path = "./"}]

# https://book.getfoundry.sh/reference/config/formatter#line_length
[fmt]
line_length = 100
tab_width = 4
func_attrs_with_params_multiline = true
ignore = ["lib/**"]

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
4 changes: 2 additions & 2 deletions test/integrations/EigenLayerBeaconOracleTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {SSZ} from "src/libraries/SimpleSerialize.sol";
import {LightClient, LightClientStep, LightClientRotate} from "src/lightclient/LightClient.sol";
import {LightClientFixture} from "test/lightclient/LightClientFixture.sol";
import {Strings} from "openzeppelin-contracts/utils/Strings.sol";
import {EigenLayerBeaconOracle} from "src/integrations/eigenlayer/EigenLayerBeaconOracle.sol";
import {EigenLayerBeaconOracle} from "external/integrations/eigenlayer/EigenLayerBeaconOracle.sol";
import {EigenLayerBeaconOracleProxy} from
"src/integrations/eigenlayer/EigenLayerBeaconOracleProxy.sol";
"external/integrations/eigenlayer/EigenLayerBeaconOracleProxy.sol";
import {UUPSProxy} from "src/libraries/Proxy.sol";

import {LightClientMock} from "src/lightclient/LightClientMock.sol";
Expand Down

0 comments on commit ff6106c

Please sign in to comment.