Skip to content

Commit

Permalink
Add getAddress function to EthereumContract (#498)
Browse files Browse the repository at this point in the history
The function returns the address of the contract instance.
  • Loading branch information
lukasz-zimnoch authored Jan 25, 2023
2 parents 994ee45 + 2c4d1da commit 44998d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions typescript/src/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ class EthereumContract<T extends EthersContract> {
config.deployedAtBlockNumber ?? deployment.receipt.blockNumber
}

/**
* Get address of the contract instance.
* @returns Address of this contract instance.
*/
getAddress(): Address {
return Address.from(this._instance.address)
}

/**
* Get events emitted by the Ethereum contract.
* @param eventName Name of the event.
Expand Down

0 comments on commit 44998d5

Please sign in to comment.