Skip to content

Commit

Permalink
fix old interface traits (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamuik16 authored May 9, 2024
1 parent 9f34e3c commit 2f0dfe8
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions docs/modules/ROOT/pages/interfaces.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ This includes only the functions defined in the interface, and is the standard w
```cairo
#[starknet::interface]
trait IERC20<TState> {
fn name(self: @TState) -> ByteArray;
fn symbol(self: @TState) -> ByteArray;
fn decimals(self: @TState) -> u8;
fn total_supply(self: @TState) -> u256;
fn balance_of(self: @TState, account: ContractAddress) -> u256;
fn allowance(self: @TState, owner: ContractAddress, spender: ContractAddress) -> u256;
Expand All @@ -50,9 +47,7 @@ They describe a contract's complete interface. This is useful to interface with
```cairo
#[starknet::interface]
trait ERC20ABI<TState> {
fn name(self: @TState) -> ByteArray;
fn symbol(self: @TState) -> ByteArray;
fn decimals(self: @TState) -> u8;
// IERC20
fn total_supply(self: @TState) -> u256;
fn balance_of(self: @TState, account: ContractAddress) -> u256;
fn allowance(self: @TState, owner: ContractAddress, spender: ContractAddress) -> u256;
Expand All @@ -61,6 +56,18 @@ trait ERC20ABI<TState> {
ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256
) -> bool;
fn approve(ref self: TState, spender: ContractAddress, amount: u256) -> bool;

// IERC20Metadata
fn name(self: @TState) -> ByteArray;
fn symbol(self: @TState) -> ByteArray;
fn decimals(self: @TState) -> u8;

// IERC20CamelOnly
fn totalSupply(self: @TState) -> u256;
fn balanceOf(self: @TState, account: ContractAddress) -> u256;
fn transferFrom(
ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256
) -> bool;
}
```

Expand Down

0 comments on commit 2f0dfe8

Please sign in to comment.