-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rename into token - Add token into workspace
- Loading branch information
Showing
25 changed files
with
212 additions
and
188 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
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,8 +1,8 @@ | ||
[workspace] | ||
members = ["crates", "examples/*"] | ||
members = ["crates", "examples/*", "token"] | ||
|
||
[workspace.package] | ||
version = "0.1.0" | ||
version = "0.0.0" | ||
description = "Community-maintained libraries for Cairo" | ||
homepage = "https://github.com/dojoengine/origami" | ||
authors = ["[email protected]"] | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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,8 @@ | ||
[package] | ||
name = "token" | ||
version = "0.0.0" | ||
description = "Implementations of ERC standards for the Dojo framework." | ||
homepage = "https://github.com/dojoengine/origami/tree/presets" | ||
|
||
[dependencies] | ||
dojo.workspace = true |
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
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
presets/src/erc1155/erc1155/models.cairo → token/src/erc1155/models.cairo
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,5 @@ | ||
// Starknet imports | ||
|
||
use starknet::ContractAddress; | ||
|
||
#[derive(Model, Copy, Drop, Serde)] | ||
|
22 changes: 11 additions & 11 deletions
22
presets/src/erc1155/tests.cairo → token/src/erc1155/tests.cairo
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
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,24 @@ | ||
use starknet::ContractAddress; | ||
|
||
#[starknet::interface] | ||
trait IERC20<TState> { | ||
fn name(self: @TState) -> felt252; | ||
fn symbol(self: @TState) -> felt252; | ||
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; | ||
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; | ||
} | ||
|
||
trait IERC20CamelOnly<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; | ||
} |
16 changes: 10 additions & 6 deletions
16
presets/src/erc20/models.cairo → token/src/erc20/models.cairo
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
18 changes: 9 additions & 9 deletions
18
presets/src/erc20/tests.cairo → token/src/erc20/tests.cairo
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.