Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
SygmaHeaderReporter
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity ^0.8.17; import { SygmaReporter } from "./SygmaReporter.sol"; import { HeaderStorage } from "../../utils/HeaderStorage.sol"; contract SygmaHeaderReporter is SygmaReporter { HeaderStorage public immutable _headerStorage; event HeaderReported(address indexed emitter, uint256 indexed blockNumber, bytes32 indexed blockHeader); constructor( address bridge, HeaderStorage headerStorage, bytes32 resourceID, uint8 defaultDestinationDomainID, address defaultSygmaAdapter ) SygmaReporter(bridge, resourceID, defaultDestinationDomainID, defaultSygmaAdapter) { _headerStorage = headerStorage; } /** @dev Reports the given block headers to the oracleAdapter via the Sygma bridge to default domain. @param blockNumbers Uint256 array of block numbers to pass over the Sygma bridge. @param feeData Additional data to be passed to the fee handler. */ function reportHeaders(uint256[] memory blockNumbers, bytes calldata feeData) public payable { _reportHeaders(blockNumbers, _defaultSygmaAdapter, _defaultDestinationDomainID, feeData); } /** @dev Reports the given block headers to the oracleAdapter via the Sygma bridge to specified domain. @param blockNumbers Uint256 array of block numbers to pass over the Sygma bridge. @param sygmaAdapter Address of the Sygma adapter on the target chain. @param destinationDomainID Destination domain ID. @param feeData Additional data to be passed to the fee handler. */ function reportHeadersToDomain( uint256[] memory blockNumbers, address sygmaAdapter, uint8 destinationDomainID, bytes memory feeData ) public payable { _reportHeaders(blockNumbers, sygmaAdapter, destinationDomainID, feeData); } function _reportHeaders( uint256[] memory blockNumbers, address sygmaAdapter, uint8 destinationDomainID, bytes memory feeData ) internal { bytes32[] memory blockHeaders = _headerStorage.storeBlockHeaders(blockNumbers); _reportData(blockNumbers, blockHeaders, sygmaAdapter, destinationDomainID, feeData); for (uint i = 0; i < blockNumbers.length; i++) { emit HeaderReported(address(this), blockNumbers[i], blockHeaders[i]); } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; /** @title Interface for Bridge contract. @author ChainSafe Systems. */ interface IBridge { /** @notice Initiates a transfer using a specified handler contract. @notice Only callable when Bridge is not paused. @param destinationDomainID ID of chain deposit will be bridged to. @param resourceID ResourceID used to find address of handler to be used for deposit. @param depositData Additional data to be passed to specified handler. @param feeData Additional data to be passed to the fee handler. @notice Emits {Deposit} event with all necessary parameters. */ function deposit( uint8 destinationDomainID, bytes32 resourceID, bytes calldata depositData, bytes calldata feeData ) external payable returns (uint64 depositNonce, bytes memory handlerResponse); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; interface ISygmaAdapter { function storeHashes(address reporter, uint256[] memory ids, bytes32[] memory _hashes) external; }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity ^0.8.17; import "./interfaces/ISygmaAdapter.sol"; import "./interfaces/IBridge.sol"; contract SygmaReporter { address public immutable _bridge; bytes32 public immutable _resourceID; uint8 public immutable _defaultDestinationDomainID; address public immutable _defaultSygmaAdapter; constructor(address bridge, bytes32 resourceID, uint8 defaultDestinationDomainID, address defaultSygmaAdapter) { _bridge = bridge; _resourceID = resourceID; _defaultDestinationDomainID = defaultDestinationDomainID; _defaultSygmaAdapter = defaultSygmaAdapter; } function _reportData( uint256[] memory messageIds, bytes32[] memory hashes, address sygmaAdapter, uint8 destinationDomainID, bytes memory feeData ) internal returns (uint64 depositNonce, bytes memory handlerResponse) { bytes memory depositData = abi.encodePacked( // uint256 maxFee uint256(950000), // uint16 len(executeFuncSignature) uint16(4), // bytes executeFuncSignature ISygmaAdapter(address(0)).storeHashes.selector, // uint8 len(executeContractAddress) uint8(20), // bytes executeContractAddress sygmaAdapter, // uint8 len(executionDataDepositor) uint8(20), // bytes executionDataDepositor address(this), // bytes executionDataDepositor + executionData prepareDepositData(messageIds, hashes) ); return IBridge(_bridge).deposit{ value: msg.value }(destinationDomainID, _resourceID, depositData, feeData); } function slice(bytes calldata input, uint256 position) public pure returns (bytes memory) { return input[position:]; } function prepareDepositData( uint256[] memory messageIds, bytes32[] memory hashes ) public view returns (bytes memory) { bytes memory encoded = abi.encode(address(0), messageIds, hashes); return this.slice(encoded, 32); } }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity ^0.8.17; interface IHeaderStorage { event HeaderStored(uint256 indexed blockNumber, bytes32 indexed blockHeader); error HeaderOutOfRange(address emitter, uint256 blockNumber); function storeBlockHeader(uint256 blockNumber) external returns (bytes32 blockHeader); function storeBlockHeaders(uint256[] memory blockNumbers) external returns (bytes32[] memory); }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity ^0.8.17; import { IHeaderStorage } from "../interfaces/IHeaderStorage.sol"; contract HeaderStorage is IHeaderStorage { mapping(uint256 => bytes32) public headers; /// @dev Stores and returns the header for the given block. /// @param blockNumber Block number. /// @return blockHeader Block header stored. /// @notice Reverts if the given block header was not previously stored and is now out of range. function storeBlockHeader(uint256 blockNumber) public returns (bytes32 blockHeader) { blockHeader = headers[blockNumber]; if (blockHeader == 0) { blockHeader = blockhash(blockNumber); if (blockHeader == 0) revert HeaderOutOfRange(address(this), blockNumber); headers[blockNumber] = blockHeader; emit HeaderStored(blockNumber, blockHeader); } } /// @dev Stores and returns the header for an array of given blocks. /// @param blockNumbers Array of block numbers. /// @return Array of block headers. /// @notice Reverts if the given block header was not previously stored and is now out of range. function storeBlockHeaders(uint256[] memory blockNumbers) public returns (bytes32[] memory) { bytes32[] memory blockHeaders = new bytes32[](blockNumbers.length); for (uint256 i = 0; i < blockNumbers.length; i++) { blockHeaders[i] = storeBlockHeader(blockNumbers[i]); } return blockHeaders; } }
{ "viaIR": true, "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 800 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"bridge","type":"address"},{"internalType":"contract HeaderStorage","name":"headerStorage","type":"address"},{"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"internalType":"uint8","name":"defaultDestinationDomainID","type":"uint8"},{"internalType":"address","name":"defaultSygmaAdapter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"emitter","type":"address"},{"indexed":true,"internalType":"uint256","name":"blockNumber","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"blockHeader","type":"bytes32"}],"name":"HeaderReported","type":"event"},{"inputs":[],"name":"_bridge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_defaultDestinationDomainID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_defaultSygmaAdapter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_headerStorage","outputs":[{"internalType":"contract HeaderStorage","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_resourceID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"messageIds","type":"uint256[]"},{"internalType":"bytes32[]","name":"hashes","type":"bytes32[]"}],"name":"prepareDepositData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"blockNumbers","type":"uint256[]"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"name":"reportHeaders","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"blockNumbers","type":"uint256[]"},{"internalType":"address","name":"sygmaAdapter","type":"address"},{"internalType":"uint8","name":"destinationDomainID","type":"uint8"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"name":"reportHeadersToDomain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"input","type":"bytes"},{"internalType":"uint256","name":"position","type":"uint256"}],"name":"slice","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
610120346100ed57601f610bc838819003918201601f19168301916001600160401b038311848410176100f25780849260a0946040528339810103126100ed5761004881610108565b6020820151916001600160a01b03831683036100ed57604081015160608201519160ff831683036100ed57608061007f9101610108565b9260805260a05260c05260e052610100908152604051610aab918261011d83396080518281816101270152610777015260a051828181609e015261072b015260c05182818161016401526101dd015260e05182818160e401526101ff0152518181816103fc015261063c0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036100ed5756fe608060408181526004918236101561001657600080fd5b600092833560e01c918263025d42c5146103dd575081630bd3dd4d1461035557816327e471551461029a578163807f0ac51461022b578163a49f6aa11461018857508063aa5d554e1461014b578063c43e5f7d14610108578063cfc41cb8146100c55763f8ad7cc71461008857600080fd5b346100c157816003193601126100c157602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b5080fd5b50346100c157816003193601126100c157602090516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100c157816003193601126100c157602090516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100c157816003193601126100c1576020905160ff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b9136600319011290506100c15767ffffffffffffffff908035828111610227576101b59036908301610470565b90602435928311610227576101d36101da916102249436910161056e565b36916104ef565b907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906105fa565b80f35b8380fd5b90503461029657816003193601126102965780359067ffffffffffffffff82116102275761025b9136910161056e565b926024359084821161029357509261027c918461028f9536930391016104ef565b9051918291602083526020830190610549565b0390f35b80fd5b8280fd5b9050823461029357826003193601126102935767ffffffffffffffff918035838111610296576102cd9036908301610470565b90602435938411610296573660238501121561029657830135916102f083610458565b926102fd86519485610420565b80845260209460248686019260051b8201019236841161029357506024869101915b83831061034557878261028f6103358989610995565b9251928284938452830190610549565b823581529181019186910161031f565b839060803660031901126100c15767ffffffffffffffff8135818111610227576103829036908401610470565b906024356001600160a01b03811681036103d9576044359160ff831683036103d5576064359081116103d557366023820112156103d557610224948160246103cf933693013591016104ef565b926105fa565b8580fd5b8480fd5b8490346100c157816003193601126100c1576020906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b90601f8019910116810190811067ffffffffffffffff82111761044257604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116104425760051b60200190565b81601f820112156104ce5780359161048783610458565b926104956040519485610420565b808452602092838086019260051b8201019283116104ce578301905b8282106104bf575050505090565b813581529083019083016104b1565b600080fd5b67ffffffffffffffff811161044257601f01601f191660200190565b9291926104fb826104d3565b916105096040519384610420565b8294818452818301116104ce578281602093846000960137010152565b60005b8381106105395750506000910152565b8181015183820152602001610529565b9060209161056281518092818552858086019101610526565b601f01601f1916010190565b9181601f840112156104ce5782359167ffffffffffffffff83116104ce57602083818601950101116104ce57565b90815180825260208080930193019160005b8281106105bc575050505090565b8351855293810193928101926001016105ae565b80518210156105e45760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b93929360409081519163ceee6e5560e01b8352602060049481868601526000966024998661062a8c82018861059c565b039289886001600160a01b03958183887f0000000000000000000000000000000000000000000000000000000000000000165af1978815610946579289928d95928c95869b610879575b5060ff929161075f6107719261071160708f8f8f918f916107019161069891610995565b8351620e7ef081850152600160f21b9481019490945263aa4af24560e01b6042850152600560fa1b60468501819052606097881b6bffffffffffffffffffffffff19166047860152605b8501523090961b605c8401528551929586939283918686019101610526565b8101036050810184520182610420565b8b51998a9889978897630e788b9360e31b895216908701527f000000000000000000000000000000000000000000000000000000000000000090860152608060448601526084850190610549565b83810360031901606485015290610549565b039134907f0000000000000000000000000000000000000000000000000000000000000000165af1801561086f5761081a575b505050835b8151811015610811576107bc81836105d0565b516107c782856105d0565b5190307f91d88cce380da58b1f18fc437a4a6342ddea08c9a496e31ae03e16c08fc4fce18880a460001981146107ff576001016107a9565b634e487b7160e01b8552601184528685fd5b50505050509050565b3d8088833e6108298183610420565b810192818403126108675780519167ffffffffffffffff928381160361086b578101519182116108675761085e929101610950565b503880806107a4565b8680fd5b8780fd5b83513d89823e3d90fd5b9396509950925092503d808b833e6108918183610420565b810190858183031261093e5780519067ffffffffffffffff821161094257019080601f8301121561093e5781516108c781610458565b926108d489519485610420565b818452878085019260051b82010192831161093a578b948f97948b908f9894958c968c809601905b828210610911575050509c9250509192610674565b9350959950955095985082919650835181520191018b948f97948b908f9894958b948d976108fc565b8c80fd5b8a80fd5b8b80fd5b86513d8c823e3d90fd5b81601f820112156104ce578051610966816104d3565b926109746040519485610420565b818452602082840101116104ce576109929160208085019101610526565b90565b919091604051906000916109bb602092848484015260606040840152608083019061059c565b601f199081838203016060840152838088519283815201970190855b818110610a8a57505050906109f9849282610a1b979803908101835282610420565b6040518095819263807f0ac560e01b8352604060048401526044830190610549565b8460248301520381305afa928315610a7f578293610a3a575b50505090565b90919392503d8085833e610a4e8183610420565b810191818303126102275780519067ffffffffffffffff82116103d957610a7793945001610950565b388080610a34565b6040513d84823e3d90fd5b8251895297850197918501916001016109d756fea164736f6c6343000811000a0000000000000000000000004d878e8fb90178588cda4cf1dccdc9a6d275708900000000000000000000000022f1fc71a505c0b2bf4d5075801cc5e0ec84b09e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000b7ad413f9196bcaec69440b3c18ab3c0da644e1c
Deployed Bytecode
0x608060408181526004918236101561001657600080fd5b600092833560e01c918263025d42c5146103dd575081630bd3dd4d1461035557816327e471551461029a578163807f0ac51461022b578163a49f6aa11461018857508063aa5d554e1461014b578063c43e5f7d14610108578063cfc41cb8146100c55763f8ad7cc71461008857600080fd5b346100c157816003193601126100c157602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b5080fd5b50346100c157816003193601126100c157602090516001600160a01b037f000000000000000000000000b7ad413f9196bcaec69440b3c18ab3c0da644e1c168152f35b50346100c157816003193601126100c157602090516001600160a01b037f0000000000000000000000004d878e8fb90178588cda4cf1dccdc9a6d2757089168152f35b50346100c157816003193601126100c1576020905160ff7f0000000000000000000000000000000000000000000000000000000000000006168152f35b9136600319011290506100c15767ffffffffffffffff908035828111610227576101b59036908301610470565b90602435928311610227576101d36101da916102249436910161056e565b36916104ef565b907f0000000000000000000000000000000000000000000000000000000000000006907f000000000000000000000000b7ad413f9196bcaec69440b3c18ab3c0da644e1c906105fa565b80f35b8380fd5b90503461029657816003193601126102965780359067ffffffffffffffff82116102275761025b9136910161056e565b926024359084821161029357509261027c918461028f9536930391016104ef565b9051918291602083526020830190610549565b0390f35b80fd5b8280fd5b9050823461029357826003193601126102935767ffffffffffffffff918035838111610296576102cd9036908301610470565b90602435938411610296573660238501121561029657830135916102f083610458565b926102fd86519485610420565b80845260209460248686019260051b8201019236841161029357506024869101915b83831061034557878261028f6103358989610995565b9251928284938452830190610549565b823581529181019186910161031f565b839060803660031901126100c15767ffffffffffffffff8135818111610227576103829036908401610470565b906024356001600160a01b03811681036103d9576044359160ff831683036103d5576064359081116103d557366023820112156103d557610224948160246103cf933693013591016104ef565b926105fa565b8580fd5b8480fd5b8490346100c157816003193601126100c1576020906001600160a01b037f00000000000000000000000022f1fc71a505c0b2bf4d5075801cc5e0ec84b09e168152f35b90601f8019910116810190811067ffffffffffffffff82111761044257604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116104425760051b60200190565b81601f820112156104ce5780359161048783610458565b926104956040519485610420565b808452602092838086019260051b8201019283116104ce578301905b8282106104bf575050505090565b813581529083019083016104b1565b600080fd5b67ffffffffffffffff811161044257601f01601f191660200190565b9291926104fb826104d3565b916105096040519384610420565b8294818452818301116104ce578281602093846000960137010152565b60005b8381106105395750506000910152565b8181015183820152602001610529565b9060209161056281518092818552858086019101610526565b601f01601f1916010190565b9181601f840112156104ce5782359167ffffffffffffffff83116104ce57602083818601950101116104ce57565b90815180825260208080930193019160005b8281106105bc575050505090565b8351855293810193928101926001016105ae565b80518210156105e45760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b93929360409081519163ceee6e5560e01b8352602060049481868601526000966024998661062a8c82018861059c565b039289886001600160a01b03958183887f00000000000000000000000022f1fc71a505c0b2bf4d5075801cc5e0ec84b09e165af1978815610946579289928d95928c95869b610879575b5060ff929161075f6107719261071160708f8f8f918f916107019161069891610995565b8351620e7ef081850152600160f21b9481019490945263aa4af24560e01b6042850152600560fa1b60468501819052606097881b6bffffffffffffffffffffffff19166047860152605b8501523090961b605c8401528551929586939283918686019101610526565b8101036050810184520182610420565b8b51998a9889978897630e788b9360e31b895216908701527f000000000000000000000000000000000000000000000000000000000000000090860152608060448601526084850190610549565b83810360031901606485015290610549565b039134907f0000000000000000000000004d878e8fb90178588cda4cf1dccdc9a6d2757089165af1801561086f5761081a575b505050835b8151811015610811576107bc81836105d0565b516107c782856105d0565b5190307f91d88cce380da58b1f18fc437a4a6342ddea08c9a496e31ae03e16c08fc4fce18880a460001981146107ff576001016107a9565b634e487b7160e01b8552601184528685fd5b50505050509050565b3d8088833e6108298183610420565b810192818403126108675780519167ffffffffffffffff928381160361086b578101519182116108675761085e929101610950565b503880806107a4565b8680fd5b8780fd5b83513d89823e3d90fd5b9396509950925092503d808b833e6108918183610420565b810190858183031261093e5780519067ffffffffffffffff821161094257019080601f8301121561093e5781516108c781610458565b926108d489519485610420565b818452878085019260051b82010192831161093a578b948f97948b908f9894958c968c809601905b828210610911575050509c9250509192610674565b9350959950955095985082919650835181520191018b948f97948b908f9894958b948d976108fc565b8c80fd5b8a80fd5b8b80fd5b86513d8c823e3d90fd5b81601f820112156104ce578051610966816104d3565b926109746040519485610420565b818452602082840101116104ce576109929160208085019101610526565b90565b919091604051906000916109bb602092848484015260606040840152608083019061059c565b601f199081838203016060840152838088519283815201970190855b818110610a8a57505050906109f9849282610a1b979803908101835282610420565b6040518095819263807f0ac560e01b8352604060048401526044830190610549565b8460248301520381305afa928315610a7f578293610a3a575b50505090565b90919392503d8085833e610a4e8183610420565b810191818303126102275780519067ffffffffffffffff82116103d957610a7793945001610950565b388080610a34565b6040513d84823e3d90fd5b8251895297850197918501916001016109d756fea164736f6c6343000811000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004d878e8fb90178588cda4cf1dccdc9a6d275708900000000000000000000000022f1fc71a505c0b2bf4d5075801cc5e0ec84b09e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000b7ad413f9196bcaec69440b3c18ab3c0da644e1c
-----Decoded View---------------
Arg [0] : bridge (address): 0x4D878E8Fb90178588Cda4cf1DCcdC9a6d2757089
Arg [1] : headerStorage (address): 0x22F1fc71A505c0b2bf4D5075801cc5E0ec84B09e
Arg [2] : resourceID (bytes32): 0x0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : defaultDestinationDomainID (uint8): 6
Arg [4] : defaultSygmaAdapter (address): 0xb7aD413f9196bcAEc69440B3C18ab3c0da644e1c
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000004d878e8fb90178588cda4cf1dccdc9a6d2757089
Arg [1] : 00000000000000000000000022f1fc71a505c0b2bf4d5075801cc5e0ec84b09e
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [4] : 000000000000000000000000b7ad413f9196bcaec69440b3c18ab3c0da644e1c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.