trustless-generic-relayer/ethereum/contracts/coreRelayer/CoreRelayerState.sol

48 lines
1.6 KiB
Solidity
Raw Normal View History

Add tests for send and deliver functionality (#9) * Complete send and deliver functionality * Clean up * Add tests for relayer send method * ethereum: remove interfaces * ethereum: fix test * ethereum: rename directory * ethereum: clean up; add ts tests * Add tests and clean up * ethereum: fix test * ethereum: fix output * Add reentrancy protection and reduce gas overhead for relayers * Add tests for full batch delivery * Update relayer contracts to reflect changes to batch VAA implementation * add rewards payout * implement redeliveries, replay protection * Complete full batch test suite * sdk: add sdk * sdk: fix package.json * Add partial batch unit test and add to integration test * Fix comments in integration test * sdk: fix tsconfig.json * ethereum: fix build * Add relayer registration to integration test * Finish integration test suite * ethereum: fix readAbi * ethereum: fix merge conflict * Complete full batch test suite * Add partial batch unit test and add to integration test * Finish integration test suite * Fix local validator test * Fix merge conflict * Add Makefile * Add documentation to relayer contracts * Fix Makefile * ethereum: clean up * ethereum: fix interface * ethereum: fix method names and tests * Prepare integration test for off-chain relayer changes * Refactor contracts Co-authored-by: Drew <dsterioti@users.noreply.github.com> Co-authored-by: Karl Kempe <karlkempe@users.noreply.github.com> Co-authored-by: valentin <valentinvonalbrecht@yahoo.de> Co-authored-by: justinschuldt <justinschuldt@gmail.com>
2022-09-30 09:18:49 -07:00
// contracts/State.sol
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;
import "./CoreRelayerStructs.sol";
contract CoreRelayerStorage {
struct Provider {
uint16 chainId;
address payable wormhole;
}
struct State {
Provider provider;
// number of confirmations for wormhole messages
uint8 consistencyLevel;
// delivery lock for reentrancy protection
bool contractLock;
// authority of these contracts
address owner;
// intermediate state when transfering contract ownership
address pendingOwner;
// address of the gas oracle on this chain
address gasOracle;
// EVM gas overhead for interacting with the relayer contracts
uint32 evmDeliverGasOverhead;
// mapping of initialized implementations
mapping(address => bool) initializedImplementations;
// mapping of relayer contracts on other chains
mapping(uint16 => bytes32) registeredRelayers;
// mapping of delivered relayer VAAs
mapping(bytes32 => bool) completedDeliveries;
// mapping of attempted, failed deliveries for a batch
mapping(bytes32 => uint16) attemptedDeliveries;
// mapping of attempted initiated redelivery index
mapping(bytes32 => uint16) redeliveryAttempts;
// mapping of rewards that a relayer can claim on the source chain
mapping(address => mapping(uint16 => uint256)) relayerRewards;
// storage gap to reduce risk of storage collisions
uint256[50] ______gap;
}
}
contract CoreRelayerState {
CoreRelayerStorage.State _state;
}