Skip to main content

contracts/handlers/l1-reward-manager-handler

Classes​

L1RewardManagerHandler​

Defined in: lib/contracts/handlers/l1-reward-manager-handler.ts:15

Handler for the L1RewardManager contract.

Constructors​

Constructor​

new L1RewardManagerHandler(chain, walletClient, publicClient): L1RewardManagerHandler

Defined in: lib/contracts/handlers/l1-reward-manager-handler.ts:28

Create the handler for the L1RewardManager contract exposing methods to interact with the contract.

Parameters​
ParameterTypeDescription
chainChainChain to use for the client.
walletClient{ }The wallet client to use for wallet interactions.
publicClient{ }The public client to use for public interactions.
Returns​

L1RewardManagerHandler

Methods​

getBridge()​

getBridge(bridgeAddress): Promise<{ destinationDomainId: number; }>

Defined in: lib/contracts/handlers/l1-reward-manager-handler.ts:60

Get the bridge data for the given bridge address.

Parameters​
ParameterTypeDescription
bridgeAddress`0x${string}`Address of the bridge.
Returns​

Promise<{ destinationDomainId: number; }>

The bridge data.

getContract()​

getContract(): object

Defined in: lib/contracts/handlers/l1-reward-manager-handler.ts:42

Get the contract. This is a method because the typings are complex and lost when trying to make it a member.

Returns​

object

The viem contract.

setL2RewardClaimer()​

setL2RewardClaimer(account, bridge, claimer): object

Defined in: lib/contracts/handlers/l1-reward-manager-handler.ts:78

Sets the rewards claimer on L2. Smart contracts might not be able to to own the same address on L2. This function allows to set a different address as the claimer.

Parameters​
ParameterTypeDescription
account`0x${string}`The account to make the transaction with.
bridge`0x${string}`Address of the bridge.
claimer`0x${string}`Address of the new claimer.
Returns​

object

transact: () => Promise<Address> - Used to make the transaction.

estimate: () => Promise<bigint> - Gas estimate of the transaction.

estimate()​

estimate: () => Promise<bigint>

Returns​

Promise<bigint>

transact()​

transact: () => Promise<`0x${string}`>

Returns​

Promise<`0x${string}`>