Table of Contents

Class Erc20SwapCodec

Namespace
NArk.ArkadeIntents.Evm
Assembly
NArk.ArkadeIntents.dll

Minimal ABI codec for the ERC20Swap calls used by an EVM send.

public static class Erc20SwapCodec
Inheritance
Erc20SwapCodec
Inherited Members

Fields

ClaimTopic

Topic zero for Claim(bytes32,bytes32).

public const string ClaimTopic = "0x5664142af3dcfc3dc3de45a43f75c746bd1d8c11170a5037fdf98bdb35775137"

Field Value

string

TransferTopic

Topic zero for the canonical ERC20 Transfer(address,address,uint256) event.

public const string TransferTopic = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"

Field Value

string

Properties

ClaimForSelector

Selector for claim(bytes32,uint256,address,address,address,uint256).

public static ReadOnlySpan<byte> ClaimForSelector { get; }

Property Value

ReadOnlySpan<byte>

SwapsSelector

Selector for swaps(bytes32).

public static ReadOnlySpan<byte> SwapsSelector { get; }

Property Value

ReadOnlySpan<byte>

Methods

ClaimForCall(ReadOnlySpan<byte>, Erc20SwapValues)

Builds calldata for the permissionless claim overload commonly called claimFor.

public static byte[] ClaimForCall(ReadOnlySpan<byte> preimage, Erc20SwapValues values)

Parameters

preimage ReadOnlySpan<byte>

The 32-byte preimage.

values Erc20SwapValues

The exact lock values.

Returns

byte[]

ABI calldata.

ReadSwapsResult(ReadOnlySpan<byte>)

Reads a canonical 32-byte ABI Boolean.

public static bool ReadSwapsResult(ReadOnlySpan<byte> result)

Parameters

result ReadOnlySpan<byte>

Raw eth_call result.

Returns

bool

The decoded Boolean.

SwapKey(Erc20SwapValues)

Computes keccak256(abi.encode(...)) over the six lock values.

public static byte[] SwapKey(Erc20SwapValues values)

Parameters

values Erc20SwapValues

The exact lock values.

Returns

byte[]

The 32-byte mapping key.

SwapsCall(Erc20SwapValues)

Builds calldata for swaps(key).

public static byte[] SwapsCall(Erc20SwapValues values)

Parameters

values Erc20SwapValues

The exact lock values.

Returns

byte[]

ABI calldata.