LibMagpieAggregator
It defines a storage structure and utility functions for managing various settings and data in the Magpie Aggregator application.
struct CurveSettings {
address mainRegistry;
address cryptoRegistry;
address cryptoFactory;
}
struct Amm {
uint8 protocolId;
bytes4 selector;
address addr;
}
struct WormholeBridgeSettings {
address bridgeAddress;
}
struct StargateSettings {
address routerAddress;
}
struct WormholeSettings {
address bridgeAddress;
uint8 consistencyLevel;
}
struct LayerZeroSettings {
address routerAddress;
}
struct CelerBridgeSettings {
address messageBusAddress;
}
struct AppStorage {
address weth;
uint16 networkId;
mapping(uint16 => bytes32) magpieAggregatorAddresses;
mapping(address => uint256) deposits;
mapping(address => mapping(address => uint256)) depositsByUser;
mapping(uint16 => mapping(bytes32 => mapping(uint64 => bool))) usedTransferKeys;
uint64 swapSequence;
// Pausable
bool paused;
// Reentrancy Guard
bool guarded;
// Amm
mapping(uint16 => Amm) amms;
// Curve Amm
CurveSettings curveSettings;
// Data Transfer
mapping(uint16 => mapping(uint16 => mapping(bytes32 => mapping(uint64 => bytes)))) payloads;
// Stargate Bridge
StargateSettings stargateSettings;
mapping(uint16 => bytes32) magpieStargateBridgeAddresses;
// Wormhole Bridge
WormholeBridgeSettings wormholeBridgeSettings;
mapping(uint64 => uint64) wormholeTokenSequences;
// Wormhole Data Transfer
WormholeSettings wormholeSettings;
mapping(uint16 => uint16) wormholeNetworkIds;
mapping(uint64 => uint64) wormholeCoreSequences;
// LayerZero Data Transfer
LayerZeroSettings layerZeroSettings;
mapping(uint16 => uint16) layerZeroChainIds;
mapping(uint16 => uint16) layerZeroNetworkIds;
address magpieRouterAddress;
mapping(uint16 => mapping(bytes32 => mapping(uint64 => mapping(address => uint256)))) stargateDeposits;
mapping(uint8 => bool) delegatedCalls;
// Celer Bridge
CelerBridgeSettings celerBridgeSettings;
mapping(uint16 => uint64) celerChainIds;
mapping(uint16 => mapping(bytes32 => mapping(uint64 => mapping(address => uint256)))) celerDeposits;
mapping(uint16 => mapping(bytes32 => mapping(uint64 => address))) celerRefundAddresses;
mapping(uint16 => bytes32) magpieCelerBridgeAddresses;
mapping(uint16 => mapping(uint16 => mapping(bytes32 => mapping(uint64 => bytes32)))) payloadHashes;
mapping(uint16 => bytes32) magpieStargateBridgeV2Addresses;
}
getStorage():
returns a reference to the AppStorage
struct.
Output:
Last updated