Class PaymentSplitter

Represents a simple wrapper around an ethers.Contract that adds some additional capabilities such as easy multicall structures a retryCall method for view operations, allows for connecting the contract to a different signerOrProvider without redeclaring, etc.

Hierarchy

Constructors

Accessors

  • get address(): string
  • Returns the contract address

    Returns string

  • get contract(): Contract
  • Returns the underlying contract interface

    Returns Contract

Methods

  • Getter for the version of the PaymentSplitter contract

    Returns Promise<BigNumber>

  • Adds another payee to the PaymentSplitter with the specified number of shares for the payee

    Note: payee must be non-zero

    Parameters

    • payee: string
    • shares: BigNumberish
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Returns an interface allowing for us with the multicall method of a provider

    Parameters

    • name: string
    • Rest ...params: any[]

    Returns ContractCall

  • Returns the number of payees in the PaymentSplitter

    Returns Promise<BigNumber>

  • Initializes the instance of PaymentSplitter where each account in payees is assigned the number of shares at the matching position in the shares array.

    All addresses in payees must be non-zero. Both arrays must have the same non-zero length.

    Parameters

    • Optional payees: string[]
    • Optional shares: BigNumberish[]
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Getter for the address of the payee number index.

    Parameters

    • index: BigNumberish

    Returns Promise<string>

  • Returns a list of the payees and their number of shares in the PaymentSplitter

    Returns Promise<{
        account: string;
        shares: BigNumber;
    }[]>

  • Returns amount currently pending distribution for the specified account

    Parameters

    • account: string
    • Optional token: string

    Returns Promise<BigNumber>

  • Triggers a transfer to account of the amount of Ether (or token) they are owed, according to their percentage of the total shares and their previous withdrawals.

    Parameters

    • account: string
    • Optional token: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Releases all funds due to all accounts in the PaymentSplitter

    Parameters

    • Optional token: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Getter for the amount of Ether (or token) already released to a payee.

    Parameters

    • account: string
    • Optional token: string

    Returns Promise<BigNumber>

  • Protected

    Automatically keeps trying the call unless we get a revert exception

    Type Parameters

    • T

    Parameters

    • func: ((...args) => Promise<T>)
        • (...args): Promise<T>
        • Parameters

          • Rest ...args: any[]

          Returns Promise<T>

    • Rest ...params: any[]

    Returns Promise<T>

  • Getter for the amount of shares held by an account.

    Parameters

    • account: string

    Returns Promise<BigNumber>

  • Returns whether the specified interface is supported by the contract

    Parameters

    • interfaceId: string

    Returns Promise<boolean>

  • Getter for the total amount of Ether (or token) already released.

    Parameters

    • Optional token: string

    Returns Promise<BigNumber>

  • Getter for the total shares held by payees.

    Returns Promise<BigNumber>