Skip to content

Class: Contracts

Rocket Pool Contract Manager

Constructors

constructor

new Contracts(web3, RocketStorage)

Create a new Contract instance.

Parameters

NameTypeDescription
web3defaultA valid Web3 instance
RocketStoragestring | ContractArtifacta RocketStorage address as a string or ContractArtifact (JSON ABI file)

Defined in

rocketpool/contracts/contracts.ts:23

Properties

rocketStorage

Readonly rocketStorage: Promise<Contract>

Defined in

rocketpool/contracts/contracts.ts:12


addresses

Private addresses: Object = {}

Index signature

▪ [name: string]: Promise<string>

Defined in

rocketpool/contracts/contracts.ts:13


abis

Private abis: Object = {}

Index signature

▪ [name: string]: Promise<AbiItem[]>

Defined in

rocketpool/contracts/contracts.ts:14


contracts

Private contracts: Object = {}

Index signature

▪ [name: string]: Promise<Contract>

Defined in

rocketpool/contracts/contracts.ts:15

Methods

address

address(name): Promise<string>

Parameters

NameType
namestring

Returns

Promise<string>

Defined in

rocketpool/contracts/contracts.ts:35

address(names): Promise<string[]>

Parameters

NameType
namesstring[]

Returns

Promise<string[]>

Defined in

rocketpool/contracts/contracts.ts:36


abi

abi(name): Promise<AbiItem[]>

Parameters

NameType
namestring

Returns

Promise<AbiItem[]>

Defined in

rocketpool/contracts/contracts.ts:55

abi(names): Promise<AbiItem[][]>

Parameters

NameType
namesstring[]

Returns

Promise<AbiItem[][]>

Defined in

rocketpool/contracts/contracts.ts:56


get

get(name): Promise<Contract>

Parameters

NameType
namestring

Returns

Promise<Contract>

Defined in

rocketpool/contracts/contracts.ts:75

get(names): Promise<Contract[]>

Parameters

NameType
namesstring[]

Returns

Promise<Contract[]>

Defined in

rocketpool/contracts/contracts.ts:76


make

make(name, address): Promise<Contract>

Create a new contract instance with the specified ABI name and address

example using Typescript

ts
const minipool = await rp.contracts.make("rocketMinipoolDelegate", "0x24fBeD7Ecd625D3f0FD19a6c9113DEd436172294");

Parameters

NameTypeDescription
namestringA string representing the name of the contract
addressstringA string representing the address of the specific instance

Returns

Promise<Contract>

a Promise<Contract> that resolves to a web3.eth.contract instance of the contract

Defined in

rocketpool/contracts/contracts.ts:105