Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
9115aab
addfirst draft notes
snissn Aug 29, 2025
dc8137e
docs(eip7702): normalize headings and consolidate Section 7; convert …
snissn Aug 29, 2025
d278b37
ethtypes: add EIP-7702 (type 0x04) front-half support: parser/encoder…
snissn Aug 29, 2025
11c7905
ethtypes: add EIP-7702 RLP round-trip test and bump RLP maxListElemen…
snissn Aug 29, 2025
4556572
docs(AGENTS): record rlp limit bump and add 7702 negative tests + gua…
snissn Aug 29, 2025
42fe6b2
scaffold: add delegator actor folder with types and README; update AG…
snissn Aug 29, 2025
fdf8cb7
feat(ethtypes): add 7702 CBOR param encoder and feature-flag path for…
snissn Aug 29, 2025
19b6cd4
test(ethtypes): add CBOR params shape test; fix numeric type comparis…
snissn Aug 29, 2025
cfdf647
scaffold: add Delegator state type; add 7702 gas/receipt scaffolding;…
snissn Aug 29, 2025
09c1766
test(ethtypes): add build-tagged feature-flag test for 7702 ToUnsigne…
snissn Aug 29, 2025
e81c3a5
eth(gas): add minimal 7702 overhead accounting in EthEstimateGas when…
snissn Aug 29, 2025
346199c
docs(AGENTS): document eth_estimateGas 7702 overhead and receipt adju…
snissn Aug 29, 2025
edba045
ethtypes: validate inner authorization y_parity (0/1) and add test; u…
snissn Aug 29, 2025
d238c08
delegator: add CBOR decode and static validation (y_parity, low-s, ch…
snissn Aug 29, 2025
2edb70a
ethtypes/receipt: echo authorizationList in EthTxReceipt; test: ensur…
snissn Aug 29, 2025
9a50943
delegator: add ApplyDelegationsFromCBOR decode+validate helper with t…
snissn Aug 29, 2025
628399b
docs: add AGENTS.md notebook for EIP-7702 implementation guidance
snissn Aug 29, 2025
0f051e1
docs: point delegator README to root AGENTS.md for details
snissn Aug 29, 2025
bc467c5
delegator: add state.ApplyDelegationsWithAuthorities with nonce check…
snissn Aug 29, 2025
0001fec
docs(agents): note ApplyDelegationsWithAuthorities helper and tests c…
snissn Aug 29, 2025
d667f21
docs(eip7702): add Progress Status section matching current implement…
snissn Aug 29, 2025
60fd330
delegator/tests: cross-check decode against ethtypes CBOR encoder; ad…
snissn Aug 29, 2025
f431593
docs(agents): note cross-package CBOR compat test and state helper tests
snissn Aug 29, 2025
14e76b3
docs(agents): convert notebook into actionable Phase-2 checklist, add…
snissn Aug 29, 2025
ce1b15d
delegator: implement ApplyDelegationsCore helper using scaffold state…
snissn Aug 29, 2025
fc03872
eth(gas): implement intrinsic overhead calc and add CBOR auth-count t…
snissn Aug 29, 2025
a94f856
eth(send): enforce simple per-EOA cap for pending 7702 delegation mes…
snissn Aug 29, 2025
aa78e2b
ethtypes(7702): use delegator.MethodApplyDelegations constant in send…
snissn Aug 29, 2025
d92f8c7
tests(7702): assert send-path uses delegator.MethodApplyDelegations w…
snissn Aug 29, 2025
d899ca5
docs(agents): mark send-path flip, gas overhead, and mempool policy a…
snissn Aug 29, 2025
a92547d
policy(7702): add env-configurable per-EOA delegation cap; stub HAMT-…
snissn Aug 29, 2025
bb00d24
docs(agents): record HAMT scaffold, EVM hook placeholder, and env-bas…
snissn Aug 29, 2025
52c636d
tests(7702): break import cycles by moving cross-package CBOR compat …
snissn Aug 29, 2025
528762c
ethtypes(7702): support LOTUS_ETH_7702_DELEGATOR_ADDR env to configur…
snissn Aug 29, 2025
cfc896c
docs(agents): note env-based Delegator actor address configuration
snissn Aug 29, 2025
9308626
mpool(7702): cross-account invalidation for ApplyDelegations; evict p…
snissn Aug 29, 2025
13bc5a3
tests(mpool/7702): add missing import; prepare for future FFI-enabled…
snissn Aug 29, 2025
4ad95a2
tests(mpool/7702): add multi-authority eviction test for cross-accoun…
snissn Aug 29, 2025
a9191c4
config(7702): add Fevm.Eip7702DelegationCap TOML knob; wire into EthS…
snissn Aug 29, 2025
f7e2c09
chore(changelog): document EIP-7702 Lotus-side changes (mpool invalid…
snissn Aug 29, 2025
c805aa9
docs(config/7702): document Fevm.Eip7702DelegationCap and related env…
snissn Aug 29, 2025
774fe7b
policy(7702): gate policies by network version (>= v27); move delegat…
snissn Aug 29, 2025
2aeca82
tests(mpool/7702): ensure policies are disabled before activation (nv…
snissn Aug 29, 2025
d9fdbb0
observability(mpool/7702): journal + log events on eviction and cap r…
snissn Aug 29, 2025
42cf2e3
docs(7702): add Lotus vs FVM summary; reflect nv-gated policies and r…
snissn Aug 29, 2025
4150831
update
snissn Oct 15, 2025
6d0b635
eth: EIP-7702 Phase-2 wiring (Lotus):\n- Align CBOR to actor wrapper …
snissn Oct 22, 2025
c3fd810
add eip 7702 implementation description to changelog
snissn Oct 24, 2025
55cf5ba
eth/7702 tests: drop numeric gas assertions; add monotonic/behavior c…
snissn Oct 24, 2025
6350720
docs(EIP7702): fix ASCII architecture diagram spacing; add commit gui…
snissn Oct 24, 2025
b35859e
docs(agents): recommend pairing frequent semantic commits with regula…
snissn Oct 24, 2025
3ee4d9d
tests(eth/7702): add legacy CBOR + malformed estimation tests; defer …
snissn Oct 24, 2025
3c122f7
tests(eth/7702): enable multi-receipt block test with minimal state t…
snissn Oct 24, 2025
e54b20e
itests(eth/7702): add scaffold for delegated execution E2E; skip unti…
snissn Oct 24, 2025
0817557
tests(eth/7702): add mixed-block receipts test; ensure delegation adj…
snissn Oct 24, 2025
6001f3a
tests(eth/7702): add mixed-block synthetic-event test (skipped); rese…
snissn Oct 24, 2025
9cef898
tests(eth/7702): add EthGetTransactionReceipt non-7702 negative test …
snissn Oct 24, 2025
6bf5868
mpool(7702): remove cross-account invalidation and per-sender cap; sc…
snissn Oct 24, 2025
61d1251
docs(AGENTS): add Audit Remediation Plan and emphasize push-after-ato…
snissn Oct 24, 2025
b60956a
delegator/cbor: canonicalize to wrapper-only [ [ tuple, ... ] ]; upda…
snissn Oct 24, 2025
e3828f3
ethtypes(7702): add atomic ApplyAndCall params encoder + ToUnsignedFi…
snissn Oct 24, 2025
33aac50
eth/7702: route ToSignedFilecoinMessage to atomic apply+call; decode …
snissn Oct 24, 2025
2c9976b
tests(eth): align 7702 receipts/gas tests to ApplyAndCall and atomic …
snissn Oct 24, 2025
32f76dc
7702: remove non-atomic ApplyDelegations path entirely; route and dec…
snissn Oct 24, 2025
ae11079
docs(AGENTS): sync with atomic ApplyAndCall, canonical CBOR, RLP per-…
snissn Oct 24, 2025
7558dcf
docs: remove historical Delegator mentions; update to EVM-only design…
snissn Oct 24, 2025
2091ae6
EIP-7702: EVM-only routing + atomic ApplyAndCall; remove Delegator pa…
snissn Oct 25, 2025
5edec61
accidentally commited big revm diff
snissn Oct 25, 2025
b7a3889
EIP-7702: finalize TODOs; strict CBOR/RLP decoding and tests; receipt…
snissn Oct 26, 2025
c0246ee
accidentally commited big geth diff
snissn Oct 26, 2025
7ba2d40
delete eip 7702 spec
snissn Oct 26, 2025
b094df7
EIP-7702 (Lotus): receipt.status decode + fallback; 7702 tests; docs …
snissn Oct 27, 2025
a92f07a
run go fmt
snissn Oct 27, 2025
6d3dffb
make gen
snissn Oct 27, 2025
f23c592
lint: fix revive comments, unconvert cast, remove unused code, and st…
snissn Oct 27, 2025
05a3e82
go fmt
snissn Oct 27, 2025
a5be720
snissn Oct 27, 2025
dde037f
itests: fix unused variable in 7702 delegated execute scaffold (unbre…
snissn Oct 27, 2025
6b057b5
go fmt
snissn Oct 27, 2025
f40665c
docs(AGENTS): add pre-commit formatting and checks guidance (go fmt, …
snissn Oct 27, 2025
ce017b5
docs(AGENTS): include builtin-actors 'make check' in pre-commit check…
snissn Oct 27, 2025
bf19408
docs(AGENTS): remove nonexistent 'make check' note for lotus
snissn Oct 27, 2025
9e4b50b
Docs: clarify Lotus gas model on FVM and keep 7702 gas tests behavior…
snissn Oct 27, 2025
f85b7ff
Docs: add detailed remediation TODOs for 7702 review findings
snissn Oct 27, 2025
9cb2391
EIP-7702: robust uint64 decode for auth tuple; switch AuthorizationKe…
snissn Oct 28, 2025
b075709
Tests: add RLP fuzz harness for 0x04 parser (opt-in) in Lotus
snissn Oct 28, 2025
9adb2ef
Tests: add AuthorizationKeccak address edge vectors; keep gas tests b…
snissn Oct 28, 2025
1978910
update
snissn Oct 28, 2025
daeb8b4
itests: avoid immutable deadline race in manual onboarding by not req…
snissn Oct 28, 2025
ca7a163
add
snissn Oct 28, 2025
896e49c
docs: update AGENTS.md to mark pointer semantics and delegated revert…
snissn Oct 28, 2025
dd221d0
fix linter
snissn Oct 29, 2025
dc46078
update
snissn Oct 29, 2025
d6b2946
AGENTS: mark builtin-actors pre-existence policy, R/S padding interop…
snissn Oct 29, 2025
bac24d8
update planning docs
snissn Nov 7, 2025
54c4814
Docs: update 7702 EthAccount + ref-fvm migration notes for VM interce…
snissn Nov 8, 2025
a4fc989
Agents: update progress to reflect VM intercept, interpreter minimali…
snissn Nov 8, 2025
61b3fb0
Docs: note added ref-fvm EthAccount roundtrip test and intercept test…
snissn Nov 8, 2025
eb29fda
ethtypes: add EthAccountApplyAndCallActorAddr stub for non-tag builds
snissn Nov 8, 2025
fac2c7a
7702: align tests and receipt adjuster stubs with current intercept +…
snissn Nov 8, 2025
9070d68
eip7702: sync docs and AGENTS with ref-fvm intercept state; receipts …
snissn Nov 10, 2025
7e8123b
docs: add Docker bundle/test flow and EXTCODECOPY windowing examples;…
snissn Nov 10, 2025
50c709d
docs: finalize eip7702 migration semantics; add Docker bundle/test fl…
snissn Nov 10, 2025
d87dc30
chore: remove stray tmp.patch
snissn Nov 10, 2025
e4fe786
docs: clarify ref-fvm Docker test fallback and mounts in AGENTS
snissn Nov 10, 2025
4f17235
Merge branch 'master' into eip7702
snissn Nov 12, 2025
0aa0ca7
eth: export ParseEthRevert and update tests to avoid vet undefined sy…
snissn Nov 12, 2025
01aec48
Merge origin/eip7702 into eip7702; resolve node/impl/eth/utils.go con…
snissn Nov 12, 2025
9e7eb00
docs(AGENTS): add ref-fvm coverage improvement plan and handoff notes
snissn Nov 12, 2025
2cb872a
docs(AGENTS): mark SDK helper tests + CI coverage tweak complete
snissn Nov 12, 2025
7fe69a6
docs(AGENTS): note revert to no-default-features for fvm coverage to …
snissn Nov 12, 2025
eb39f57
docs(AGENTS): log new send-path + helper tests to raise patch coverage
snissn Nov 12, 2025
f0cc13d
docs(agents): sync with EthAccount + ref-fvm intercept migration; rem…
snissn Nov 12, 2025
519430c
feat(eip7702): finalize EthAccount and Lotus integration
snissn Nov 14, 2025
c5a35fb
chore: bump filecoin-ffi submodule
snissn Nov 14, 2025
d79ed92
chore(eip7702): add Codex prompts for follow-ups
snissn Nov 14, 2025
edbb400
itests: add 0x04 ApplyAndCall outer-call e2e
snissn Nov 20, 2025
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
631 changes: 631 additions & 0 deletions AGENTS.md

Large diffs are not rendered by default.

472 changes: 464 additions & 8 deletions build/openrpc/full.json

Large diffs are not rendered by default.

287 changes: 282 additions & 5 deletions build/openrpc/gateway.json

Large diffs are not rendered by default.

472 changes: 464 additions & 8 deletions build/openrpc/v2/full.json

Large diffs are not rendered by default.

472 changes: 464 additions & 8 deletions build/openrpc/v2/gateway.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions chain/actors/builtin/delegator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Delegator Actor (Deprecated on this branch)

This scaffold is deprecated on the EIP‑7702 development branch. EthAccount state plus the
ref‑fvm VM intercept now implement 7702 end‑to‑end (state, validation, ApplyAndCall bridge,
pointer semantics), and no Delegator actor is used in send/execute paths. See AGENTS.md and
`documentation/eip7702_ethaccount_ref-fvm_migration.md` for the current design.
5 changes: 4 additions & 1 deletion chain/messagepool/messagepool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ type testMpoolAPI struct {
published int

baseFee types.BigInt

nv network.Version
}

func newTestMpoolAPI() *testMpoolAPI {
Expand All @@ -54,6 +56,7 @@ func newTestMpoolAPI() *testMpoolAPI {
statenonce: make(map[address.Address]uint64),
balance: make(map[address.Address]types.BigInt),
baseFee: types.NewInt(100),
nv: buildconstants.TestNetworkVersion,
}
genesis := mock.MkBlock(nil, 1, 1)
tma.tipsets = append(tma.tipsets, mock.TipSet(genesis))
Expand Down Expand Up @@ -186,7 +189,7 @@ func (tma *testMpoolAPI) StateDeterministicAddressAtFinality(ctx context.Context
}

func (tma *testMpoolAPI) StateNetworkVersion(ctx context.Context, h abi.ChainEpoch) network.Version {
return buildconstants.TestNetworkVersion
return tma.nv
}

func (tma *testMpoolAPI) MessagesForBlock(ctx context.Context, h *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) {
Expand Down
136 changes: 136 additions & 0 deletions chain/types/ethtypes/eth_7702_atomic_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
package ethtypes

import (
"bytes"
"testing"

"github.com/stretchr/testify/require"
cbg "github.com/whyrusleeping/cbor-gen"

"github.com/filecoin-project/go-address"
abi2 "github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"

"github.com/filecoin-project/lotus/build/buildconstants"
)

func TestEIP7702_ToUnsignedFilecoinMessageAtomic_ShapesAndMethod(t *testing.T) {
// Enable feature flag and set EthAccount.ApplyAndCall addr
Eip7702FeatureEnabled = true
defer func() { Eip7702FeatureEnabled = false }()
EthAccountApplyAndCallActorAddr, _ = address.NewIDAddress(999)

// Assemble a simple tx with one auth and call fields
var to EthAddress
for i := range to {
to[i] = 0xAA
}
var authAddr EthAddress
for i := range authAddr {
authAddr[i] = 0xBB
}
tx := &Eth7702TxArgs{
ChainID: buildconstants.Eip155ChainId,
Nonce: 1,
To: &to,
Value: big.NewInt(12345),
Input: []byte{0xde, 0xad, 0xbe, 0xef},
MaxFeePerGas: big.NewInt(1),
MaxPriorityFeePerGas: big.NewInt(1),
GasLimit: 50000,
AuthorizationList: []EthAuthorization{{
ChainID: EthUint64(buildconstants.Eip155ChainId),
Address: authAddr,
Nonce: 7,
YParity: 0,
R: EthBigInt(big.NewInt(1)),
S: EthBigInt(big.NewInt(2)),
}},
}
from, _ := address.NewIDAddress(1001)
msg, err := tx.ToUnsignedFilecoinMessageAtomic(from)
require.NoError(t, err)
require.EqualValues(t, abi2.MethodNum(MethodHash("ApplyAndCall")), msg.Method)

// Decode params shape: [ [tuple...], [to(20b), value(bytes), input(bytes)] ]
r := cbg.NewCborReader(bytes.NewReader(msg.Params))
maj, l, err := r.ReadHeader()
require.NoError(t, err)
require.EqualValues(t, cbg.MajArray, maj)
require.EqualValues(t, 2, l)

// Inner list length
maj, innerLen, err := r.ReadHeader()
require.NoError(t, err)
require.EqualValues(t, cbg.MajArray, maj)
require.EqualValues(t, 1, innerLen)
// Consume inner tuples generically
for i := 0; i < int(innerLen); i++ {
// tuple header
_, tlen, err := r.ReadHeader()
require.NoError(t, err)
require.EqualValues(t, 6, tlen)
// chain_id
_, _, err = r.ReadHeader()
require.NoError(t, err)
// address
_, blen, err := r.ReadHeader()
require.NoError(t, err)
require.EqualValues(t, uint64(20), blen)
// consume address bytes
if blen > 0 {
tmp1 := make([]byte, blen)
_, err = r.Read(tmp1)
require.NoError(t, err)
}
// nonce
_, _, err = r.ReadHeader()
require.NoError(t, err)
// y_parity
_, _, err = r.ReadHeader()
require.NoError(t, err)
// r
_, blen, err = r.ReadHeader()
require.NoError(t, err)
require.GreaterOrEqual(t, blen, uint64(1))
tmp2 := make([]byte, blen)
_, err = r.Read(tmp2)
require.NoError(t, err)
// s
_, blen, err = r.ReadHeader()
require.NoError(t, err)
require.GreaterOrEqual(t, blen, uint64(1))
tmp3 := make([]byte, blen)
_, err = r.Read(tmp3)
require.NoError(t, err)
}

// Call tuple
maj, clen, err := r.ReadHeader()
require.NoError(t, err)
require.EqualValues(t, cbg.MajArray, maj)
require.EqualValues(t, uint64(3), clen)
// to
maj, blen, err := r.ReadHeader()
require.NoError(t, err)
require.EqualValues(t, cbg.MajByteString, maj)
require.EqualValues(t, uint64(20), blen)
if blen > 0 {
tmp4 := make([]byte, blen)
_, err = r.Read(tmp4)
require.NoError(t, err)
}
// value
maj, blen, err = r.ReadHeader()
require.NoError(t, err)
require.EqualValues(t, cbg.MajByteString, maj)
require.GreaterOrEqual(t, blen, uint64(1))
tmp5 := make([]byte, blen)
_, err = r.Read(tmp5)
require.NoError(t, err)
// input
maj, blen, err = r.ReadHeader()
require.NoError(t, err)
require.EqualValues(t, cbg.MajByteString, maj)
require.EqualValues(t, uint64(4), blen)
}
75 changes: 75 additions & 0 deletions chain/types/ethtypes/eth_7702_authhash_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package ethtypes

import (
"testing"

"github.com/stretchr/testify/require"
)

func TestEthAuthorization_DomainHash_UsesTupleFields(t *testing.T) {
var addr EthAddress
for i := range addr {
addr[i] = 0x33
}
auth := EthAuthorization{ChainID: EthUint64(123), Address: addr, Nonce: EthUint64(9)}
h1, err := auth.DomainHash()
require.NoError(t, err)

// Mutate nonce -> hash must change
auth2 := auth
auth2.Nonce = EthUint64(10)
h2, err := auth2.DomainHash()
require.NoError(t, err)
require.NotEqual(t, h1, h2)

// Same tuple computed via raw helper
h3, err := AuthorizationKeccak(uint64(auth.ChainID), auth.Address, uint64(auth.Nonce))
require.NoError(t, err)
require.Equal(t, h1, h3)
}

func TestAuthorizationKeccak_BoundaryValues(t *testing.T) {
var addr EthAddress
for i := range addr {
addr[i] = 0xAB
}
// chainId=0, nonce=0
h0, err := AuthorizationKeccak(0, addr, 0)
require.NoError(t, err)
// chainId=max, nonce=max
hmax, err := AuthorizationKeccak(^uint64(0), addr, ^uint64(0))
require.NoError(t, err)
// Distinct hashes expected
require.NotEqual(t, h0, hmax)
}

func TestAuthorizationKeccak_AddressEdgeCases(t *testing.T) {
// All-zero address
var zero EthAddress
// All-0xff address
var ff EthAddress
for i := range ff {
ff[i] = 0xFF
}
// One-bit toggle
var one EthAddress
one[19] = 0x01

hZero, err := AuthorizationKeccak(1, zero, 2)
require.NoError(t, err)
hFF, err := AuthorizationKeccak(1, ff, 2)
require.NoError(t, err)
hOne, err := AuthorizationKeccak(1, one, 2)
require.NoError(t, err)

// Pairwise distinct
require.NotEqual(t, hZero, hFF)
require.NotEqual(t, hZero, hOne)
require.NotEqual(t, hFF, hOne)

// Cross-check against EthAuthorization.DomainHash for zero address
a := EthAuthorization{ChainID: EthUint64(1), Address: zero, Nonce: EthUint64(2)}
hAuth, err := a.DomainHash()
require.NoError(t, err)
require.Equal(t, hZero, hAuth)
}
9 changes: 9 additions & 0 deletions chain/types/ethtypes/eth_7702_env.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ethtypes

import "github.com/filecoin-project/go-address"

// Stub declarations for builds without the eip7702_enabled tag so references compile.
// EthAccountApplyAndCallActorAddr is the primary 0x04 target on this branch.
// EvmApplyAndCallActorAddr remains as a deprecated alias name for historical compatibility.
var EvmApplyAndCallActorAddr address.Address
var EthAccountApplyAndCallActorAddr address.Address
5 changes: 5 additions & 0 deletions chain/types/ethtypes/eth_7702_featureflag.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ethtypes

// Eip7702FeatureEnabled toggles building Filecoin messages from 7702 txs.
// Default is false; enable via build tag file.
var Eip7702FeatureEnabled = false
7 changes: 7 additions & 0 deletions chain/types/ethtypes/eth_7702_featureflag_enabled.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build eip7702_enabled

package ethtypes

func init() {
Eip7702FeatureEnabled = true
}
50 changes: 50 additions & 0 deletions chain/types/ethtypes/eth_7702_featureflag_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//go:build eip7702_enabled

package ethtypes

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"

"github.com/filecoin-project/lotus/build/buildconstants"
)

// Validates that when the eip7702_enabled build tag is set and the EthAccountApplyAndCallActorAddr
// is configured, ToUnsignedFilecoinMessage constructs a message targeting the EthAccount actor
// with CBOR-encoded params.
func Test7702_ToUnsignedFilecoinMessage_FeatureFlag(t *testing.T) {
// Configure a fake EthAccount.ApplyAndCall actor address
a, err := address.NewIDAddress(1234)
require.NoError(t, err)
EthAccountApplyAndCallActorAddr = a

// Minimal 7702 tx with one authorization
var to EthAddress
copy(to[:], mustHex(t, "0x1111111111111111111111111111111111111111"))
tx := &Eth7702TxArgs{
ChainID: buildconstants.Eip155ChainId,
Nonce: 1,
To: &to,
Value: big.NewInt(0),
MaxFeePerGas: big.NewInt(1),
MaxPriorityFeePerGas: big.NewInt(1),
GasLimit: 21000,
AuthorizationList: []EthAuthorization{
{ChainID: EthUint64(buildconstants.Eip155ChainId), Address: to, Nonce: EthUint64(1), YParity: 0, R: EthBigInt(big.NewInt(1)), S: EthBigInt(big.NewInt(1))},
},
V: big.NewInt(0), R: big.NewInt(1), S: big.NewInt(1),
}

from, err := address.NewIDAddress(999)
require.NoError(t, err)
msg, err := tx.ToUnsignedFilecoinMessageAtomic(from)
require.NoError(t, err)
require.Equal(t, EthAccountApplyAndCallActorAddr, msg.To)
require.EqualValues(t, abi.MethodNum(MethodHash("ApplyAndCall")), msg.Method)
require.NotEmpty(t, msg.Params)
}
Loading
Loading