-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from keep-starknet-strange/refactor/components
refactor: use ERC20 component
- Loading branch information
Showing
6 changed files
with
425 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
scarb 2.3.1 | ||
starknet-foundry 0.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod tokens { | ||
mod interface; | ||
mod memecoin; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
use openzeppelin::token::erc20::interface::{IERC20Metadata, IERC20, IERC20Camel}; | ||
use starknet::ContractAddress; | ||
|
||
|
||
#[starknet::interface] | ||
trait IUnruggableMemecoin<TState> { | ||
// ************************************ | ||
// * Metadata | ||
// ************************************ | ||
fn name(self: @TState) -> felt252; | ||
fn symbol(self: @TState) -> felt252; | ||
fn decimals(self: @TState) -> u8; | ||
|
||
// ************************************ | ||
// * snake_case | ||
// ************************************ | ||
fn total_supply(self: @TState) -> u256; | ||
fn balance_of(self: @TState, account: ContractAddress) -> u256; | ||
fn allowance(self: @TState, owner: ContractAddress, spender: ContractAddress) -> u256; | ||
fn transfer(ref self: TState, recipient: ContractAddress, amount: u256) -> bool; | ||
fn transfer_from( | ||
ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256 | ||
) -> bool; | ||
fn approve(ref self: TState, spender: ContractAddress, amount: u256) -> bool; | ||
|
||
// ************************************ | ||
// * camelCase | ||
// ************************************ | ||
fn totalSupply(self: @TState) -> u256; | ||
fn balanceOf(self: @TState, account: ContractAddress) -> u256; | ||
fn transferFrom( | ||
ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256 | ||
) -> bool; | ||
|
||
// ************************************ | ||
// * Additional functions | ||
// ************************************ | ||
fn launch_memecoin(ref self: TState); | ||
} | ||
|
||
#[starknet::interface] | ||
trait IUnruggableMemecoinCamel<TState> { | ||
fn totalSupply(self: @TState) -> u256; | ||
fn balanceOf(self: @TState, account: ContractAddress) -> u256; | ||
fn transferFrom( | ||
ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256 | ||
) -> bool; | ||
} | ||
|
||
#[starknet::interface] | ||
trait IUnruggableMemecoinSnake<TState> { | ||
fn total_supply(self: @TState) -> u256; | ||
fn balance_of(self: @TState, account: ContractAddress) -> u256; | ||
fn allowance(self: @TState, owner: ContractAddress, spender: ContractAddress) -> u256; | ||
fn transfer(ref self: TState, recipient: ContractAddress, amount: u256) -> bool; | ||
fn transfer_from( | ||
ref self: TState, sender: ContractAddress, recipient: ContractAddress, amount: u256 | ||
) -> bool; | ||
fn approve(ref self: TState, spender: ContractAddress, amount: u256) -> bool; | ||
} | ||
|
||
#[starknet::interface] | ||
trait IUnruggableAdditional<TState> { | ||
fn launch_memecoin(ref self: TState); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.