Skip to content

Commit

Permalink
Merge pull request #272 from shotaronowhere/netlify-relayer
Browse files Browse the repository at this point in the history
WIP:Netlify relayer
  • Loading branch information
jaybuidl authored Oct 23, 2023
2 parents e070f23 + 50af1b2 commit 72fd017
Show file tree
Hide file tree
Showing 347 changed files with 59,227 additions and 5,192 deletions.
9 changes: 9 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build.environment]
RPC_URL_MAINNET="https://rpc.ankr.com/eth"
RPC_GOERLI="https://goerli.infura.io/v3/"
RPC_ARB_GOERLI="https://goerli-rollup.arbitrum.io/rpc"
RPC_CHIADO="https://rpc.eu-central-2.gateway.fm/v3/gnosis/archival/chiado"
VEAOUTBOX_ARBGOERLI_TO_CHIADO_ADDRESS="0x9481b3A49ac67d03D9022E6200eFD81850BADDB4"
VEAINBOX_ARBGOERLI_TO_CHIADO_ADDRESS="0xf38b8739635d2F4cb38Bd453453AB9d41fD16300"
VEAOUTBOX_ARBGOERLI_TO_GOERLI_ADDRESS="0xDa528e9BE20a8A22437D28Ed6C63bb6d00Ad0032"
VEAINBOX_ARBGOERLI_TO_GOERLI_ADDRESS="0xE99C6177CD8731DE6F108443CcAf7449074f6aED"
8 changes: 4 additions & 4 deletions relayer-cli/.env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PRIVATE_KEY=
RPC_CHIADO=https://rpc.chiado.gnosis.gateway.fm
RPC_GOERLI=https://goerli.infura.io/v3/

VEAINBOX_ARBGOERLI_TO_GOERLI_ADDRESS=0xA3FefC6FeE3fc66B9d9a8BEE794736ab71a74c55
VEAINBOX_ARBGOERLI_TO_CHIADO_ADDRESS=0x660daB9A6436A814a6ae3a6f27b309356a4bE78c
VEAOUTBOX_ARBGOERLI_TO_GOERLI_ADDRESS=0x9235A379950B9f01fb3e2961C06912A96DCcef0e
VEAOUTBOX_ARBGOERLI_TO_CHIADO_ADDRESS=0xdFd7aDEb43d46FA3f16FB3e27F7fe85c3f5BD89D
VEAINBOX_ARBGOERLI_TO_GOERLI_ADDRESS=0xE99C6177CD8731DE6F108443CcAf7449074f6aED
VEAINBOX_ARBGOERLI_TO_CHIADO_ADDRESS=0xf38b8739635d2F4cb38Bd453453AB9d41fD16300
VEAOUTBOX_ARBGOERLI_TO_GOERLI_ADDRESS=0xDa528e9BE20a8A22437D28Ed6C63bb6d00Ad0032
VEAOUTBOX_ARBGOERLI_TO_CHIADO_ADDRESS=0x9481b3A49ac67d03D9022E6200eFD81850BADDB4
2 changes: 1 addition & 1 deletion relayer-cli/functions/utils/ethers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
VeaOutboxArbToEthDevnet__factory,
VeaOutboxArbToGnosisDevnet__factory,
VeaInboxArbToEth__factory,
} from "@kleros/vea-contracts/typechain-types";
} from "../../typechain-types";

export function getWallet(privateKey: string, web3ProviderURL: string) {
return new Wallet(privateKey, new JsonRpcProvider(web3ProviderURL));
Expand Down
1 change: 0 additions & 1 deletion relayer-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-graphql-request": "^6.0.0",
"@graphql-codegen/typescript-operations": "^4.0.1",
"@kleros/vea-contracts": "workspace:^",
"@netlify/functions": "^2.3.0",
"@typechain/ethers-v5": "^10.2.0",
"dotenv": "^16.0.3",
Expand Down
315 changes: 315 additions & 0 deletions relayer-cli/typechain-types/arbitrumToEth/VeaInboxArbToEth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
BaseContract,
BigNumber,
BigNumberish,
BytesLike,
CallOverrides,
ContractTransaction,
Overrides,
PopulatedTransaction,
Signer,
utils,
} from "ethers";
import type { FunctionFragment, Result, EventFragment } from "@ethersproject/abi";
import type { Listener, Provider } from "@ethersproject/providers";
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from "../common";

export type ClaimStruct = {
stateRoot: PromiseOrValue<BytesLike>;
claimer: PromiseOrValue<string>;
timestampClaimed: PromiseOrValue<BigNumberish>;
timestampVerification: PromiseOrValue<BigNumberish>;
blocknumberVerification: PromiseOrValue<BigNumberish>;
honest: PromiseOrValue<BigNumberish>;
challenger: PromiseOrValue<string>;
};

export type ClaimStructOutput = [string, string, number, number, number, number, string] & {
stateRoot: string;
claimer: string;
timestampClaimed: number;
timestampVerification: number;
blocknumberVerification: number;
honest: number;
challenger: string;
};

export interface VeaInboxArbToEthInterface extends utils.Interface {
functions: {
"count()": FunctionFragment;
"epochAt(uint256)": FunctionFragment;
"epochFinalized()": FunctionFragment;
"epochNow()": FunctionFragment;
"epochPeriod()": FunctionFragment;
"saveSnapshot()": FunctionFragment;
"sendMessage(address,bytes4,bytes)": FunctionFragment;
"sendSnapshot(uint256,(bytes32,address,uint32,uint32,uint32,uint8,address))": FunctionFragment;
"snapshots(uint256)": FunctionFragment;
"veaOutboxArbToEth()": FunctionFragment;
};

getFunction(
nameOrSignatureOrTopic:
| "count"
| "epochAt"
| "epochFinalized"
| "epochNow"
| "epochPeriod"
| "saveSnapshot"
| "sendMessage"
| "sendSnapshot"
| "snapshots"
| "veaOutboxArbToEth"
): FunctionFragment;

encodeFunctionData(functionFragment: "count", values?: undefined): string;
encodeFunctionData(functionFragment: "epochAt", values: [PromiseOrValue<BigNumberish>]): string;
encodeFunctionData(functionFragment: "epochFinalized", values?: undefined): string;
encodeFunctionData(functionFragment: "epochNow", values?: undefined): string;
encodeFunctionData(functionFragment: "epochPeriod", values?: undefined): string;
encodeFunctionData(functionFragment: "saveSnapshot", values?: undefined): string;
encodeFunctionData(
functionFragment: "sendMessage",
values: [PromiseOrValue<string>, PromiseOrValue<BytesLike>, PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(functionFragment: "sendSnapshot", values: [PromiseOrValue<BigNumberish>, ClaimStruct]): string;
encodeFunctionData(functionFragment: "snapshots", values: [PromiseOrValue<BigNumberish>]): string;
encodeFunctionData(functionFragment: "veaOutboxArbToEth", values?: undefined): string;

decodeFunctionResult(functionFragment: "count", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "epochAt", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "epochFinalized", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "epochNow", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "epochPeriod", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "saveSnapshot", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "sendMessage", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "sendSnapshot", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "snapshots", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "veaOutboxArbToEth", data: BytesLike): Result;

events: {
"MessageSent(bytes)": EventFragment;
"SnapshotSaved(bytes32,uint256,uint64)": EventFragment;
"SnapshotSent(uint256,bytes32)": EventFragment;
};

getEvent(nameOrSignatureOrTopic: "MessageSent"): EventFragment;
getEvent(nameOrSignatureOrTopic: "SnapshotSaved"): EventFragment;
getEvent(nameOrSignatureOrTopic: "SnapshotSent"): EventFragment;
}

export interface MessageSentEventObject {
_nodeData: string;
}
export type MessageSentEvent = TypedEvent<[string], MessageSentEventObject>;

export type MessageSentEventFilter = TypedEventFilter<MessageSentEvent>;

export interface SnapshotSavedEventObject {
_snapshot: string;
_epoch: BigNumber;
_count: BigNumber;
}
export type SnapshotSavedEvent = TypedEvent<[string, BigNumber, BigNumber], SnapshotSavedEventObject>;

export type SnapshotSavedEventFilter = TypedEventFilter<SnapshotSavedEvent>;

export interface SnapshotSentEventObject {
_epochSent: BigNumber;
_ticketId: string;
}
export type SnapshotSentEvent = TypedEvent<[BigNumber, string], SnapshotSentEventObject>;

export type SnapshotSentEventFilter = TypedEventFilter<SnapshotSentEvent>;

export interface VeaInboxArbToEth extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;

interface: VeaInboxArbToEthInterface;

queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;

listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;

functions: {
count(overrides?: CallOverrides): Promise<[BigNumber]>;

epochAt(
_timestamp: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[BigNumber] & { epoch: BigNumber }>;

epochFinalized(overrides?: CallOverrides): Promise<[BigNumber] & { epoch: BigNumber }>;

epochNow(overrides?: CallOverrides): Promise<[BigNumber] & { epoch: BigNumber }>;

epochPeriod(overrides?: CallOverrides): Promise<[BigNumber]>;

saveSnapshot(overrides?: Overrides & { from?: PromiseOrValue<string> }): Promise<ContractTransaction>;

sendMessage(
_to: PromiseOrValue<string>,
_fnSelector: PromiseOrValue<BytesLike>,
_data: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

sendSnapshot(
_epoch: PromiseOrValue<BigNumberish>,
_claim: ClaimStruct,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

snapshots(arg0: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<[string]>;

veaOutboxArbToEth(overrides?: CallOverrides): Promise<[string]>;
};

count(overrides?: CallOverrides): Promise<BigNumber>;

epochAt(_timestamp: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<BigNumber>;

epochFinalized(overrides?: CallOverrides): Promise<BigNumber>;

epochNow(overrides?: CallOverrides): Promise<BigNumber>;

epochPeriod(overrides?: CallOverrides): Promise<BigNumber>;

saveSnapshot(overrides?: Overrides & { from?: PromiseOrValue<string> }): Promise<ContractTransaction>;

sendMessage(
_to: PromiseOrValue<string>,
_fnSelector: PromiseOrValue<BytesLike>,
_data: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

sendSnapshot(
_epoch: PromiseOrValue<BigNumberish>,
_claim: ClaimStruct,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

snapshots(arg0: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<string>;

veaOutboxArbToEth(overrides?: CallOverrides): Promise<string>;

callStatic: {
count(overrides?: CallOverrides): Promise<BigNumber>;

epochAt(_timestamp: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<BigNumber>;

epochFinalized(overrides?: CallOverrides): Promise<BigNumber>;

epochNow(overrides?: CallOverrides): Promise<BigNumber>;

epochPeriod(overrides?: CallOverrides): Promise<BigNumber>;

saveSnapshot(overrides?: CallOverrides): Promise<void>;

sendMessage(
_to: PromiseOrValue<string>,
_fnSelector: PromiseOrValue<BytesLike>,
_data: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;

sendSnapshot(_epoch: PromiseOrValue<BigNumberish>, _claim: ClaimStruct, overrides?: CallOverrides): Promise<void>;

snapshots(arg0: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<string>;

veaOutboxArbToEth(overrides?: CallOverrides): Promise<string>;
};

filters: {
"MessageSent(bytes)"(_nodeData?: null): MessageSentEventFilter;
MessageSent(_nodeData?: null): MessageSentEventFilter;

"SnapshotSaved(bytes32,uint256,uint64)"(_snapshot?: null, _epoch?: null, _count?: null): SnapshotSavedEventFilter;
SnapshotSaved(_snapshot?: null, _epoch?: null, _count?: null): SnapshotSavedEventFilter;

"SnapshotSent(uint256,bytes32)"(
_epochSent?: PromiseOrValue<BigNumberish> | null,
_ticketId?: null
): SnapshotSentEventFilter;
SnapshotSent(_epochSent?: PromiseOrValue<BigNumberish> | null, _ticketId?: null): SnapshotSentEventFilter;
};

estimateGas: {
count(overrides?: CallOverrides): Promise<BigNumber>;

epochAt(_timestamp: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<BigNumber>;

epochFinalized(overrides?: CallOverrides): Promise<BigNumber>;

epochNow(overrides?: CallOverrides): Promise<BigNumber>;

epochPeriod(overrides?: CallOverrides): Promise<BigNumber>;

saveSnapshot(overrides?: Overrides & { from?: PromiseOrValue<string> }): Promise<BigNumber>;

sendMessage(
_to: PromiseOrValue<string>,
_fnSelector: PromiseOrValue<BytesLike>,
_data: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

sendSnapshot(
_epoch: PromiseOrValue<BigNumberish>,
_claim: ClaimStruct,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

snapshots(arg0: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<BigNumber>;

veaOutboxArbToEth(overrides?: CallOverrides): Promise<BigNumber>;
};

populateTransaction: {
count(overrides?: CallOverrides): Promise<PopulatedTransaction>;

epochAt(_timestamp: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<PopulatedTransaction>;

epochFinalized(overrides?: CallOverrides): Promise<PopulatedTransaction>;

epochNow(overrides?: CallOverrides): Promise<PopulatedTransaction>;

epochPeriod(overrides?: CallOverrides): Promise<PopulatedTransaction>;

saveSnapshot(overrides?: Overrides & { from?: PromiseOrValue<string> }): Promise<PopulatedTransaction>;

sendMessage(
_to: PromiseOrValue<string>,
_fnSelector: PromiseOrValue<BytesLike>,
_data: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

sendSnapshot(
_epoch: PromiseOrValue<BigNumberish>,
_claim: ClaimStruct,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

snapshots(arg0: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<PopulatedTransaction>;

veaOutboxArbToEth(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}
Loading

0 comments on commit 72fd017

Please sign in to comment.