Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy/114_deploy_across_event_emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer,
log: true,
skipIfAlreadyDeployed: true,
deterministicDeployment: "0x1234", // Salt for create2
});
await hre.run("verify:verify", { address: instance.address });
};
Expand Down
34 changes: 34 additions & 0 deletions deploy/115_deploy_across_event_emitter_zk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import * as zk from "zksync-web3";
import { Deployer as zkDeployer } from "@matterlabs/hardhat-zksync-deploy";
import { DeployFunction, DeploymentSubmission } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const contractName = "AcrossEventEmitter";
const { deployments } = hre;

const mnemonic = hre.network.config.accounts.mnemonic;
const wallet = zk.Wallet.fromMnemonic(mnemonic);
const deployer = new zkDeployer(hre, wallet);

const artifact = await deployer.loadArtifact(contractName);
const constructorArgs = [];

const _deployment = await deployer.deploy(artifact, constructorArgs);
const newAddress = _deployment.address;
console.log(`New ${contractName} implementation deployed @ ${newAddress}`);

// Save the deployment manually because OZ's hardhat-upgrades packages bypasses hardhat-deploy.
// See also: https://stackoverflow.com/questions/74870472
const extendedArtifact = await deployments.getExtendedArtifact(contractName);
const deployment: DeploymentSubmission = {
address: newAddress,
...extendedArtifact,
};
await deployments.save(contractName, deployment);

await hre.run("verify:verify", { address: newAddress, constructorArguments: constructorArgs });
};

module.exports = func;
func.tags = ["AcrossEventEmitterZk"];
91 changes: 91 additions & 0 deletions deployments/arbitrum/AcrossEventEmitter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"address": "0xBF75133b48b0a42AB9374027902E83C5E2949034",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "MetadataEmitted",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "emitData",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x220c99382773ca52e1de8953954ea6145d8bcf59453dafe692ea08554cfc55ad",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0x9A8f92a830A5cB89a3816e3D267CB7791c16b04D",
"contractAddress": null,
"transactionIndex": 5,
"gasUsed": "120320",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xb06419b24d8385a4cb36c5db048432a53840822986782dea4738c8801fd4f41c",
"transactionHash": "0x220c99382773ca52e1de8953954ea6145d8bcf59453dafe692ea08554cfc55ad",
"logs": [],
"blockNumber": 392949295,
"cumulativeGasUsed": "547279",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 1,
"solcInputHash": "0fc8eeef855f04b97b7baffcd5c782f7",
"metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"MetadataEmitted\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"emitData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"MetadataEmitted(bytes)\":{\"params\":{\"data\":\"The metadata bytes emitted\"}}},\"kind\":\"dev\",\"methods\":{\"emitData(bytes)\":{\"params\":{\"data\":\"The bytes data to emit\"}}},\"title\":\"AcrossEventEmitter\",\"version\":1},\"userdoc\":{\"events\":{\"MetadataEmitted(bytes)\":{\"notice\":\"Emitted when metadata is stored\"}},\"kind\":\"user\",\"methods\":{\"emitData(bytes)\":{\"notice\":\"Emits metadata as an event\"}},\"notice\":\"A simple contract that emits events with bytes encoded metadata\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/AcrossEventEmitter.sol\":\"AcrossEventEmitter\"},\"debug\":{\"revertStrings\":\"strip\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"contracts/AcrossEventEmitter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title AcrossEventEmitter\\n * @notice A simple contract that emits events with bytes encoded metadata\\n */\\ncontract AcrossEventEmitter {\\n /**\\n * @notice Emitted when metadata is stored\\n * @param data The metadata bytes emitted\\n */\\n event MetadataEmitted(bytes data);\\n\\n /**\\n * @notice Emits metadata as an event\\n * @param data The bytes data to emit\\n */\\n function emitData(bytes calldata data) external {\\n require(data.length > 0, \\\"Data cannot be empty\\\");\\n emit MetadataEmitted(data);\\n }\\n}\\n\",\"keccak256\":\"0xf40ca34b904d800db09e80ace2cc7331dba212373c14b32fb370298946b136b3\",\"license\":\"BUSL-1.1\"}},\"version\":1}",
"bytecode": "0x608080604052346100165761012e908161001b8239f35b5f80fdfe60808060405260043610156011575f80fd5b5f3560e01c63d836083e146023575f80fd5b3460f45760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011260f4576004359067ffffffffffffffff80831160f4573660238401121560f457826004013590811160f457366024828501011160f457801560f457817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8360409460247fc28009f405f9b451f5155492167b1ad5ab376d991bea880cb5049e924e5b823c986020875282602088015201868601375f85828601015201168101030190a1005b5f80fdfea2646970667358221220a2c7a0f09e981d67663b05d824037d0d54404d85e8c1debac93ab835ff1790aa64736f6c63430008170033",
"deployedBytecode": "0x60808060405260043610156011575f80fd5b5f3560e01c63d836083e146023575f80fd5b3460f45760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011260f4576004359067ffffffffffffffff80831160f4573660238401121560f457826004013590811160f457366024828501011160f457801560f457817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8360409460247fc28009f405f9b451f5155492167b1ad5ab376d991bea880cb5049e924e5b823c986020875282602088015201868601375f85828601015201168101030190a1005b5f80fdfea2646970667358221220a2c7a0f09e981d67663b05d824037d0d54404d85e8c1debac93ab835ff1790aa64736f6c63430008170033",
"devdoc": {
"events": {
"MetadataEmitted(bytes)": {
"params": {
"data": "The metadata bytes emitted"
}
}
},
"kind": "dev",
"methods": {
"emitData(bytes)": {
"params": {
"data": "The bytes data to emit"
}
}
},
"title": "AcrossEventEmitter",
"version": 1
},
"userdoc": {
"events": {
"MetadataEmitted(bytes)": {
"notice": "Emitted when metadata is stored"
}
},
"kind": "user",
"methods": {
"emitData(bytes)": {
"notice": "Emits metadata as an event"
}
},
"notice": "A simple contract that emits events with bytes encoded metadata",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"language": "Solidity",
"sources": {
"contracts/AcrossEventEmitter.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\n/**\n * @title AcrossEventEmitter\n * @notice A simple contract that emits events with bytes encoded metadata\n */\ncontract AcrossEventEmitter {\n /**\n * @notice Emitted when metadata is stored\n * @param data The metadata bytes emitted\n */\n event MetadataEmitted(bytes data);\n\n /**\n * @notice Emits metadata as an event\n * @param data The bytes data to emit\n */\n function emitData(bytes calldata data) external {\n require(data.length > 0, \"Data cannot be empty\");\n emit MetadataEmitted(data);\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 1000000
},
"viaIR": true,
"debug": {
"revertStrings": "strip"
},
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.gasEstimates"
],
"": ["ast"]
}
},
"metadata": {
"useLiteralContent": true
}
}
}
91 changes: 91 additions & 0 deletions deployments/base/AcrossEventEmitter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"address": "0xBF75133b48b0a42AB9374027902E83C5E2949034",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "MetadataEmitted",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "emitData",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x3657a7769eb0b9b9164a9a73e7186ee8137ba23cdb97d3b03cacd22ad93511d3",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0x9A8f92a830A5cB89a3816e3D267CB7791c16b04D",
"contractAddress": null,
"transactionIndex": 81,
"gasUsed": "119108",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x064d901c36cfee52f1d5a8bb9c830a6a05ff7285b0523aaf007bf54c2ae60f2f",
"transactionHash": "0x3657a7769eb0b9b9164a9a73e7186ee8137ba23cdb97d3b03cacd22ad93511d3",
"logs": [],
"blockNumber": 37265997,
"cumulativeGasUsed": "20394823",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 1,
"solcInputHash": "0fc8eeef855f04b97b7baffcd5c782f7",
"metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"MetadataEmitted\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"emitData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"MetadataEmitted(bytes)\":{\"params\":{\"data\":\"The metadata bytes emitted\"}}},\"kind\":\"dev\",\"methods\":{\"emitData(bytes)\":{\"params\":{\"data\":\"The bytes data to emit\"}}},\"title\":\"AcrossEventEmitter\",\"version\":1},\"userdoc\":{\"events\":{\"MetadataEmitted(bytes)\":{\"notice\":\"Emitted when metadata is stored\"}},\"kind\":\"user\",\"methods\":{\"emitData(bytes)\":{\"notice\":\"Emits metadata as an event\"}},\"notice\":\"A simple contract that emits events with bytes encoded metadata\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/AcrossEventEmitter.sol\":\"AcrossEventEmitter\"},\"debug\":{\"revertStrings\":\"strip\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"contracts/AcrossEventEmitter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title AcrossEventEmitter\\n * @notice A simple contract that emits events with bytes encoded metadata\\n */\\ncontract AcrossEventEmitter {\\n /**\\n * @notice Emitted when metadata is stored\\n * @param data The metadata bytes emitted\\n */\\n event MetadataEmitted(bytes data);\\n\\n /**\\n * @notice Emits metadata as an event\\n * @param data The bytes data to emit\\n */\\n function emitData(bytes calldata data) external {\\n require(data.length > 0, \\\"Data cannot be empty\\\");\\n emit MetadataEmitted(data);\\n }\\n}\\n\",\"keccak256\":\"0xf40ca34b904d800db09e80ace2cc7331dba212373c14b32fb370298946b136b3\",\"license\":\"BUSL-1.1\"}},\"version\":1}",
"bytecode": "0x608080604052346100165761012e908161001b8239f35b5f80fdfe60808060405260043610156011575f80fd5b5f3560e01c63d836083e146023575f80fd5b3460f45760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011260f4576004359067ffffffffffffffff80831160f4573660238401121560f457826004013590811160f457366024828501011160f457801560f457817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8360409460247fc28009f405f9b451f5155492167b1ad5ab376d991bea880cb5049e924e5b823c986020875282602088015201868601375f85828601015201168101030190a1005b5f80fdfea2646970667358221220a2c7a0f09e981d67663b05d824037d0d54404d85e8c1debac93ab835ff1790aa64736f6c63430008170033",
"deployedBytecode": "0x60808060405260043610156011575f80fd5b5f3560e01c63d836083e146023575f80fd5b3460f45760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011260f4576004359067ffffffffffffffff80831160f4573660238401121560f457826004013590811160f457366024828501011160f457801560f457817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8360409460247fc28009f405f9b451f5155492167b1ad5ab376d991bea880cb5049e924e5b823c986020875282602088015201868601375f85828601015201168101030190a1005b5f80fdfea2646970667358221220a2c7a0f09e981d67663b05d824037d0d54404d85e8c1debac93ab835ff1790aa64736f6c63430008170033",
"devdoc": {
"events": {
"MetadataEmitted(bytes)": {
"params": {
"data": "The metadata bytes emitted"
}
}
},
"kind": "dev",
"methods": {
"emitData(bytes)": {
"params": {
"data": "The bytes data to emit"
}
}
},
"title": "AcrossEventEmitter",
"version": 1
},
"userdoc": {
"events": {
"MetadataEmitted(bytes)": {
"notice": "Emitted when metadata is stored"
}
},
"kind": "user",
"methods": {
"emitData(bytes)": {
"notice": "Emits metadata as an event"
}
},
"notice": "A simple contract that emits events with bytes encoded metadata",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"language": "Solidity",
"sources": {
"contracts/AcrossEventEmitter.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\n/**\n * @title AcrossEventEmitter\n * @notice A simple contract that emits events with bytes encoded metadata\n */\ncontract AcrossEventEmitter {\n /**\n * @notice Emitted when metadata is stored\n * @param data The metadata bytes emitted\n */\n event MetadataEmitted(bytes data);\n\n /**\n * @notice Emits metadata as an event\n * @param data The bytes data to emit\n */\n function emitData(bytes calldata data) external {\n require(data.length > 0, \"Data cannot be empty\");\n emit MetadataEmitted(data);\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 1000000
},
"viaIR": true,
"debug": {
"revertStrings": "strip"
},
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.gasEstimates"
],
"": ["ast"]
}
},
"metadata": {
"useLiteralContent": true
}
}
}
Loading
Loading