Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotERC6492Sig = errors.New("not an ERC-6492 signature") ErrCorruptedERC6492Sig = errors.New("corrupted ERC-6492 signature") )
Functions ¶
func IsERC6492Sig ¶
IsERC6492Sig checks if the signature contains the ERC-6492 suffix, meaning it is an ERC-6492 signature.
Parameters: - sig: the signature
Returns: - true if the signature is an ERC-6492 signature, false otherwise
func PackERC6492Sig ¶
PackERC6492Sig packs an ERC-6492 signature by adding smart wallet factory address, calldata and ERC-6492 suffix.
Parameters: - factoryAddress: the address of the smart wallet factory - factoryCalldata: the calldata for the smart wallet factory - sig: the signature
Returns: - the packed signature
func UnpackERC6492Sig ¶
func UnpackERC6492Sig(sig []byte) (factoryAddress common.Address, factoryCalldata, signature []byte, err error)
UnpackERC6492Sig unpacks an ERC-6492 signature into a smart wallet factory address, calldata and signature.
Parameters: - sig: the signature
Returns: - the smart wallet factory address - the calldata for the smart wallet factory - the signature - an error if the signature is not an ERC-6492 signature or it is corrupted
Types ¶
type Client ¶
type Client interface { // Verify checks if the signature was signed by the signer. // This function supports ECDSA, ERC-1271 and ERC-6492 signatures. // // Parameters: // - ctx: the context // - signer: the address of the signer. EOA address if ECDSA signature is supplied, smart wallet address if ERC-1271 or ERC-6492 signature is supplied. // - messageHash: the hash of the message that was signed // - signature: the signature // // Returns: // - true if the signature is valid, false otherwise // - an error if an error occurred during the verification Verify(ctx context.Context, signer common.Address, messageHash common.Hash, signature []byte) (bool, error) // PackERC6492Sig packs an ERC-6492 signature by adding smart wallet factory address, calldata and ERC-6492 suffix. // // Parameters: // - ctx: the context // - ownerAddress: the address of the owner of the smart wallet // - index: the index of the smart wallet // - sig: the signature // // Returns: // - the packed signature // - an error if an error occurred during the packing PackERC6492Sig(ctx context.Context, ownerAddress common.Address, index decimal.Decimal, sig []byte) ([]byte, error) }