-
-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: skip test * wip: checkpoint * wip: checkpoint * wip: checkpoint * wip: checkpoint * wip: checkpoint * docs * chore: changeset * chore: changeset * w * w
- Loading branch information
Showing
27 changed files
with
1,568 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"viem": patch | ||
--- | ||
|
||
**Experimental:** Added experimental ERC-7821 actions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
pragma solidity ^0.8.17; | ||
|
||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
import "solady/accounts/ERC7821.sol"; | ||
|
||
contract ERC7821Example is ERC7821 { | ||
event OpData(bytes opData); | ||
|
||
function _execute( | ||
bytes32 mode, | ||
bytes calldata executionData, | ||
Call[] calldata calls, | ||
bytes calldata opData | ||
) internal virtual override { | ||
mode = mode; | ||
executionData = executionData; | ||
|
||
require(msg.sender == address(this)); | ||
if (opData.length > 0) { | ||
emit OpData(opData); | ||
} | ||
return _execute(calls, bytes32(0)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Extending Client with ERC-7821 Actions [Setting up your Viem Client] | ||
|
||
To use the experimental functionality of [ERC-7821](https://eips.ethereum.org/EIPS/eip-7821), you can extend your existing (or new) Viem Client with experimental [ERC-7821](https://eips.ethereum.org/EIPS/eip-7821) Actions. | ||
|
||
```ts | ||
import { createClient, http } from 'viem' | ||
import { mainnet } from 'viem/chains' | ||
import { erc7821Actions } from 'viem/experimental' // [!code focus] | ||
const client = createClient({ | ||
chain: mainnet, | ||
transport: http(), | ||
}).extend(erc7821Actions()) // [!code focus] | ||
|
||
const hash = await client.execute({/* ... */}) | ||
``` |
Oops, something went wrong.