Skip to content

Commit

Permalink
chore: regenerate contracts from evm package
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Dec 24, 2024
1 parent 372e279 commit b554785
Show file tree
Hide file tree
Showing 36 changed files with 20,312 additions and 16,018 deletions.
2 changes: 1 addition & 1 deletion packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"zx": "^7.2.3"
},
"devDependencies": {
"@axelar-network/interchain-token-service": "^1.2.4",
"@axelar-network/interchain-token-service": "^2.0.1",
"@axelarjs/api": "workspace:^",
"@axelarjs/config": "workspace:*",
"@types/node": "^20.11.30",
Expand Down
4 changes: 1 addition & 3 deletions packages/evm/src/contracts/its/ERC20/ERC20.args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ export const ERC20_ENCODERS = {
},
};

export function createERC20ReadClient(
publicClient: PublicContractClient<typeof ABI_FILE.abi>
) {
export function createERC20ReadClient(publicClient: PublicContractClient) {
return {
allowance(allowanceArgs: ERC20AllowanceArgs) {
const encoder = ERC20_ENCODERS["allowance"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export const ERC20_PERMIT_ENCODERS = {
};

export function createERC20PermitReadClient(
publicClient: PublicContractClient<typeof ABI_FILE.abi>
publicClient: PublicContractClient
) {
return {
DOMAIN_SEPARATOR() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const IADDRESS_TRACKER_ENCODERS = {
};

export function createIAddressTrackerReadClient(
publicClient: PublicContractClient<typeof ABI_FILE.abi>
publicClient: PublicContractClient
) {
return {
chainName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const IBASE_TOKEN_MANAGER_ENCODERS = {
};

export function createIBaseTokenManagerReadClient(
publicClient: PublicContractClient<typeof ABI_FILE.abi>
publicClient: PublicContractClient
) {
return {
getTokenAddressFromParams(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const IERC20_NAMED_ENCODERS = {
};

export function createIERC20NamedReadClient(
publicClient: PublicContractClient<typeof ABI_FILE.abi>
publicClient: PublicContractClient
) {
return {
allowance(allowanceArgs: IERC20NamedAllowanceArgs) {
Expand Down
42 changes: 42 additions & 0 deletions packages/evm/src/contracts/its/IFlowLimit/IFlowLimit.abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@
export default {
contractName: "IFlowLimit",
abi: [
{
inputs: [
{
internalType: "uint256",
name: "flowAmount",
type: "uint256",
},
{
internalType: "uint256",
name: "flowToAdd",
type: "uint256",
},
{
internalType: "address",
name: "tokenManager",
type: "address",
},
],
name: "FlowAdditionOverflow",
type: "error",
},
{
inputs: [
{
Expand All @@ -32,6 +53,27 @@ export default {
name: "FlowLimitExceeded",
type: "error",
},
{
inputs: [
{
internalType: "uint256",
name: "flowLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "flowToCompare",
type: "uint256",
},
{
internalType: "address",
name: "tokenManager",
type: "address",
},
],
name: "FlowLimitOverflow",
type: "error",
},
{
anonymous: false,
inputs: [
Expand Down
4 changes: 1 addition & 3 deletions packages/evm/src/contracts/its/IFlowLimit/IFlowLimit.args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import ABI_FILE from "./IFlowLimit.abi";

export const IFLOW_LIMIT_ENCODERS = {};

export function createIFlowLimitReadClient(
publicClient: PublicContractClient<typeof ABI_FILE.abi>
) {
export function createIFlowLimitReadClient(publicClient: PublicContractClient) {
return {
flowInAmount() {
return publicClient.read("flowInAmount");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* This file was generated by scripts/codegen.ts
*
* Original abi file:
* - node_modules/@axelar-network/interchain-token-service/artifacts/contracts/interfaces/IGatewayCaller.sol/IGatewayCaller.json
*
* DO NOT EDIT MANUALLY
*/

export default {
contractName: "IGatewayCaller",
abi: [
{
inputs: [
{
internalType: "uint32",
name: "metadataVersion",
type: "uint32",
},
],
name: "InvalidMetadataVersion",
type: "error",
},
{
inputs: [
{
internalType: "string",
name: "destinationChain",
type: "string",
},
{
internalType: "string",
name: "destinationAddress",
type: "string",
},
{
internalType: "bytes",
name: "payload",
type: "bytes",
},
{
internalType: "enum IGatewayCaller.MetadataVersion",
name: "metadataVersion",
type: "uint8",
},
{
internalType: "uint256",
name: "gasValue",
type: "uint256",
},
],
name: "callContract",
outputs: [],
stateMutability: "payable",
type: "function",
},
],
} as const;
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* This file was generated by scripts/codegen.ts
*
* Original abi file:
* - node_modules/@axelar-network/interchain-token-service/artifacts/contracts/interfaces/IGatewayCaller.sol/IGatewayCaller.json
*
* DO NOT EDIT MANUALLY
*/

import { encodeFunctionData } from "viem";

import ABI_FILE from "./IGatewayCaller.abi";

export type IGatewayCallerCallContractArgs = {
destinationChain: string;
destinationAddress: string;
payload: `0x${string}`;
metadataVersion: number;
gasValue: bigint;
};

/**
* Factory function for IGatewayCaller.callContract function args
*/
export const encodeIGatewayCallerCallContractArgs = ({
destinationChain,
destinationAddress,
payload,
metadataVersion,
gasValue,
}: IGatewayCallerCallContractArgs) =>
[
destinationChain,
destinationAddress,
payload,
metadataVersion,
gasValue,
] as const;

/**
* Encoder function for IGatewayCaller.callContract function data
*/
export const encodeIGatewayCallerCallContractData = ({
destinationChain,
destinationAddress,
payload,
metadataVersion,
gasValue,
}: IGatewayCallerCallContractArgs): `0x${string}` =>
encodeFunctionData({
functionName: "callContract",
abi: ABI_FILE.abi,
args: [
destinationChain,
destinationAddress,
payload,
metadataVersion,
gasValue,
],
});

export const IGATEWAY_CALLER_ENCODERS = {
callContract: {
args: encodeIGatewayCallerCallContractArgs,
data: encodeIGatewayCallerCallContractData,
},
};
50 changes: 50 additions & 0 deletions packages/evm/src/contracts/its/IGatewayCaller/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* This file was generated by scripts/codegen.ts
*
* Original abi file:
* - node_modules/@axelar-network/interchain-token-service/artifacts/contracts/interfaces/IGatewayCaller.sol/IGatewayCaller.json
*
* DO NOT EDIT MANUALLY
*/

import { Chain } from "viem";

import { PublicContractClient } from "../../PublicContractClient";
import ABI_FILE from "./IGatewayCaller.abi";

export * from "./IGatewayCaller.args";

export const IGATEWAY_CALLER_ABI = ABI_FILE.abi;

/**
* IGatewayCallerClient
*
* @description Type-safe contract client for IGatewayCaller
*
* @example
*
* import { sepolia } from "viem/chains";
*
* const client = createIGatewayCallerClient({
* chain: sepolia,
* address: "0x1234..."
* });
*/
export class IGatewayCallerClient extends PublicContractClient {
static ABI = ABI_FILE.abi;
static contractName = ABI_FILE.contractName;

constructor(options: { chain: Chain; address: `0x${string}` }) {
super({
abi: IGATEWAY_CALLER_ABI,
address: options.address,
chain: options.chain,
});
}
}

export const createIGatewayCallerClient = (options: {
chain: Chain;
address: `0x${string}`;
}) => new IGatewayCallerClient(options);
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export const IINTERCHAIN_TOKEN_ENCODERS = {
};

export function createIInterchainTokenReadClient(
publicClient: PublicContractClient<typeof ABI_FILE.abi>
publicClient: PublicContractClient
) {
return {
allowance(allowanceArgs: IInterchainTokenAllowanceArgs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const IINTERCHAIN_TOKEN_DEPLOYER_ENCODERS = {
};

export function createIInterchainTokenDeployerReadClient(
publicClient: PublicContractClient<typeof ABI_FILE.abi>
publicClient: PublicContractClient
) {
return {
deployedAddress(
Expand Down
Loading

0 comments on commit b554785

Please sign in to comment.