diff --git a/contracts/AcrossEventEmitter.sol b/contracts/AcrossEventEmitter.sol new file mode 100644 index 000000000..3ec51b680 --- /dev/null +++ b/contracts/AcrossEventEmitter.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +/** + * @title AcrossEventEmitter + * @notice A simple contract that emits events with bytes encoded metadata + */ +contract AcrossEventEmitter { + /** + * @notice Emitted when metadata is stored + * @param data The metadata bytes emitted + */ + event MetadataEmitted(bytes data); + + /** + * @notice Emits metadata as an event + * @param data The bytes data to emit + */ + function emitData(bytes calldata data) external { + require(data.length > 0, "Data cannot be empty"); + emit MetadataEmitted(data); + } +} diff --git a/deploy/114_deploy_across_event_emitter.ts b/deploy/114_deploy_across_event_emitter.ts new file mode 100644 index 000000000..9fe721d2b --- /dev/null +++ b/deploy/114_deploy_across_event_emitter.ts @@ -0,0 +1,15 @@ +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts(); + const instance = await hre.deployments.deploy("AcrossEventEmitter", { + from: deployer, + log: true, + skipIfAlreadyDeployed: true, + }); + await hre.run("verify:verify", { address: instance.address }); +}; + +module.exports = func; +func.tags = ["AcrossEventEmitter"]; diff --git a/lib/forge-std b/lib/forge-std index 8bbcf6e3f..066ff16c5 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 8bbcf6e3f8f62f419e5429a0bd89331c85c37824 +Subproject commit 066ff16c5c03e6f931cd041fd366bc4be1fae82a