Class

Allowance

Allowance(mopt) → {void}

Constructor

# new Allowance(mopt) → {void}

Captures an approval relationship where an owner allows a spender to transfer up to a certain value from the owner's wallet.

ERC20 allowance model

sequenceDiagram participant App App->>App: new Allowance({ owner, spender, value })
Parameters:
Name Type Attributes Description
m ModelArg.<Allowance> <optional>

Optional partial data or another instance to initialize the model

View Source contracts/erc20/models.ts, line 166

void
Example
const allowance = new Allowance({ owner: "acct1", spender: "acct2", value: 50 });

Members

# owner

Wallet that authorizes the allowance

Owner wallet identifier

View Source contracts/erc20/models.ts, line 184

# spender

Wallet allowed to spend up to the approved value from the owner

Spender wallet identifier

View Source contracts/erc20/models.ts, line 189

# value

Maximum token amount the spender may transfer on behalf of the owner

Approved value

View Source contracts/erc20/models.ts, line 194