Skip to content

Commit

Permalink
feat: split string
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRory committed Mar 19, 2024
1 parent 6921a7b commit 9778517
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion service/operator/try_pay_user_op_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,24 @@ func packUserOp(userOp *model.UserOperation) (string, []byte, error) {
"stateMutability": "nonpayable",
"type": "function"
}
]`))
]`))
if err != nil {
return "", nil, err
}
method := abiEncoder.Methods["UserOp"]
encoded, err := method.Inputs.Pack(userOp)


if err != nil {
return "", nil, err
}
//https://github.com/jayden-sudo/SoulWalletCore/blob/dc76bdb9a156d4f99ef41109c59ab99106c193ac/contracts/utils/CalldataPack.sol#L51-L65


hexString := hex.EncodeToString(encoded)

hexString = hexString[64:]
hexString = hexString[:640]
return hexString, encoded, nil
}

Expand Down

0 comments on commit 9778517

Please sign in to comment.