From b290196960877afdd8ba0a9636c9a23180b57377 Mon Sep 17 00:00:00 2001 From: notV4l Date: Fri, 12 Jan 2024 13:55:42 +0100 Subject: [PATCH] use #[abi(embed_v0)] --- examples/chess/src/actions.cairo | 2 +- examples/hex_map/src/actions.cairo | 2 +- examples/market/src/systems/liquidity.cairo | 2 +- examples/market/src/systems/trade.cairo | 2 +- .../tests/mocks/erc20/erc20_balance_mock.cairo | 2 +- .../tests/mocks/erc20/erc20_bridgeable_mock.cairo | 2 +- token/src/erc1155/erc1155.cairo | 6 +++--- token/src/erc20/erc20.cairo | 14 +++++++------- token/src/erc721/erc721.cairo | 8 ++++---- token/src/presets/erc20/bridgeable.cairo | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/chess/src/actions.cairo b/examples/chess/src/actions.cairo index 15274771..24d732ca 100644 --- a/examples/chess/src/actions.cairo +++ b/examples/chess/src/actions.cairo @@ -21,7 +21,7 @@ mod actions { use chess::models::game::{Game, GameTurn, GameTurnTrait}; use super::{ContractAddress, IActions, Vec2}; - #[external(v0)] + #[abi(embed_v0)] impl IActionsImpl of IActions { fn spawn( self: @ContractState, white_address: ContractAddress, black_address: ContractAddress diff --git a/examples/hex_map/src/actions.cairo b/examples/hex_map/src/actions.cairo index db502eca..0bc86343 100644 --- a/examples/hex_map/src/actions.cairo +++ b/examples/hex_map/src/actions.cairo @@ -52,7 +52,7 @@ mod actions { new_position } - #[external(v0)] + #[abi(embed_v0)] impl ActionsImpl of IActions { // ContractState is defined by system decorator expansion fn spawn(self: @ContractState) { // Access the world dispatcher for reading. diff --git a/examples/market/src/systems/liquidity.cairo b/examples/market/src/systems/liquidity.cairo index ca6ca349..6684519c 100644 --- a/examples/market/src/systems/liquidity.cairo +++ b/examples/market/src/systems/liquidity.cairo @@ -26,7 +26,7 @@ mod Liquidity { use super::Fixed; use super::ILiquidity; - #[external(v0)] + #[abi(embed_v0)] impl LiquidityImpl of ILiquidity { fn add( self: @ContractState, diff --git a/examples/market/src/systems/trade.cairo b/examples/market/src/systems/trade.cairo index 6bca856b..7b944011 100644 --- a/examples/market/src/systems/trade.cairo +++ b/examples/market/src/systems/trade.cairo @@ -17,7 +17,7 @@ mod Trade { use super::ITrade; - #[external(v0)] + #[abi(embed_v0)] impl TradeImpl of ITrade { fn buy(self: @ContractState, world: IWorldDispatcher, item_id: u32, quantity: u128) { let player = starknet::get_caller_address(); diff --git a/token/src/components/tests/mocks/erc20/erc20_balance_mock.cairo b/token/src/components/tests/mocks/erc20/erc20_balance_mock.cairo index 50c7ea81..5d9e692d 100644 --- a/token/src/components/tests/mocks/erc20/erc20_balance_mock.cairo +++ b/token/src/components/tests/mocks/erc20/erc20_balance_mock.cairo @@ -68,7 +68,7 @@ mod erc20_balance_mock { ERC20BalanceEvent: erc20_balance_component::Event, } - #[external(v0)] + #[abi(embed_v0)] #[generate_trait] impl InitializerImpl of InitializerTrait { fn initializer(ref self: ContractState, initial_supply: u256, recipient: ContractAddress,) { diff --git a/token/src/components/tests/mocks/erc20/erc20_bridgeable_mock.cairo b/token/src/components/tests/mocks/erc20/erc20_bridgeable_mock.cairo index 862633c5..fd8259c7 100644 --- a/token/src/components/tests/mocks/erc20/erc20_bridgeable_mock.cairo +++ b/token/src/components/tests/mocks/erc20/erc20_bridgeable_mock.cairo @@ -90,7 +90,7 @@ mod erc20_bridgeable_mock { // Initializer // - #[external(v0)] + #[abi(embed_v0)] #[generate_trait] impl ERC20InitializerImpl of ERC20InitializerTrait { fn initializer( diff --git a/token/src/erc1155/erc1155.cairo b/token/src/erc1155/erc1155.cairo index 331fcefc..f91c396d 100644 --- a/token/src/erc1155/erc1155.cairo +++ b/token/src/erc1155/erc1155.cairo @@ -73,7 +73,7 @@ mod ERC1155 { self.initializer(name, symbol, base_uri); } - #[external(v0)] + #[abi(embed_v0)] impl ERC1155MetadataImpl of interface::IERC1155Metadata { fn name(self: @ContractState) -> felt252 { self.get_meta().name @@ -91,7 +91,7 @@ mod ERC1155 { } - #[external(v0)] + #[abi(embed_v0)] impl ERC1155Impl of interface::IERC1155 { fn balance_of(self: @ContractState, account: ContractAddress, id: u256) -> u256 { assert(account.is_non_zero(), Errors::INVALID_ACCOUNT); @@ -161,7 +161,7 @@ mod ERC1155 { } } - #[external(v0)] + #[abi(embed_v0)] impl ERC1155CamelOnlyImpl of interface::IERC1155CamelOnly { fn balanceOf(self: @ContractState, account: ContractAddress, id: u256) -> u256 { ERC1155Impl::balance_of(self, account, id) diff --git a/token/src/erc20/erc20.cairo b/token/src/erc20/erc20.cairo index ff87bcd5..198c24b1 100644 --- a/token/src/erc20/erc20.cairo +++ b/token/src/erc20/erc20.cairo @@ -62,7 +62,7 @@ mod ERC20 { // External // - #[external(v0)] + #[abi(embed_v0)] impl ERC20MetadataImpl of interface::IERC20Metadata { fn name(self: @ContractState) -> felt252 { self.get_meta().name @@ -77,7 +77,7 @@ mod ERC20 { } } - #[external(v0)] + #[abi(embed_v0)] impl ERC20Impl of interface::IERC20 { fn total_supply(self: @ContractState) -> u256 { self.get_meta().total_supply @@ -121,7 +121,7 @@ mod ERC20 { } } - #[external(v0)] + #[abi(embed_v0)] impl ERC20CamelOnlyImpl of interface::IERC20CamelOnly { fn totalSupply(self: @ContractState) -> u256 { ERC20Impl::total_supply(self) @@ -141,7 +141,7 @@ mod ERC20 { } } - #[external(v0)] + #[abi(embed_v0)] fn increase_allowance( ref self: ContractState, spender: ContractAddress, added_value: u256 ) -> bool { @@ -149,14 +149,14 @@ mod ERC20 { true } - #[external(v0)] + #[abi(embed_v0)] fn increaseAllowance( ref self: ContractState, spender: ContractAddress, addedValue: u256 ) -> bool { increase_allowance(ref self, spender, addedValue) } - #[external(v0)] + #[abi(embed_v0)] fn decrease_allowance( ref self: ContractState, spender: ContractAddress, subtracted_value: u256 ) -> bool { @@ -164,7 +164,7 @@ mod ERC20 { true } - #[external(v0)] + #[abi(embed_v0)] fn decreaseAllowance( ref self: ContractState, spender: ContractAddress, subtractedValue: u256 ) -> bool { diff --git a/token/src/erc721/erc721.cairo b/token/src/erc721/erc721.cairo index 36d75b89..fc1f1589 100644 --- a/token/src/erc721/erc721.cairo +++ b/token/src/erc721/erc721.cairo @@ -73,7 +73,7 @@ mod ERC721 { self._mint(recipient, token_id); } - #[external(v0)] + #[abi(embed_v0)] impl ERC721MetadataImpl of interface::IERC721Metadata { fn name(self: @ContractState) -> felt252 { self.get_meta().name @@ -90,7 +90,7 @@ mod ERC721 { } } - #[external(v0)] + #[abi(embed_v0)] impl ERC721MetadataCamelOnlyImpl of interface::IERC721MetadataCamelOnly { fn tokenURI(self: @ContractState, tokenId: u256) -> felt252 { assert(self._exists(tokenId), Errors::INVALID_TOKEN_ID); @@ -98,7 +98,7 @@ mod ERC721 { } } - #[external(v0)] + #[abi(embed_v0)] impl ERC721Impl of interface::IERC721 { fn balance_of(self: @ContractState, account: ContractAddress) -> u256 { assert(account.is_non_zero(), Errors::INVALID_ACCOUNT); @@ -160,7 +160,7 @@ mod ERC721 { } } - #[external(v0)] + #[abi(embed_v0)] impl ERC721CamelOnlyImpl of interface::IERC721CamelOnly { fn balanceOf(self: @ContractState, account: ContractAddress) -> u256 { ERC721Impl::balance_of(self, account) diff --git a/token/src/presets/erc20/bridgeable.cairo b/token/src/presets/erc20/bridgeable.cairo index cb5b4c3a..56a85061 100644 --- a/token/src/presets/erc20/bridgeable.cairo +++ b/token/src/presets/erc20/bridgeable.cairo @@ -185,7 +185,7 @@ mod ERC20Bridgeable { // Initializer // - #[external(v0)] + #[abi(embed_v0)] #[generate_trait] impl ERC20InitializerImpl of ERC20InitializerTrait { fn initializer(