Skip to content

Commit

Permalink
Fix RecoverSender
Browse files Browse the repository at this point in the history
  • Loading branch information
bynil committed Mar 22, 2023
1 parent 1a3ee22 commit 825899b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions wallet/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ func NewEIP155Signer(chainID uint64) *EIP1155Signer {

func (e *EIP1155Signer) RecoverSender(tx *ethgo.Transaction) (ethgo.Address, error) {
v := new(big.Int).SetBytes(tx.V).Uint64()
v -= e.chainID * 2
v -= 8
v -= 27
if v > 1 {
v -= 27
if v > 1 {
v -= e.chainID * 2
v -= 8
}
}

sig, err := encodeSignature(tx.R, tx.S, byte(v))
if err != nil {
Expand Down

0 comments on commit 825899b

Please sign in to comment.