diff --git a/src/accountV3/accountV3.cairo b/src/accountV3/accountV3.cairo index b1d8935..1675e14 100644 --- a/src/accountV3/accountV3.cairo +++ b/src/accountV3/accountV3.cairo @@ -127,14 +127,14 @@ pub mod AccountV3 { if (get_caller_address() == _token_contract && token_id == _token_id && tx_info.chain_id == _chain_id) { - panic!("Account: ownership cycle!"); + panic(array!['Account: ownership cycle!']); } return 0x3a0dff5f70d80458ad14ae37bb182a728e3c8cdda0402a5daa86620bdf910bc; } /// @notice retrieves deployment details of an account - fn get_context(self: @ContractState) -> (ContractAddress, felt252, felt252) { + fn context(self: @ContractState) -> (ContractAddress, felt252, felt252) { self.account._context() } } @@ -191,9 +191,9 @@ pub mod AccountV3 { /// @notice replaces the contract's class hash with `new_class_hash`. /// Emits an `Upgraded` event. fn upgrade(ref self: ContractState, new_class_hash: ClassHash) { - // validate signer + // validate signer is owner let caller = get_caller_address(); - assert(self.is_valid_signer(caller), Errors::UNAUTHORIZED); + assert(self.signatory._base_signer_validation(caller), Errors::UNAUTHORIZED); // cannot make this call when the account is lock let (is_locked, _) = self.lockable.is_locked(); diff --git a/src/interfaces/IAccountV3.cairo b/src/interfaces/IAccountV3.cairo index 3b05530..3453271 100644 --- a/src/interfaces/IAccountV3.cairo +++ b/src/interfaces/IAccountV3.cairo @@ -12,5 +12,5 @@ pub trait IAccountV3 { token_id: u256, data: Span ) -> felt252; - fn get_context(self: @TContractState) -> (ContractAddress, felt252, felt252); + fn context(self: @TContractState) -> (ContractAddress, felt252, felt252); } diff --git a/src/interfaces/IERC721.cairo b/src/interfaces/IERC721.cairo index 27b095c..8f93aee 100644 --- a/src/interfaces/IERC721.cairo +++ b/src/interfaces/IERC721.cairo @@ -18,6 +18,7 @@ pub trait IERC721 { token_id: u256, data: Span ); + fn mint(ref self: TContractState, to: ContractAddress, token_id: u256); fn approve(ref self: TContractState, to: ContractAddress, token_id: u256); fn set_approval_for_all(ref self: TContractState, operator: ContractAddress, approved: bool); fn get_approved(self: @TContractState, token_id: u256) -> ContractAddress; diff --git a/src/test_helper/erc721_helper.cairo b/src/test_helper/erc721_helper.cairo index 3a19364..b957553 100644 --- a/src/test_helper/erc721_helper.cairo +++ b/src/test_helper/erc721_helper.cairo @@ -1,200 +1,50 @@ use starknet::ContractAddress; #[starknet::interface] -pub trait IERC721 { - fn balance_of(self: @TContractState, account: ContractAddress) -> u256; - fn ownerOf(self: @TContractState, token_id: u256) -> ContractAddress; - fn owner_of(self: @TContractState, token_id: u256) -> ContractAddress; - fn transfer_from( - ref self: TContractState, from: ContractAddress, to: ContractAddress, token_id: u256 - ); - fn approve(ref self: TContractState, to: ContractAddress, token_id: u256); - fn set_approval_for_all(ref self: TContractState, operator: ContractAddress, approved: bool); - fn get_approved(self: @TContractState, token_id: u256) -> ContractAddress; - fn is_approved_for_all( - self: @TContractState, owner: ContractAddress, operator: ContractAddress - ) -> bool; - // IERC721Metadata - fn name(self: @TContractState) -> felt252; - fn symbol(self: @TContractState) -> felt252; - fn token_uri(self: @TContractState, token_id: u256) -> felt252; - // Internal +trait IERC721 { fn mint(ref self: TContractState, to: ContractAddress, token_id: u256); } #[starknet::contract] pub mod ERC721 { - use starknet::storage::StorageMapWriteAccess; - use starknet::storage::StorageMapReadAccess; - use starknet::storage::StoragePointerReadAccess; - use starknet::storage::StoragePointerWriteAccess; + use openzeppelin::introspection::src5::SRC5Component; + use openzeppelin::token::erc721::{ERC721Component, ERC721HooksEmptyImpl}; use starknet::ContractAddress; - use starknet::get_caller_address; - use core::num::traits::zero::Zero; - use starknet::{storage::Map}; + + component!(path: ERC721Component, storage: erc721, event: ERC721Event); + component!(path: SRC5Component, storage: src5, event: SRC5Event); + + // ERC721 Mixin + #[abi(embed_v0)] + impl ERC721MixinImpl = ERC721Component::ERC721MixinImpl; + impl ERC721InternalImpl = ERC721Component::InternalImpl; #[storage] struct Storage { - name: felt252, - symbol: felt252, - owners: Map::, - balances: Map::, - token_approvals: Map::, - operator_approvals: Map::<(ContractAddress, ContractAddress), bool>, - token_uri: Map, + #[substorage(v0)] + erc721: ERC721Component::Storage, + #[substorage(v0)] + src5: SRC5Component::Storage } #[event] #[derive(Drop, starknet::Event)] enum Event { - Approval: Approval, - Transfer: Transfer, - ApprovalForAll: ApprovalForAll - } - - #[derive(Drop, starknet::Event)] - struct Approval { - owner: ContractAddress, - to: ContractAddress, - token_id: u256 - } - - #[derive(Drop, starknet::Event)] - struct Transfer { - from: ContractAddress, - to: ContractAddress, - token_id: u256 - } - - #[derive(Drop, starknet::Event)] - struct ApprovalForAll { - owner: ContractAddress, - operator: ContractAddress, - approved: bool + #[flat] + ERC721Event: ERC721Component::Event, + #[flat] + SRC5Event: SRC5Component::Event } #[constructor] - fn constructor(ref self: ContractState, _name: felt252, _symbol: felt252) { - self.name.write(_name); - self.symbol.write(_symbol); + fn constructor(ref self: ContractState, name: felt252, symbol: felt252) { + self.erc721.initializer("tokenbound", "TBA", "https://api.example.com/v1/"); } #[abi(embed_v0)] impl ERC721Impl of super::IERC721 { - fn name(self: @ContractState) -> felt252 { - self.name.read() - } - - fn symbol(self: @ContractState) -> felt252 { - self.symbol.read() - } - - fn ownerOf(self: @ContractState, token_id: u256) -> ContractAddress { - let owner = self.owners.read(token_id); - assert(owner.is_non_zero(), 'ERC721: invalid token ID'); - owner - } - - fn owner_of(self: @ContractState, token_id: u256) -> ContractAddress { - let owner = self.owners.read(token_id); - assert(owner.is_non_zero(), 'ERC721: invalid token ID'); - owner - } - - fn token_uri(self: @ContractState, token_id: u256) -> felt252 { - self.token_uri.read(token_id) - } - - fn balance_of(self: @ContractState, account: ContractAddress) -> u256 { - assert(account.is_non_zero(), 'ERC721: address zero'); - self.balances.read(account) - } - - fn get_approved(self: @ContractState, token_id: u256) -> ContractAddress { - assert(self._exists(token_id), 'ERC721: invalid token ID'); - self.token_approvals.read(token_id) - } - - fn is_approved_for_all( - self: @ContractState, owner: ContractAddress, operator: ContractAddress - ) -> bool { - self.operator_approvals.read((owner, operator)) - } - - fn approve(ref self: ContractState, to: ContractAddress, token_id: u256) { - let owner = self.ownerOf(token_id); - assert(to != owner, 'Approval to current owner'); - assert( - get_caller_address() == owner - || self.is_approved_for_all(owner, get_caller_address()), - 'Not token owner' - ); - self.token_approvals.write(token_id, to); - self.emit(Approval { owner: self.ownerOf(token_id), to: to, token_id: token_id }); - } - - fn set_approval_for_all( - ref self: ContractState, operator: ContractAddress, approved: bool - ) { - let owner = get_caller_address(); - assert(owner != operator, 'ERC721: approve to caller'); - self.operator_approvals.write((owner, operator), approved); - self.emit(ApprovalForAll { owner: owner, operator: operator, approved: approved }); - } - - fn transfer_from( - ref self: ContractState, from: ContractAddress, to: ContractAddress, token_id: u256 - ) { - assert( - self._is_approved_or_owner(get_caller_address(), token_id), - 'neither owner nor approved' - ); - self._transfer(from, to, token_id); - } - fn mint(ref self: ContractState, to: ContractAddress, token_id: u256) { - assert(to.is_non_zero(), 'to is zero address'); - - let receiver_balance = self.balances.read(to); - self.balances.write(to, receiver_balance + 1.into()); - self.owners.write(token_id, to); - - self.emit(Transfer { from: Zero::zero(), to: to, token_id: token_id }); - } - } - - #[generate_trait] - impl ERC721HelperImpl of ERC721HelperTrait { - fn _exists(self: @ContractState, token_id: u256) -> bool { - self.ownerOf(token_id).is_non_zero() - } - - fn _is_approved_or_owner( - self: @ContractState, spender: ContractAddress, token_id: u256 - ) -> bool { - let owner = self.owners.read(token_id); - spender == owner - || self.is_approved_for_all(owner, spender) - || self.get_approved(token_id) == spender - } - - fn _set_token_uri(ref self: ContractState, token_id: u256, token_uri: felt252) { - assert(self._exists(token_id), 'ERC721: invalid token ID'); - self.token_uri.write(token_id, token_uri) - } - - fn _transfer( - ref self: ContractState, from: ContractAddress, to: ContractAddress, token_id: u256 - ) { - assert(from == self.ownerOf(token_id), 'ERC721: Caller is not owner'); - assert(to.is_non_zero(), 'ERC721: transfer to 0 address'); - - self.token_approvals.write(token_id, Zero::zero()); - self.balances.write(from, self.balances.read(from) - 1.into()); - self.balances.write(to, self.balances.read(to) + 1.into()); - self.owners.write(token_id, to); - - self.emit(Transfer { from: from, to: to, token_id: token_id }); + self.erc721.mint(to, token_id); } } } diff --git a/tests/test_account_component.cairo b/tests/test_account_component.cairo index 817db22..df015d8 100644 --- a/tests/test_account_component.cairo +++ b/tests/test_account_component.cairo @@ -12,20 +12,19 @@ use core::hash::HashStateTrait; use core::pedersen::PedersenTrait; use token_bound_accounts::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryDispatcher}; -use token_bound_accounts::interfaces::IAccount::{ - IAccountDispatcher, IAccountDispatcherTrait, IAccountSafeDispatcher, IAccountSafeDispatcherTrait -}; +use token_bound_accounts::interfaces::IAccount::{IAccountDispatcher, IAccountDispatcherTrait}; use token_bound_accounts::interfaces::IExecutable::{ IExecutableDispatcher, IExecutableDispatcherTrait }; +use token_bound_accounts::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait}; use token_bound_accounts::components::presets::account_preset::AccountPreset; use token_bound_accounts::components::account::account::AccountComponent; use token_bound_accounts::registry::registry::Registry; use token_bound_accounts::test_helper::{ hello_starknet::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, HelloStarknet}, - erc721_helper::{IERC721Dispatcher, IERC721DispatcherTrait, ERC721}, - simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount} + simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount}, + erc721_helper::ERC721 }; const ACCOUNT: felt252 = 1234; diff --git a/tests/test_account_v3.cairo b/tests/test_account_v3.cairo new file mode 100644 index 0000000..ee306b9 --- /dev/null +++ b/tests/test_account_v3.cairo @@ -0,0 +1,126 @@ +use starknet::{ContractAddress, account::Call}; +use snforge_std::{ + declare, start_cheat_caller_address, stop_cheat_caller_address, + start_cheat_account_contract_address, stop_cheat_account_contract_address, + start_cheat_transaction_hash, start_cheat_nonce, spy_events, EventSpyAssertionsTrait, + ContractClassTrait, ContractClass, start_cheat_chain_id, stop_cheat_chain_id, + start_cheat_chain_id_global, stop_cheat_chain_id_global +}; +use core::hash::HashStateTrait; +use core::pedersen::PedersenTrait; + +use token_bound_accounts::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryDispatcher}; +use token_bound_accounts::interfaces::IERC721::{ + IERC721Dispatcher, IERC721DispatcherTrait, IERC721SafeDispatcher, IERC721SafeDispatcherTrait +}; +use token_bound_accounts::interfaces::IAccountV3::{IAccountV3Dispatcher, IAccountV3DispatcherTrait}; +use token_bound_accounts::test_helper::{ + hello_starknet::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, HelloStarknet}, + simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount}, + erc721_helper::ERC721 +}; + + +const ACCOUNT: felt252 = 1234; +const ACCOUNT2: felt252 = 5729; +const SALT: felt252 = 123; + + +// ************************************************************************* +// SETUP +// ************************************************************************* +fn __setup__() -> (ContractAddress, ContractAddress, ContractAddress, ContractAddress, felt252) { + // deploy erc721 helper contract + let erc721_contract = declare("ERC721").unwrap(); + let mut erc721_constructor_calldata = array!['tokenbound', 'TBA']; + let (erc721_contract_address, _) = erc721_contract + .deploy(@erc721_constructor_calldata) + .unwrap(); + + // deploy recipient contract + let recipient_contract_class = declare("SimpleAccount").unwrap(); + let (recipient, _) = recipient_contract_class + .deploy( + @array![883045738439352841478194533192765345509759306772397516907181243450667673002] + ) + .unwrap(); + + // mint new tokens + let dispatcher = IERC721Dispatcher { contract_address: erc721_contract_address }; + dispatcher.mint(recipient, 1.try_into().unwrap()); + dispatcher.mint(recipient, 2.try_into().unwrap()); + + // deploy registry contract + let registry_contract = declare("Registry").unwrap(); + let (registry_contract_address, _) = registry_contract.deploy(@array![]).unwrap(); + + // deploy account V3 contract + let account_v3_contract_class = declare("AccountV3").unwrap(); + let mut acct_constructor_calldata = array![ + erc721_contract_address.try_into().unwrap(), + 1, + 0, + registry_contract_address.try_into().unwrap(), + account_v3_contract_class.class_hash.into(), + 20 + ]; + let (account_v3_contract_address, _) = account_v3_contract_class + .deploy(@acct_constructor_calldata) + .unwrap(); + + ( + erc721_contract_address, + recipient, + account_v3_contract_address, + registry_contract_address, + account_v3_contract_class.class_hash.into() + ) +} + +#[test] +fn test_on_erc721_received_with_safe_transfer() { + let (erc721_contract_address, recipient, account_v3_contract_address, _, _) = __setup__(); + let erc721_dispatcher = IERC721Dispatcher { contract_address: erc721_contract_address }; + + start_cheat_caller_address(erc721_contract_address, recipient); + start_cheat_chain_id_global('SN_SEPOLIA'); + + // call safe transfer + erc721_dispatcher + .safe_transfer_from(recipient, account_v3_contract_address, 2, array![].span()); + + // check safe transfer was successful + let owner = erc721_dispatcher.owner_of(2); + assert(owner == account_v3_contract_address, 'safe transfer failed!'); +} + +#[test] +#[feature("safe dispatcher")] +fn test_safe_transfer_fails_if_owner_cycle_detected() { + let (erc721_contract_address, recipient, account_v3_contract_address, _, _) = __setup__(); + let erc721_dispatcher = IERC721SafeDispatcher { contract_address: erc721_contract_address }; + + start_cheat_caller_address(erc721_contract_address, recipient); + start_cheat_chain_id_global('SN_SEPOLIA'); + + // call safe transfer with token ID that owns the TBA + match erc721_dispatcher + .safe_transfer_from(recipient, account_v3_contract_address, 1, array![].span()) { + Result::Ok(_) => panic!("Expected safe transfer to panic!"), + Result::Err(panic_data) => { + assert(*panic_data.at(0) == 'Account: ownership cycle!', *panic_data.at(0)) + } + }; +} + +#[test] +fn test_context() { + let (_, _, account_v3_contract_address, registry, implementation) = __setup__(); + let dispatcher = IAccountV3Dispatcher { contract_address: account_v3_contract_address }; + + // get context and check it's correct + let (_registry, _implementation, _salt) = dispatcher.context(); + assert(_registry == registry, 'invalid registry'); + assert(_implementation == implementation, 'invalid implementation'); + assert(_salt == 20, 'invalid salt'); +} diff --git a/tests/test_lockable_component.cairo b/tests/test_lockable_component.cairo index cf2e4f0..2e01289 100644 --- a/tests/test_lockable_component.cairo +++ b/tests/test_lockable_component.cairo @@ -11,26 +11,22 @@ use core::hash::HashStateTrait; use core::pedersen::PedersenTrait; use token_bound_accounts::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryDispatcher}; -use token_bound_accounts::interfaces::IAccount::{ - IAccountDispatcher, IAccountDispatcherTrait, IAccountSafeDispatcher, IAccountSafeDispatcherTrait -}; +use token_bound_accounts::interfaces::IAccount::{IAccountDispatcher, IAccountDispatcherTrait}; use token_bound_accounts::interfaces::ILockable::{ILockableDispatcher, ILockableDispatcherTrait}; - use token_bound_accounts::interfaces::IExecutable::{ IExecutableDispatcher, IExecutableDispatcherTrait }; use token_bound_accounts::interfaces::IUpgradeable::{ IUpgradeableDispatcher, IUpgradeableDispatcherTrait }; +use token_bound_accounts::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait}; use token_bound_accounts::components::presets::account_preset::AccountPreset; -use token_bound_accounts::components::account::account::AccountComponent; use token_bound_accounts::components::lockable::lockable::LockableComponent; -use token_bound_accounts::registry::registry::Registry; use token_bound_accounts::test_helper::{ hello_starknet::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, HelloStarknet}, - erc721_helper::{IERC721Dispatcher, IERC721DispatcherTrait, ERC721}, - simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount} + simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount}, + erc721_helper::ERC721 }; const ACCOUNT2: felt252 = 5729; diff --git a/tests/test_permissionable_component.cairo b/tests/test_permissionable_component.cairo index a855449..6b8f421 100644 --- a/tests/test_permissionable_component.cairo +++ b/tests/test_permissionable_component.cairo @@ -11,28 +11,21 @@ use core::hash::HashStateTrait; use core::pedersen::PedersenTrait; use token_bound_accounts::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryDispatcher}; -use token_bound_accounts::interfaces::IAccount::{ - IAccountDispatcher, IAccountDispatcherTrait, IAccountSafeDispatcher, IAccountSafeDispatcherTrait -}; +use token_bound_accounts::interfaces::IAccount::{IAccountDispatcher, IAccountDispatcherTrait}; use token_bound_accounts::interfaces::IPermissionable::{ IPermissionableDispatcher, IPermissionableDispatcherTrait }; use token_bound_accounts::interfaces::IExecutable::{ IExecutableDispatcher, IExecutableDispatcherTrait }; -use token_bound_accounts::interfaces::IUpgradeable::{ - IUpgradeableDispatcher, IUpgradeableDispatcherTrait -}; +use token_bound_accounts::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait}; use token_bound_accounts::components::presets::account_preset::AccountPreset; -use token_bound_accounts::components::account::account::AccountComponent; -use token_bound_accounts::registry::registry::Registry; - use token_bound_accounts::components::permissionable::permissionable::PermissionableComponent; use token_bound_accounts::test_helper::{ hello_starknet::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, HelloStarknet}, - erc721_helper::{IERC721Dispatcher, IERC721DispatcherTrait, ERC721}, - simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount} + simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount}, + erc721_helper::ERC721 }; const ACCOUNT1: felt252 = 5729; diff --git a/tests/test_registry.cairo b/tests/test_registry.cairo index be5bc05..3a8d04c 100644 --- a/tests/test_registry.cairo +++ b/tests/test_registry.cairo @@ -8,17 +8,15 @@ use snforge_std::{ }; use token_bound_accounts::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryDispatcher}; -use token_bound_accounts::registry::registry::Registry; - -use token_bound_accounts::interfaces::IUpgradeable::{ - IUpgradeableDispatcher, IUpgradeableDispatcherTrait -}; - use token_bound_accounts::interfaces::IAccount::{IAccountDispatcher, IAccountDispatcherTrait}; +use token_bound_accounts::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait}; use token_bound_accounts::components::presets::account_preset::AccountPreset; +use token_bound_accounts::registry::registry::Registry; -use token_bound_accounts::test_helper::erc721_helper::{ - IERC721Dispatcher, IERC721DispatcherTrait, ERC721 +use token_bound_accounts::test_helper::{ + hello_starknet::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, HelloStarknet}, + simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount}, + erc721_helper::ERC721 }; const ACCOUNT: felt252 = 1234; diff --git a/tests/test_signatory_component.cairo b/tests/test_signatory_component.cairo index 56bf36d..03448d5 100644 --- a/tests/test_signatory_component.cairo +++ b/tests/test_signatory_component.cairo @@ -11,30 +11,19 @@ use core::hash::HashStateTrait; use core::pedersen::PedersenTrait; use token_bound_accounts::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryDispatcher}; -use token_bound_accounts::interfaces::IAccount::{ - IAccountDispatcher, IAccountDispatcherTrait, IAccountSafeDispatcher, IAccountSafeDispatcherTrait -}; +use token_bound_accounts::interfaces::IAccount::{IAccountDispatcher, IAccountDispatcherTrait}; use token_bound_accounts::interfaces::IPermissionable::{ IPermissionableDispatcher, IPermissionableDispatcherTrait }; use token_bound_accounts::interfaces::ISignatory::{ISignatoryDispatcher, ISignatoryDispatcherTrait}; -use token_bound_accounts::interfaces::IExecutable::{ - IExecutableDispatcher, IExecutableDispatcherTrait -}; -use token_bound_accounts::interfaces::IUpgradeable::{ - IUpgradeableDispatcher, IUpgradeableDispatcherTrait -}; +use token_bound_accounts::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait}; use token_bound_accounts::components::presets::account_preset::AccountPreset; -use token_bound_accounts::components::account::account::AccountComponent; -use token_bound_accounts::registry::registry::Registry; - use token_bound_accounts::components::signatory::signatory::SignatoryComponent; -use token_bound_accounts::components::permissionable::permissionable::PermissionableComponent; use token_bound_accounts::test_helper::{ hello_starknet::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, HelloStarknet}, - erc721_helper::{IERC721Dispatcher, IERC721DispatcherTrait, ERC721}, - simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount} + simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount}, + erc721_helper::ERC721 }; const ACCOUNT1: felt252 = 5729; diff --git a/tests/test_upgradeable.cairo b/tests/test_upgradeable.cairo index b2d54da..cfb0bdb 100644 --- a/tests/test_upgradeable.cairo +++ b/tests/test_upgradeable.cairo @@ -10,20 +10,19 @@ use core::hash::HashStateTrait; use core::pedersen::PedersenTrait; use token_bound_accounts::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryDispatcher}; -use token_bound_accounts::interfaces::IAccount::{ - IAccountDispatcher, IAccountDispatcherTrait, IAccountSafeDispatcher, IAccountSafeDispatcherTrait -}; +use token_bound_accounts::interfaces::IAccount::{IAccountDispatcher, IAccountDispatcherTrait}; use token_bound_accounts::interfaces::IUpgradeable::{ IUpgradeableDispatcher, IUpgradeableDispatcherTrait }; +use token_bound_accounts::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait}; use token_bound_accounts::components::presets::account_preset::AccountPreset; use token_bound_accounts::components::upgradeable::upgradeable::UpgradeableComponent; -use token_bound_accounts::registry::registry::Registry; use token_bound_accounts::test_helper::{ - erc721_helper::{IERC721Dispatcher, IERC721DispatcherTrait, ERC721}, + hello_starknet::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, HelloStarknet}, simple_account::{ISimpleAccountDispatcher, ISimpleAccountDispatcherTrait, SimpleAccount}, - account_upgrade::{IUpgradedAccountDispatcher, IUpgradedAccountDispatcherTrait, UpgradedAccount} + account_upgrade::{IUpgradedAccountDispatcher, IUpgradedAccountDispatcherTrait, UpgradedAccount}, + erc721_helper::ERC721 }; const ACCOUNT: felt252 = 1234;