Skip to content

Commit

Permalink
add token again
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Jul 24, 2024
1 parent 194035a commit 5207ed7
Show file tree
Hide file tree
Showing 116 changed files with 10,757 additions and 262 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
use dojo::test_utils::spawn_test_world;

use token::components::introspection::src5::{src_5_model, SRC5Model, ISRC5, ISRC5_ID};
use token::components::introspection::src5::src5_component::{InternalImpl};
use token::components::tests::mocks::src5_mock::SRC5Mock;
use origami_token::components::introspection::src5::{src_5_model, SRC5Model, ISRC5, ISRC5_ID};
use origami_token::components::introspection::src5::src5_component::{InternalImpl};
use origami_token::components::tests::mocks::src5_mock::SRC5Mock;
use starknet::storage::{StorageMemberAccessTrait};
use token::tests::constants::{OTHER_ID};
use origami_token::tests::constants::{OTHER_ID};


fn STATE() -> (IWorldDispatcher, SRC5Mock::ContractState) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[dojo::contract]
mod erc20_allowance_mock {
use token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use origami_token::components::token::erc20::erc20_allowance::erc20_allowance_component;

component!(
path: erc20_allowance_component, storage: erc20_allowance, event: ERC20AllowanceEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ trait IERC20BalanceMockInit<TState> {
#[dojo::contract]
mod erc20_balance_mock {
use starknet::ContractAddress;
use token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use token::components::token::erc20::erc20_balance::erc20_balance_component;
use origami_token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use origami_token::components::token::erc20::erc20_balance::erc20_balance_component;

component!(
path: erc20_allowance_component, storage: erc20_allowance, event: ERC20AllowanceEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ mod erc20_bridgeable_mock {
use starknet::ContractAddress;
use starknet::{get_caller_address, get_contract_address};

use token::components::security::initializable::initializable_component;

use token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use token::components::token::erc20::erc20_balance::erc20_balance_component;
use token::components::token::erc20::erc20_metadata::erc20_metadata_component;
use token::components::token::erc20::erc20_mintable::erc20_mintable_component;
use token::components::token::erc20::erc20_burnable::erc20_burnable_component;
use token::components::token::erc20::erc20_bridgeable::erc20_bridgeable_component;
use origami_token::components::security::initializable::initializable_component;

use origami_token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use origami_token::components::token::erc20::erc20_balance::erc20_balance_component;
use origami_token::components::token::erc20::erc20_metadata::erc20_metadata_component;
use origami_token::components::token::erc20::erc20_mintable::erc20_mintable_component;
use origami_token::components::token::erc20::erc20_burnable::erc20_burnable_component;
use origami_token::components::token::erc20::erc20_bridgeable::erc20_bridgeable_component;

component!(path: initializable_component, storage: initializable, event: InitializableEvent);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[dojo::contract]
mod erc20_metadata_mock {
use token::components::token::erc20::erc20_metadata::erc20_metadata_component;
use origami_token::components::token::erc20::erc20_metadata::erc20_metadata_component;

component!(path: erc20_metadata_component, storage: erc20_metadata, event: ERC20MetadataEvent);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#[dojo::contract]
mod erc20_mintable_burnable_mock {
use token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use token::components::token::erc20::erc20_balance::erc20_balance_component;
use token::components::token::erc20::erc20_metadata::erc20_metadata_component;
use token::components::token::erc20::erc20_mintable::erc20_mintable_component;
use token::components::token::erc20::erc20_burnable::erc20_burnable_component;
use origami_token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use origami_token::components::token::erc20::erc20_balance::erc20_balance_component;
use origami_token::components::token::erc20::erc20_metadata::erc20_metadata_component;
use origami_token::components::token::erc20::erc20_mintable::erc20_mintable_component;
use origami_token::components::token::erc20::erc20_burnable::erc20_burnable_component;

component!(
path: erc20_allowance_component, storage: erc20_allowance, event: ERC20AllowanceEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[dojo::contract]
mod erc721_approval_mock {
use token::components::token::erc721::erc721_approval::erc721_approval_component;
use token::components::token::erc721::erc721_owner::erc721_owner_component;
use origami_token::components::token::erc721::erc721_approval::erc721_approval_component;
use origami_token::components::token::erc721::erc721_owner::erc721_owner_component;

component!(
path: erc721_approval_component, storage: erc721_approval, event: ERC721ApprovalEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ trait IERC721BalanceMockInit<TState> {
#[dojo::contract]
mod erc721_balance_mock {
use starknet::ContractAddress;
use token::components::token::erc721::erc721_approval::erc721_approval_component;
use token::components::token::erc721::erc721_balance::erc721_balance_component;
use token::components::token::erc721::erc721_mintable::erc721_mintable_component;
use token::components::token::erc721::erc721_owner::erc721_owner_component;
use origami_token::components::token::erc721::erc721_approval::erc721_approval_component;
use origami_token::components::token::erc721::erc721_balance::erc721_balance_component;
use origami_token::components::token::erc721::erc721_mintable::erc721_mintable_component;
use origami_token::components::token::erc721::erc721_owner::erc721_owner_component;

component!(
path: erc721_approval_component, storage: erc721_approval, event: ERC721ApprovalEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ trait IERC721EnumerableMock<TState> {
mod erc721_enumerable_mock {
use starknet::ContractAddress;

use token::components::token::erc721::erc721_approval::erc721_approval_component;
use token::components::token::erc721::erc721_balance::erc721_balance_component;
use token::components::token::erc721::erc721_enumerable::erc721_enumerable_component;
use token::components::token::erc721::erc721_owner::erc721_owner_component;
use origami_token::components::token::erc721::erc721_approval::erc721_approval_component;
use origami_token::components::token::erc721::erc721_balance::erc721_balance_component;
use origami_token::components::token::erc721::erc721_enumerable::erc721_enumerable_component;
use origami_token::components::token::erc721::erc721_owner::erc721_owner_component;

component!(
path: erc721_approval_component, storage: erc721_approval, event: ERC721ApprovalEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#[dojo::contract]
mod erc721_metadata_mock {
use token::components::token::erc721::erc721_approval::erc721_approval_component;
use token::components::token::erc721::erc721_balance::erc721_balance_component;
use token::components::token::erc721::erc721_metadata::erc721_metadata_component;
use token::components::token::erc721::erc721_mintable::erc721_mintable_component;
use token::components::token::erc721::erc721_owner::erc721_owner_component;
use origami_token::components::token::erc721::erc721_approval::erc721_approval_component;
use origami_token::components::token::erc721::erc721_balance::erc721_balance_component;
use origami_token::components::token::erc721::erc721_metadata::erc721_metadata_component;
use origami_token::components::token::erc721::erc721_mintable::erc721_mintable_component;
use origami_token::components::token::erc721::erc721_owner::erc721_owner_component;

component!(
path: erc721_approval_component, storage: erc721_approval, event: ERC721ApprovalEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#[dojo::contract]
mod erc721_mintable_burnable_mock {
use token::components::token::erc721::erc721_approval::erc721_approval_component;
use token::components::token::erc721::erc721_balance::erc721_balance_component;
use token::components::token::erc721::erc721_metadata::erc721_metadata_component;
use token::components::token::erc721::erc721_mintable::erc721_mintable_component;
use token::components::token::erc721::erc721_burnable::erc721_burnable_component;
use token::components::token::erc721::erc721_owner::erc721_owner_component;
use origami_token::components::token::erc721::erc721_approval::erc721_approval_component;
use origami_token::components::token::erc721::erc721_balance::erc721_balance_component;
use origami_token::components::token::erc721::erc721_metadata::erc721_metadata_component;
use origami_token::components::token::erc721::erc721_mintable::erc721_mintable_component;
use origami_token::components::token::erc721::erc721_burnable::erc721_burnable_component;
use origami_token::components::token::erc721::erc721_owner::erc721_owner_component;

component!(
path: erc721_approval_component, storage: erc721_approval, event: ERC721ApprovalEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ trait IERC721ReceiverMockInit<TState> {

#[dojo::contract]
mod erc721_receiver_mock {
use token::components::introspection::src5::src5_component;
use token::components::token::erc721::erc721_receiver::erc721_receiver_component;
use origami_token::components::introspection::src5::src5_component;
use origami_token::components::token::erc721::erc721_receiver::erc721_receiver_component;

component!(
path: erc721_receiver_component, storage: erc721_receiver, event: ERC721ReceiverEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[dojo::contract]
mod InitializableMock {
use token::components::security::initializable::initializable_component;
use origami_token::components::security::initializable::initializable_component;

component!(path: initializable_component, storage: initializable, event: InitializableEvent);

Expand Down
2 changes: 1 addition & 1 deletion crates/token/src/components/tests/mocks/src5_mock.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[dojo::contract]
mod SRC5Mock {
use token::components::introspection::src5::src5_component;
use origami_token::components::introspection::src5::src5_component;

component!(path: src5_component, storage: src5, event: SRC5Event);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
use dojo::test_utils::spawn_test_world;

use token::components::security::initializable::{initializable_model, InitializableModel};
use token::components::security::initializable::initializable_component::{
use origami_token::components::security::initializable::{initializable_model, InitializableModel};
use origami_token::components::security::initializable::initializable_component::{
InitializableImpl, InternalImpl
};
use token::components::tests::mocks::initializable_mock::InitializableMock;
use origami_token::components::tests::mocks::initializable_mock::InitializableMock;
use starknet::storage::{StorageMemberAccessTrait};

fn STATE() -> (IWorldDispatcher, InitializableMock::ContractState) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use token::components::token::erc20::erc20_allowance::IERC20Allowance;
use origami_token::components::token::erc20::erc20_allowance::IERC20Allowance;
use starknet::testing;
use starknet::ContractAddress;
use integer::BoundedInt;
use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
use dojo::test_utils::spawn_test_world;
use token::tests::constants::{ZERO, OWNER, SPENDER, RECIPIENT, VALUE, SUPPLY};
use token::tests::utils;
use origami_token::tests::constants::{ZERO, OWNER, SPENDER, RECIPIENT, VALUE, SUPPLY};
use origami_token::tests::utils;

use token::components::token::erc20::erc20_allowance::{
use origami_token::components::token::erc20::erc20_allowance::{
erc_20_allowance_model, ERC20AllowanceModel,
};
use token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use token::components::token::erc20::erc20_allowance::erc20_allowance_component::{
use origami_token::components::token::erc20::erc20_allowance::erc20_allowance_component;
use origami_token::components::token::erc20::erc20_allowance::erc20_allowance_component::{
Approval, ERC20AllowanceImpl, InternalImpl
};
use token::components::tests::mocks::erc20::erc20_allowance_mock::erc20_allowance_mock;
use origami_token::components::tests::mocks::erc20::erc20_allowance_mock::erc20_allowance_mock;
use starknet::storage::{StorageMemberAccessTrait};
use debug::PrintTrait;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ use integer::BoundedInt;
use starknet::ContractAddress;
use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
use dojo::test_utils::spawn_test_world;
use token::tests::constants::{ADMIN, ZERO, OWNER, OTHER, SPENDER, RECIPIENT, VALUE, SUPPLY};
use origami_token::tests::constants::{ADMIN, ZERO, OWNER, OTHER, SPENDER, RECIPIENT, VALUE, SUPPLY};

use token::tests::utils;
use origami_token::tests::utils;

use token::components::token::erc20::erc20_allowance::{
use origami_token::components::token::erc20::erc20_allowance::{
erc_20_allowance_model, ERC20AllowanceModel,
};
use token::components::token::erc20::erc20_allowance::erc20_allowance_component::{
use origami_token::components::token::erc20::erc20_allowance::erc20_allowance_component::{
Approval, ERC20AllowanceImpl, InternalImpl as ERC20AllowanceInternalImpl
};
use token::components::token::erc20::erc20_balance::{erc_20_balance_model, ERC20BalanceModel,};
use token::components::token::erc20::erc20_balance::erc20_balance_component::{
use origami_token::components::token::erc20::erc20_balance::{erc_20_balance_model, ERC20BalanceModel,};
use origami_token::components::token::erc20::erc20_balance::erc20_balance_component::{
Transfer, ERC20BalanceImpl, ERC20BalanceCamelImpl, InternalImpl as ERC20BalanceInternalImpl
};
use token::components::tests::mocks::erc20::erc20_balance_mock::{
use origami_token::components::tests::mocks::erc20::erc20_balance_mock::{
erc20_balance_mock, IERC20BalanceMockDispatcher, IERC20BalanceMockDispatcherTrait
};
use starknet::storage::{StorageMemberAccessTrait};
use token::components::tests::token::erc20::test_erc20_allowance::{
use origami_token::components::tests::token::erc20::test_erc20_allowance::{
assert_event_approval, assert_only_event_approval
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ use starknet::ContractAddress;
use integer::BoundedInt;
use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
use dojo::test_utils::spawn_test_world;
use token::tests::constants::{ZERO, OWNER, SPENDER, RECIPIENT, BRIDGE, DECIMALS, SUPPLY, VALUE};
use origami_token::tests::constants::{ZERO, OWNER, SPENDER, RECIPIENT, BRIDGE, DECIMALS, SUPPLY, VALUE};

use token::components::token::erc20::erc20_metadata::{erc_20_metadata_model, ERC20MetadataModel,};
use token::components::token::erc20::erc20_metadata::erc20_metadata_component::{
use origami_token::components::token::erc20::erc20_metadata::{erc_20_metadata_model, ERC20MetadataModel,};
use origami_token::components::token::erc20::erc20_metadata::erc20_metadata_component::{
ERC20MetadataImpl, ERC20MetadataTotalSupplyImpl, InternalImpl as ERC20MetadataInternalImpl
};

use token::components::token::erc20::erc20_balance::{erc_20_balance_model, ERC20BalanceModel,};
use token::components::token::erc20::erc20_balance::erc20_balance_component::{
use origami_token::components::token::erc20::erc20_balance::{erc_20_balance_model, ERC20BalanceModel,};
use origami_token::components::token::erc20::erc20_balance::erc20_balance_component::{
ERC20BalanceImpl, InternalImpl as ERC20BalanceInternalImpl
};

use token::components::token::erc20::erc20_mintable::erc20_mintable_component::InternalImpl as ERC20MintableInternalImpl;
use token::components::token::erc20::erc20_burnable::erc20_burnable_component::InternalImpl as ERC20BurnableInternalImpl;
use origami_token::components::token::erc20::erc20_mintable::erc20_mintable_component::InternalImpl as ERC20MintableInternalImpl;
use origami_token::components::token::erc20::erc20_burnable::erc20_burnable_component::InternalImpl as ERC20BurnableInternalImpl;

use token::components::token::erc20::erc20_bridgeable::{
use origami_token::components::token::erc20::erc20_bridgeable::{
erc_20_bridgeable_model, ERC20BridgeableModel
};
use token::components::token::erc20::erc20_bridgeable::erc20_bridgeable_component::{
use origami_token::components::token::erc20::erc20_bridgeable::erc20_bridgeable_component::{
ERC20BridgeableImpl
};

use token::components::tests::mocks::erc20::erc20_bridgeable_mock::erc20_bridgeable_mock;
use token::components::tests::mocks::erc20::erc20_bridgeable_mock::erc20_bridgeable_mock::{
use origami_token::components::tests::mocks::erc20::erc20_bridgeable_mock::erc20_bridgeable_mock;
use origami_token::components::tests::mocks::erc20::erc20_bridgeable_mock::erc20_bridgeable_mock::{
ERC20InitializerImpl
};
use starknet::storage::{StorageMemberAccessTrait};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use integer::BoundedInt;
use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
use dojo::test_utils::spawn_test_world;
use token::tests::constants::{DECIMALS};
use origami_token::tests::constants::{DECIMALS};

use token::components::token::erc20::erc20_metadata::{erc_20_metadata_model, ERC20MetadataModel,};
use token::components::token::erc20::erc20_metadata::erc20_metadata_component::{
use origami_token::components::token::erc20::erc20_metadata::{erc_20_metadata_model, ERC20MetadataModel,};
use origami_token::components::token::erc20::erc20_metadata::erc20_metadata_component::{
ERC20MetadataImpl, ERC20MetadataTotalSupplyImpl, ERC20MetadataTotalSupplyCamelImpl, InternalImpl
};
use token::components::tests::mocks::erc20::erc20_metadata_mock::erc20_metadata_mock;
use origami_token::components::tests::mocks::erc20::erc20_metadata_mock::erc20_metadata_mock;
use starknet::storage::{StorageMemberAccessTrait};

fn STATE() -> (IWorldDispatcher, erc20_metadata_mock::ContractState) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
use integer::BoundedInt;
use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait};
use dojo::test_utils::spawn_test_world;
use token::tests::constants::{ZERO, OWNER, SPENDER, RECIPIENT, VALUE};
use origami_token::tests::constants::{ZERO, OWNER, SPENDER, RECIPIENT, VALUE};

use token::components::token::erc20::erc20_metadata::{erc_20_metadata_model, ERC20MetadataModel,};
use token::components::token::erc20::erc20_metadata::erc20_metadata_component::{
use origami_token::components::token::erc20::erc20_metadata::{erc_20_metadata_model, ERC20MetadataModel,};
use origami_token::components::token::erc20::erc20_metadata::erc20_metadata_component::{
ERC20MetadataImpl, ERC20MetadataTotalSupplyImpl, InternalImpl as ERC20MetadataInternalImpl
};

use token::components::token::erc20::erc20_balance::{erc_20_balance_model, ERC20BalanceModel,};
use token::components::token::erc20::erc20_balance::erc20_balance_component::{
use origami_token::components::token::erc20::erc20_balance::{erc_20_balance_model, ERC20BalanceModel,};
use origami_token::components::token::erc20::erc20_balance::erc20_balance_component::{
ERC20BalanceImpl, InternalImpl as ERC20BalanceInternalImpl
};

use token::components::token::erc20::erc20_mintable::erc20_mintable_component::InternalImpl as ERC20MintableInternalImpl;
use token::components::token::erc20::erc20_burnable::erc20_burnable_component::InternalImpl as ERC20BurnableInternalImpl;
use origami_token::components::token::erc20::erc20_mintable::erc20_mintable_component::InternalImpl as ERC20MintableInternalImpl;
use origami_token::components::token::erc20::erc20_burnable::erc20_burnable_component::InternalImpl as ERC20BurnableInternalImpl;

use token::components::tests::mocks::erc20::erc20_mintable_burnable_mock::erc20_mintable_burnable_mock;
use origami_token::components::tests::mocks::erc20::erc20_mintable_burnable_mock::erc20_mintable_burnable_mock;
use starknet::storage::{StorageMemberAccessTrait};

fn STATE() -> (IWorldDispatcher, erc20_mintable_burnable_mock::ContractState) {
Expand Down
Loading

0 comments on commit 5207ed7

Please sign in to comment.