@@ -49,7 +49,7 @@ func AddressToDelegation(addr common.Address) []byte {
49
49
// SetCodeTx implements the EIP-7702 transaction type which temporarily installs
50
50
// the code at the signer's address.
51
51
type SetCodeTx struct {
52
- ChainID uint64
52
+ ChainID * uint256. Int
53
53
Nonce uint64
54
54
GasTipCap * uint256.Int // a.k.a. maxPriorityFeePerGas
55
55
GasFeeCap * uint256.Int // a.k.a. maxFeePerGas
@@ -61,16 +61,16 @@ type SetCodeTx struct {
61
61
AuthList []SetCodeAuthorization
62
62
63
63
// Signature values
64
- V * uint256.Int `json:"v" gencodec:"required"`
65
- R * uint256.Int `json:"r" gencodec:"required"`
66
- S * uint256.Int `json:"s" gencodec:"required"`
64
+ V * uint256.Int
65
+ R * uint256.Int
66
+ S * uint256.Int
67
67
}
68
68
69
69
//go:generate go run github.com/fjl/gencodec -type SetCodeAuthorization -field-override authorizationMarshaling -out gen_authorization.go
70
70
71
71
// SetCodeAuthorization is an authorization from an account to deploy code at its address.
72
72
type SetCodeAuthorization struct {
73
- ChainID uint64 `json:"chainId" gencodec:"required"`
73
+ ChainID uint256. Int `json:"chainId" gencodec:"required"`
74
74
Address common.Address `json:"address" gencodec:"required"`
75
75
Nonce uint64 `json:"nonce" gencodec:"required"`
76
76
V uint8 `json:"yParity" gencodec:"required"`
@@ -80,7 +80,7 @@ type SetCodeAuthorization struct {
80
80
81
81
// field type overrides for gencodec
82
82
type authorizationMarshaling struct {
83
- ChainID hexutil.Uint64
83
+ ChainID hexutil.U256
84
84
Nonce hexutil.Uint64
85
85
V hexutil.Uint64
86
86
R hexutil.U256
@@ -180,7 +180,7 @@ func (tx *SetCodeTx) copy() TxData {
180
180
181
181
// accessors for innerTx.
182
182
func (tx * SetCodeTx ) txType () byte { return SetCodeTxType }
183
- func (tx * SetCodeTx ) chainID () * big.Int { return big . NewInt ( int64 ( tx .ChainID ) ) }
183
+ func (tx * SetCodeTx ) chainID () * big.Int { return tx .ChainID . ToBig ( ) }
184
184
func (tx * SetCodeTx ) accessList () AccessList { return tx .AccessList }
185
185
func (tx * SetCodeTx ) data () []byte { return tx .Data }
186
186
func (tx * SetCodeTx ) gas () uint64 { return tx .Gas }
@@ -207,7 +207,7 @@ func (tx *SetCodeTx) rawSignatureValues() (v, r, s *big.Int) {
207
207
}
208
208
209
209
func (tx * SetCodeTx ) setSignatureValues (chainID , v , r , s * big.Int ) {
210
- tx .ChainID = chainID . Uint64 ( )
210
+ tx .ChainID = uint256 . MustFromBig ( chainID )
211
211
tx .V .SetFromBig (v )
212
212
tx .R .SetFromBig (r )
213
213
tx .S .SetFromBig (s )
0 commit comments