-
Notifications
You must be signed in to change notification settings - Fork 0
Add transaction with precompiled test #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,3 +28,7 @@ target/ | |
| chain | ||
| .preimage | ||
| .finalized_l1 | ||
| node_modules | ||
| tx/hardhat.config.js | ||
| !package.json | ||
| !package-lock.json | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||
| // SPDX-License-Identifier: UNLICENSED | ||||||||
| pragma solidity 0.8.28; | ||||||||
|
|
||||||||
| contract App { | ||||||||
| event Recovered(address indexed recovered); | ||||||||
|
|
||||||||
| /** | ||||||||
| * @notice Recover the signer address from the signature | ||||||||
| * @dev Example values for "Hello World" signed by Hardhat default account #0 (0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266): | ||||||||
| * hash: 0x592fa743889fc7f92ac2a37bb1f5ba1daf2a5c84741ca0e0061d243a2e6707ba (ethers.hashMessage("Hello World")) | ||||||||
| * v: 28 | ||||||||
| * r: 0x79401886bc9cd29ba8771488c9f5d140e5318858e7ce63346b9a244498308479 | ||||||||
| * s: 0x2289c09c1221545645ba36e4f32997843076bd314731b7454f73315a0c309869 | ||||||||
yoshidan marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| * @param hash The hash of the signed message (e.g. keccak256("\x19Ethereum Signed Message:\n" + len(msg) + msg)) | ||||||||
| * @param v The recovery id | ||||||||
| * @param r The first 32 bytes of the signature | ||||||||
| * @param s The second 32 bytes of the signature | ||||||||
| */ | ||||||||
| function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) external { | ||||||||
| address recovered = ecrecover(hash, v, r, s); | ||||||||
|
||||||||
| address recovered = ecrecover(hash, v, r, s); | |
| address recovered = ecrecover(hash, v, r, s); | |
| require(recovered != address(0), "Invalid signature"); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| require("@nomicfoundation/hardhat-toolbox"); | ||
| require("@openzeppelin/hardhat-upgrades"); | ||
| require("hardhat-contract-sizer"); | ||
|
|
||
| /** | ||
| * @type import('hardhat/config').HardhatUserConfig | ||
| */ | ||
| module.exports = { | ||
| solidity: { | ||
| compilers: [ | ||
| { | ||
| version: "0.8.28", | ||
| settings: { | ||
| evmVersion: "cancun", | ||
| viaIR: true, | ||
| optimizer: { | ||
| enabled: true, | ||
| runs: 9_999_999 | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| }, | ||
| networks: { | ||
| eth_local: { | ||
| url: 'http://localhost:L2_GETH_PORT', | ||
| accounts: { | ||
| mnemonic: "test test test test test test test test test test test junk", | ||
| path: "m/44'/60'/0'/0" | ||
| }, | ||
| } | ||
| } | ||
| } | ||
|
||
Uh oh!
There was an error while loading. Please reload this page.