Skip to content

Commit

Permalink
feat: arm
Browse files Browse the repository at this point in the history
- update abis with final deployed versions
  • Loading branch information
apexearth committed Oct 17, 2024
1 parent ce18b21 commit 4ea5fed
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 69 deletions.
File renamed without changes.
75 changes: 75 additions & 0 deletions abi/origin-lido-arm-zapper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[
{
"inputs": [
{ "internalType": "address", "name": "_weth", "type": "address" },
{ "internalType": "address", "name": "_lidoArm", "type": "address" }
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{ "indexed": false, "internalType": "address", "name": "previousAdmin", "type": "address" },
{ "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" }
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "sender", "type": "address" },
{ "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" },
{ "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" }
],
"name": "Zap",
"type": "event"
},
{
"inputs": [],
"name": "deposit",
"outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "lidoArm",
"outputs": [{ "internalType": "contract ILiquidityProviderARM", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "token", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "rescueERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
"name": "setOwner",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "weth",
"outputs": [{ "internalType": "contract IWETH", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{ "stateMutability": "payable", "type": "receive" }
]
61 changes: 28 additions & 33 deletions abi/origin-lido-arm.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
"name": "CapManagerUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "uint256[]", "name": "requestIds", "type": "uint256[]" }],
"name": "ClaimLidoWithdrawals",
"type": "event"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "uint256", "name": "crossPrice", "type": "uint256" }],
Expand Down Expand Up @@ -171,6 +177,15 @@
"name": "RedeemRequested",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": false, "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" },
{ "indexed": false, "internalType": "uint256[]", "name": "requestIds", "type": "uint256[]" }
],
"name": "RequestLidoWithdrawals",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand All @@ -190,12 +205,6 @@
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [{ "indexed": true, "internalType": "address", "name": "zap", "type": "address" }],
"name": "ZapUpdated",
"type": "event"
},
{
"inputs": [],
"name": "FEE_SCALE",
Expand Down Expand Up @@ -324,7 +333,7 @@
{
"inputs": [
{ "internalType": "uint256", "name": "assets", "type": "uint256" },
{ "internalType": "address", "name": "liquidityProvider", "type": "address" }
{ "internalType": "address", "name": "receiver", "type": "address" }
],
"name": "deposit",
"outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }],
Expand Down Expand Up @@ -380,6 +389,13 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lidoWithdrawalQueue",
"outputs": [{ "internalType": "contract IStETHWithdrawal", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lidoWithdrawalQueueAmount",
Expand All @@ -404,7 +420,7 @@
{
"inputs": [],
"name": "nextWithdrawalIndex",
"outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }],
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
Expand Down Expand Up @@ -505,13 +521,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "_zap", "type": "address" }],
"name": "setZap",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "steth",
Expand Down Expand Up @@ -648,44 +657,30 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdrawalQueue",
"outputs": [{ "internalType": "contract IStETHWithdrawal", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }],
"name": "withdrawalRequests",
"outputs": [
{ "internalType": "address", "name": "withdrawer", "type": "address" },
{ "internalType": "bool", "name": "claimed", "type": "bool" },
{ "internalType": "uint40", "name": "claimTimestamp", "type": "uint40" },
{ "internalType": "uint120", "name": "assets", "type": "uint120" },
{ "internalType": "uint120", "name": "queued", "type": "uint120" }
{ "internalType": "uint128", "name": "assets", "type": "uint128" },
{ "internalType": "uint128", "name": "queued", "type": "uint128" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdrawsClaimed",
"outputs": [{ "internalType": "uint120", "name": "", "type": "uint120" }],
"outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdrawsQueued",
"outputs": [{ "internalType": "uint120", "name": "", "type": "uint120" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "zap",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }],
"stateMutability": "view",
"type": "function"
},
Expand Down
File renamed without changes.
56 changes: 56 additions & 0 deletions src/abi/origin-lido-arm-zapper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import * as p from '@subsquid/evm-codec'
import { event, fun, viewFun, indexed, ContractBase } from '@subsquid/evm-abi'
import type { EventParams as EParams, FunctionArguments, FunctionReturn } from '@subsquid/evm-abi'

export const events = {
AdminChanged: event("0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f", "AdminChanged(address,address)", {"previousAdmin": p.address, "newAdmin": p.address}),
Zap: event("0x4a5e9c74490922edc73617d3f521bffd83682ac8c6d5bfe58d1386853c483dff", "Zap(address,uint256,uint256)", {"sender": indexed(p.address), "assets": p.uint256, "shares": p.uint256}),
}

export const functions = {
deposit: fun("0xd0e30db0", "deposit()", {}, p.uint256),
lidoArm: viewFun("0x0569dcad", "lidoArm()", {}, p.address),
owner: viewFun("0x8da5cb5b", "owner()", {}, p.address),
rescueERC20: fun("0x8cd4426d", "rescueERC20(address,uint256)", {"token": p.address, "amount": p.uint256}, ),
setOwner: fun("0x13af4035", "setOwner(address)", {"newOwner": p.address}, ),
weth: viewFun("0x3fc8cef3", "weth()", {}, p.address),
}

export class Contract extends ContractBase {

lidoArm() {
return this.eth_call(functions.lidoArm, {})
}

owner() {
return this.eth_call(functions.owner, {})
}

weth() {
return this.eth_call(functions.weth, {})
}
}

/// Event types
export type AdminChangedEventArgs = EParams<typeof events.AdminChanged>
export type ZapEventArgs = EParams<typeof events.Zap>

/// Function types
export type DepositParams = FunctionArguments<typeof functions.deposit>
export type DepositReturn = FunctionReturn<typeof functions.deposit>

export type LidoArmParams = FunctionArguments<typeof functions.lidoArm>
export type LidoArmReturn = FunctionReturn<typeof functions.lidoArm>

export type OwnerParams = FunctionArguments<typeof functions.owner>
export type OwnerReturn = FunctionReturn<typeof functions.owner>

export type RescueERC20Params = FunctionArguments<typeof functions.rescueERC20>
export type RescueERC20Return = FunctionReturn<typeof functions.rescueERC20>

export type SetOwnerParams = FunctionArguments<typeof functions.setOwner>
export type SetOwnerReturn = FunctionReturn<typeof functions.setOwner>

export type WethParams = FunctionArguments<typeof functions.weth>
export type WethReturn = FunctionReturn<typeof functions.weth>

Loading

0 comments on commit 4ea5fed

Please sign in to comment.