Skip to content
You are reading the development version documentation and some displayed features may not be available in the stable release. You can switch to stable version using the version box at screen bottom.
Last update: October 8, 2021

yearn-vaults / Modules / ERC20 / ERC20

Class: ERC20

ERC20.ERC20

Hierarchy

  • BaseContract

ERC20

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ERC20(addressOrName, contractInterface, signerOrProvider?)

Parameters

Name Type
addressOrName string
contractInterface ContractInterface
signerOrProvider? Signer | Provider

Inherited from

BaseContract.constructor

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:103

Properties

_deployedPromise

_deployedPromise: Promise<Contract>

Inherited from

BaseContract._deployedPromise

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:96


_runningEvents

_runningEvents: Object

Index signature

▪ [eventTag: string]: RunningEvent

Inherited from

BaseContract._runningEvents

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:97


_wrappedEmits

_wrappedEmits: Object

Index signature

▪ [eventTag: string]: (…args: any[]) => void

Inherited from

BaseContract._wrappedEmits

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:100


address

Readonly address: string

Inherited from

BaseContract.address

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:75


callStatic

callStatic: Object

Type declaration

Name Type
allowance (owner: string, spender: string, overrides?: CallOverrides) => Promise<BigNumber>
approve (spender: string, amount: BigNumberish, overrides?: CallOverrides) => Promise<boolean>
balanceOf (account: string, overrides?: CallOverrides) => Promise<BigNumber>
decimals (overrides?: CallOverrides) => Promise<number>
decreaseAllowance (spender: string, subtractedValue: BigNumberish, overrides?: CallOverrides) => Promise<boolean>
increaseAllowance (spender: string, addedValue: BigNumberish, overrides?: CallOverrides) => Promise<boolean>
name (overrides?: CallOverrides) => Promise<string>
symbol (overrides?: CallOverrides) => Promise<string>
totalSupply (overrides?: CallOverrides) => Promise<BigNumber>
transfer (recipient: string, amount: BigNumberish, overrides?: CallOverrides) => Promise<boolean>
transferFrom (sender: string, recipient: string, amount: BigNumberish, overrides?: CallOverrides) => Promise<boolean>

Overrides

BaseContract.callStatic

Defined in

typechain/ERC20.d.ts:254


deployTransaction

Readonly deployTransaction: TransactionResponse

Inherited from

BaseContract.deployTransaction

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:95


estimateGas

estimateGas: Object

Type declaration

Name Type
allowance (owner: string, spender: string, overrides?: CallOverrides) => Promise<BigNumber>
approve (spender: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<BigNumber>
balanceOf (account: string, overrides?: CallOverrides) => Promise<BigNumber>
decimals (overrides?: CallOverrides) => Promise<BigNumber>
decreaseAllowance (spender: string, subtractedValue: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<BigNumber>
increaseAllowance (spender: string, addedValue: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<BigNumber>
name (overrides?: CallOverrides) => Promise<BigNumber>
symbol (overrides?: CallOverrides) => Promise<BigNumber>
totalSupply (overrides?: CallOverrides) => Promise<BigNumber>
transfer (recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<BigNumber>
transferFrom (sender: string, recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<BigNumber>

Overrides

BaseContract.estimateGas

Defined in

typechain/ERC20.d.ts:341


filters

filters: Object

Type declaration

Name Type
Approval (owner?: null | string, spender?: null | string, value?: null) => TypedEventFilter<[string, string, BigNumber], Object>
Approval(address,address,uint256) (owner?: null | string, spender?: null | string, value?: null) => TypedEventFilter<[string, string, BigNumber], Object>
Transfer (from?: null | string, to?: null | string, value?: null) => TypedEventFilter<[string, string, BigNumber], Object>
Transfer(address,address,uint256) (from?: null | string, to?: null | string, value?: null) => TypedEventFilter<[string, string, BigNumber], Object>

Overrides

BaseContract.filters

Defined in

typechain/ERC20.d.ts:303


functions

functions: Object

Type declaration

Name Type
allowance (owner: string, spender: string, overrides?: CallOverrides) => Promise<[BigNumber]>
approve (spender: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<ContractTransaction>
balanceOf (account: string, overrides?: CallOverrides) => Promise<[BigNumber]>
decimals (overrides?: CallOverrides) => Promise<[number]>
decreaseAllowance (spender: string, subtractedValue: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<ContractTransaction>
increaseAllowance (spender: string, addedValue: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<ContractTransaction>
name (overrides?: CallOverrides) => Promise<[string]>
symbol (overrides?: CallOverrides) => Promise<[string]>
totalSupply (overrides?: CallOverrides) => Promise<[BigNumber]>
transfer (recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<ContractTransaction>
transferFrom (sender: string, recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<ContractTransaction>

Overrides

BaseContract.functions

Defined in

typechain/ERC20.d.ts:158


interface

interface: ERC20Interface

Overrides

BaseContract.interface

Defined in

typechain/ERC20.d.ts:156


populateTransaction

populateTransaction: Object

Type declaration

Name Type
allowance (owner: string, spender: string, overrides?: CallOverrides) => Promise<PopulatedTransaction>
approve (spender: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<PopulatedTransaction>
balanceOf (account: string, overrides?: CallOverrides) => Promise<PopulatedTransaction>
decimals (overrides?: CallOverrides) => Promise<PopulatedTransaction>
decreaseAllowance (spender: string, subtractedValue: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<PopulatedTransaction>
increaseAllowance (spender: string, addedValue: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<PopulatedTransaction>
name (overrides?: CallOverrides) => Promise<PopulatedTransaction>
symbol (overrides?: CallOverrides) => Promise<PopulatedTransaction>
totalSupply (overrides?: CallOverrides) => Promise<PopulatedTransaction>
transfer (recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<PopulatedTransaction>
transferFrom (sender: string, recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }) => Promise<PopulatedTransaction>

Overrides

BaseContract.populateTransaction

Defined in

typechain/ERC20.d.ts:390


provider

Readonly provider: Provider

Inherited from

BaseContract.provider

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:78


resolvedAddress

Readonly resolvedAddress: Promise<string>

Inherited from

BaseContract.resolvedAddress

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:94


signer

Readonly signer: Signer

Inherited from

BaseContract.signer

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:77

Methods

_checkRunningEvents

_checkRunningEvents(runningEvent): void

Parameters

Name Type
runningEvent RunningEvent

Returns

void

Inherited from

BaseContract._checkRunningEvents

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:117


_deployed

_deployed(blockTag?): Promise<Contract>

Parameters

Name Type
blockTag? BlockTag

Returns

Promise<Contract>

Inherited from

BaseContract._deployed

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:110


_wrapEvent

_wrapEvent(runningEvent, log, listener): Event

Parameters

Name Type
runningEvent RunningEvent
log Log
listener Listener

Returns

Event

Inherited from

BaseContract._wrapEvent

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:118


allowance

allowance(owner, spender, overrides?): Promise<BigNumber>

Parameters

Name Type
owner string
spender string
overrides? CallOverrides

Returns

Promise<BigNumber>

Defined in

typechain/ERC20.d.ts:207


approve

approve(spender, amount, overrides?): Promise<ContractTransaction>

Parameters

Name Type
spender string
amount BigNumberish
overrides? Overrides & { from?: string | Promise<string> }

Returns

Promise<ContractTransaction>

Defined in

typechain/ERC20.d.ts:213


attach

attach(addressOrName): ERC20

Parameters

Name Type
addressOrName string

Returns

ERC20

Overrides

BaseContract.attach

Defined in

typechain/ERC20.d.ts:117


balanceOf

balanceOf(account, overrides?): Promise<BigNumber>

Parameters

Name Type
account string
overrides? CallOverrides

Returns

Promise<BigNumber>

Defined in

typechain/ERC20.d.ts:219


connect

connect(signerOrProvider): ERC20

Parameters

Name Type
signerOrProvider string | Provider | Signer

Returns

ERC20

Overrides

BaseContract.connect

Defined in

typechain/ERC20.d.ts:116


decimals

decimals(overrides?): Promise<number>

Parameters

Name Type
overrides? CallOverrides

Returns

Promise<number>

Defined in

typechain/ERC20.d.ts:221


decreaseAllowance

decreaseAllowance(spender, subtractedValue, overrides?): Promise<ContractTransaction>

Parameters

Name Type
spender string
subtractedValue BigNumberish
overrides? Overrides & { from?: string | Promise<string> }

Returns

Promise<ContractTransaction>

Defined in

typechain/ERC20.d.ts:223


deployed

deployed(): Promise<ERC20>

Returns

Promise<ERC20>

Overrides

BaseContract.deployed

Defined in

typechain/ERC20.d.ts:118


emit

emit(eventName, …args): boolean

Parameters

Name Type
eventName string | EventFilter
...args any[]

Returns

boolean

Inherited from

BaseContract.emit

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:123


fallback

fallback(overrides?): Promise<TransactionResponse>

Parameters

Name Type
overrides? TransactionRequest

Returns

Promise<TransactionResponse>

Inherited from

BaseContract.fallback

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:111


increaseAllowance

increaseAllowance(spender, addedValue, overrides?): Promise<ContractTransaction>

Parameters

Name Type
spender string
addedValue BigNumberish
overrides? Overrides & { from?: string | Promise<string> }

Returns

Promise<ContractTransaction>

Defined in

typechain/ERC20.d.ts:229


listenerCount

listenerCount(eventName?): number

Parameters

Name Type
eventName? string | EventFilter

Returns

number

Inherited from

BaseContract.listenerCount

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:124


listeners

listeners<EventArgsArray, EventArgsObject>(eventFilter?): TypedListener<EventArgsArray, EventArgsObject>[]

Type parameters

Name Type
EventArgsArray extends any[]
EventArgsObject EventArgsObject

Parameters

Name Type
eventFilter? TypedEventFilter<EventArgsArray, EventArgsObject>

Returns

TypedListener<EventArgsArray, EventArgsObject>[]

Overrides

BaseContract.listeners

Defined in

typechain/ERC20.d.ts:120

listeners(eventName?): Listener[]

Parameters

Name Type
eventName? string

Returns

Listener[]

Overrides

BaseContract.listeners

Defined in

typechain/ERC20.d.ts:143


name

name(overrides?): Promise<string>

Parameters

Name Type
overrides? CallOverrides

Returns

Promise<string>

Defined in

typechain/ERC20.d.ts:235


off

off<EventArgsArray, EventArgsObject>(eventFilter, listener): ERC20

Type parameters

Name Type
EventArgsArray extends any[]
EventArgsObject EventArgsObject

Parameters

Name Type
eventFilter TypedEventFilter<EventArgsArray, EventArgsObject>
listener TypedListener<EventArgsArray, EventArgsObject>

Returns

ERC20

Overrides

BaseContract.off

Defined in

typechain/ERC20.d.ts:123

off(eventName, listener): ERC20

Parameters

Name Type
eventName string
listener Listener

Returns

ERC20

Overrides

BaseContract.off

Defined in

typechain/ERC20.d.ts:144


on

on<EventArgsArray, EventArgsObject>(eventFilter, listener): ERC20

Type parameters

Name Type
EventArgsArray extends any[]
EventArgsObject EventArgsObject

Parameters

Name Type
eventFilter TypedEventFilter<EventArgsArray, EventArgsObject>
listener TypedListener<EventArgsArray, EventArgsObject>

Returns

ERC20

Overrides

BaseContract.on

Defined in

typechain/ERC20.d.ts:127

on(eventName, listener): ERC20

Parameters

Name Type
eventName string
listener Listener

Returns

ERC20

Overrides

BaseContract.on

Defined in

typechain/ERC20.d.ts:145


once

once<EventArgsArray, EventArgsObject>(eventFilter, listener): ERC20

Type parameters

Name Type
EventArgsArray extends any[]
EventArgsObject EventArgsObject

Parameters

Name Type
eventFilter TypedEventFilter<EventArgsArray, EventArgsObject>
listener TypedListener<EventArgsArray, EventArgsObject>

Returns

ERC20

Overrides

BaseContract.once

Defined in

typechain/ERC20.d.ts:131

once(eventName, listener): ERC20

Parameters

Name Type
eventName string
listener Listener

Returns

ERC20

Overrides

BaseContract.once

Defined in

typechain/ERC20.d.ts:146


queryFilter

queryFilter<EventArgsArray, EventArgsObject>(event, fromBlockOrBlockhash?, toBlock?): Promise<TypedEvent<EventArgsArray & EventArgsObject>[]>

Type parameters

Name Type
EventArgsArray extends any[]
EventArgsObject EventArgsObject

Parameters

Name Type
event TypedEventFilter<EventArgsArray, EventArgsObject>
fromBlockOrBlockhash? string | number
toBlock? string | number

Returns

Promise<TypedEvent<EventArgsArray & EventArgsObject>[]>

Overrides

BaseContract.queryFilter

Defined in

typechain/ERC20.d.ts:150


removeAllListeners

removeAllListeners<EventArgsArray, EventArgsObject>(eventFilter): ERC20

Type parameters

Name Type
EventArgsArray extends any[]
EventArgsObject EventArgsObject

Parameters

Name Type
eventFilter TypedEventFilter<EventArgsArray, EventArgsObject>

Returns

ERC20

Overrides

BaseContract.removeAllListeners

Defined in

typechain/ERC20.d.ts:139

removeAllListeners(eventName?): ERC20

Parameters

Name Type
eventName? string

Returns

ERC20

Overrides

BaseContract.removeAllListeners

Defined in

typechain/ERC20.d.ts:148


removeListener

removeListener<EventArgsArray, EventArgsObject>(eventFilter, listener): ERC20

Type parameters

Name Type
EventArgsArray extends any[]
EventArgsObject EventArgsObject

Parameters

Name Type
eventFilter TypedEventFilter<EventArgsArray, EventArgsObject>
listener TypedListener<EventArgsArray, EventArgsObject>

Returns

ERC20

Overrides

BaseContract.removeListener

Defined in

typechain/ERC20.d.ts:135

removeListener(eventName, listener): ERC20

Parameters

Name Type
eventName string
listener Listener

Returns

ERC20

Overrides

BaseContract.removeListener

Defined in

typechain/ERC20.d.ts:147


symbol

symbol(overrides?): Promise<string>

Parameters

Name Type
overrides? CallOverrides

Returns

Promise<string>

Defined in

typechain/ERC20.d.ts:237


totalSupply

totalSupply(overrides?): Promise<BigNumber>

Parameters

Name Type
overrides? CallOverrides

Returns

Promise<BigNumber>

Defined in

typechain/ERC20.d.ts:239


transfer

transfer(recipient, amount, overrides?): Promise<ContractTransaction>

Parameters

Name Type
recipient string
amount BigNumberish
overrides? Overrides & { from?: string | Promise<string> }

Returns

Promise<ContractTransaction>

Defined in

typechain/ERC20.d.ts:241


transferFrom

transferFrom(sender, recipient, amount, overrides?): Promise<ContractTransaction>

Parameters

Name Type
sender string
recipient string
amount BigNumberish
overrides? Overrides & { from?: string | Promise<string> }

Returns

Promise<ContractTransaction>

Defined in

typechain/ERC20.d.ts:247


getContractAddress

Static getContractAddress(transaction): string

Parameters

Name Type
transaction Object
transaction.from string
transaction.nonce BigNumberish

Returns

string

Inherited from

BaseContract.getContractAddress

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:104


getInterface

Static getInterface(contractInterface): Interface

Parameters

Name Type
contractInterface ContractInterface

Returns

Interface

Inherited from

BaseContract.getInterface

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:108


isIndexed

Static isIndexed(value): value is Indexed

Parameters

Name Type
value any

Returns

value is Indexed

Inherited from

BaseContract.isIndexed

Defined in

node_modules/@ethersproject/contracts/lib/index.d.ts:114

Questions or feedback? You can discuss issues and obtain free support on Yearn Vaults chat channel.
For SushiSwap community support, join the Discord Server None