@polareth/evmstate
Version:
A TypeScript library for tracing, and visualizing EVM state changes with detailed human-readable labeling.
247 lines (244 loc) • 4.98 kB
text/typescript
// [!region mappings]
export const abi = [
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address",
},
{
internalType: "address",
name: "spender",
type: "address",
},
],
name: "getAllowance",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "index",
type: "uint256",
},
],
name: "getArrayMapping",
outputs: [
{
internalType: "uint256[]",
name: "",
type: "uint256[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
],
name: "getBalance",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
],
name: "getUserInfo",
outputs: [
{
components: [
{
internalType: "uint256",
name: "balance",
type: "uint256",
},
{
internalType: "uint256",
name: "lastUpdate",
type: "uint256",
},
{
internalType: "bool",
name: "isActive",
type: "bool",
},
],
internalType: "struct Mappings.UserInfo",
name: "",
type: "tuple",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address",
},
{
internalType: "address",
name: "spender",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "setAllowance",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "index",
type: "uint256",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
],
name: "setArrayMapping",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "setBalance",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "balance",
type: "uint256",
},
{
internalType: "uint256",
name: "lastUpdate",
type: "uint256",
},
{
internalType: "bool",
name: "isActive",
type: "bool",
},
],
name: "setUserInfo",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "newBalance",
type: "uint256",
},
],
name: "updateUserBalance",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
] as const;
// [!endregion mappings]
// [!region erc20]
export const erc20Abi = [
{
name: "transfer",
inputs: [
{ internalType: "address", name: "to", type: "address" },
{ internalType: "uint256", name: "amount", type: "uint256" },
],
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
{
name: "approve",
inputs: [{ internalType: "address", name: "spender", type: "address" }, { internalType: "uint256", name: "amount", type: "uint256" }],
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
] as const;
// [!endregion erc20]
// [!region simple-dex]
export const simpleDexAbi = [
{
inputs: [
{ internalType: "address", name: "tokenIn", type: "address" },
{ internalType: "address", name: "tokenOut", type: "address" },
{ internalType: "uint256", name: "amountIn", type: "uint256" },
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
],
name: "swap",
outputs: [],
stateMutability: "payable",
type: "function",
},
] as const;
// [!endregion simple-dex]