Skip to content

Commit

Permalink
use #[abi(embed_v0)]
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l committed Jan 12, 2024
1 parent 01739c1 commit 5cdbc84
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions po/cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -2346,8 +2346,8 @@ msgid "To implement the interface:"
msgstr "执行接口:"

#: src/cairo/migration/0.3.0.md:120
msgid "Add `#[external(v0)]` before each method."
msgstr "在每个方法之前添加`#[external(v0)]`。"
msgid "Add `#[abi(embed_v0)]` before each method."
msgstr "在每个方法之前添加`#[abi(embed_v0)]`。"

#: src/cairo/migration/0.3.0.md:121
msgid ""
Expand Down Expand Up @@ -6343,7 +6343,7 @@ msgstr ""
#: src/tutorial/onchain-chess/1-action.md:52
msgid ""
"```shell\n"
" #[external(v0)]\n"
" #[abi(embed_v0)]\n"
" impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n"
Expand Down
8 changes: 4 additions & 4 deletions po/jp.po
Original file line number Diff line number Diff line change
Expand Up @@ -2413,8 +2413,8 @@ msgid "To implement the interface:"
msgstr "インターフェースを実装するには:"

#: src/cairo/migration/0.3.0.md:120
msgid "Add `#[external(v0)]` before each method."
msgstr "各メソッドの前に `#[external(v0)]` を追加してください。"
msgid "Add `#[abi(embed_v0)]` before each method."
msgstr "各メソッドの前に `#[abi(embed_v0)]` を追加してください。"

#: src/cairo/migration/0.3.0.md:121
msgid ""
Expand Down Expand Up @@ -6492,7 +6492,7 @@ msgstr ""
#: src/tutorial/onchain-chess/1-action.md:52
msgid ""
"```shell\n"
" #[external(v0)]\n"
" #[abi(embed_v0)]\n"
" impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n"
Expand Down Expand Up @@ -6526,7 +6526,7 @@ msgid ""
"```"
msgstr ""
"```shell\n"
" #[external(v0)]\n"
" #[abi(embed_v0)]\n"
" impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n"
Expand Down
8 changes: 4 additions & 4 deletions po/ko.po
Original file line number Diff line number Diff line change
Expand Up @@ -2511,8 +2511,8 @@ msgid "To implement the interface:"
msgstr "인터페이스를 구현하려면:"

#: src/cairo/migration/0.3.0.md:120
msgid "Add `#[external(v0)]` before each method."
msgstr "각 메소드 앞에 `#[external(v0)]`을 추가하십시오."
msgid "Add `#[abi(embed_v0)]` before each method."
msgstr "각 메소드 앞에 `#[abi(embed_v0)]`을 추가하십시오."

#: src/cairo/migration/0.3.0.md:121
msgid ""
Expand Down Expand Up @@ -6645,7 +6645,7 @@ msgstr ""
#: src/tutorial/onchain-chess/1-action.md:52
msgid ""
"```shell\n"
" #[external(v0)]\n"
" #[abi(embed_v0)]\n"
" impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n"
Expand Down Expand Up @@ -6679,7 +6679,7 @@ msgid ""
"```"
msgstr ""
"```shell\n"
"#[external(v0)]\n"
"#[abi(embed_v0)]\n"
"impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n"
Expand Down
6 changes: 3 additions & 3 deletions po/lt.po
Original file line number Diff line number Diff line change
Expand Up @@ -2705,8 +2705,8 @@ msgid "To implement the interface:"
msgstr "Ad implementandum interfaciem:"

#: src/cairo/migration/0.3.0.md:120
msgid "Add `#[external(v0)]` before each method."
msgstr "Adde `#[external(v0)]` ante quamque methodum."
msgid "Add `#[abi(embed_v0)]` before each method."
msgstr "Adde `#[abi(embed_v0)]` ante quamque methodum."

#: src/cairo/migration/0.3.0.md:121
msgid ""
Expand Down Expand Up @@ -7095,7 +7095,7 @@ msgstr ""
#: src/tutorial/onchain-chess/1-action.md:52
msgid ""
"```shell\n"
" #[external(v0)]\n"
" #[abi(embed_v0)]\n"
" impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n"
Expand Down
4 changes: 2 additions & 2 deletions po/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ msgid "To implement the interface:"
msgstr ""

#: src/cairo/migration/0.3.0.md:120
msgid "Add `#[external(v0)]` before each method."
msgid "Add `#[abi(embed_v0)]` before each method."
msgstr ""

#: src/cairo/migration/0.3.0.md:121
Expand Down Expand Up @@ -5698,7 +5698,7 @@ msgstr ""
#: src/tutorial/onchain-chess/1-action.md:52
msgid ""
"```shell\n"
" #[external(v0)]\n"
" #[abi(embed_v0)]\n"
" impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, "
Expand Down
8 changes: 4 additions & 4 deletions po/vi.po
Original file line number Diff line number Diff line change
Expand Up @@ -2743,8 +2743,8 @@ msgid "To implement the interface:"
msgstr "Để thực hiện giao diện:"

#: src/cairo/migration/0.3.0.md:120
msgid "Add `#[external(v0)]` before each method."
msgstr "Thêm `#[external(v0)]` trước mỗi phương thức."
msgid "Add `#[abi(embed_v0)]` before each method."
msgstr "Thêm `#[abi(embed_v0)]` trước mỗi phương thức."

#: src/cairo/migration/0.3.0.md:121
msgid ""
Expand Down Expand Up @@ -7179,7 +7179,7 @@ msgstr ""
#: src/tutorial/onchain-chess/1-action.md:52
msgid ""
"```shell\n"
" #[external(v0)]\n"
" #[abi(embed_v0)]\n"
" impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n"
Expand Down Expand Up @@ -7213,7 +7213,7 @@ msgid ""
"```"
msgstr ""
"```shell\n"
"#[external(v0)]\n"
"#[abi(embed_v0)]\n"
"impl PlayerActionsImpl of IActions<ContractState> {\n"
" fn spawn_game(\n"
" self: @ContractState, white_address: ContractAddress, black_address: ContractAddress\n"
Expand Down
2 changes: 1 addition & 1 deletion src/cairo/hello-dojo.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ mod actions {
// impl: implement functions specified in trait
#[external(v0)]
#[abi(embed_v0)]
impl ActionsImpl of IActions<ContractState> {
// ContractState is defined by system decorator expansion
fn spawn(self: @ContractState) {
Expand Down
4 changes: 2 additions & 2 deletions src/cairo/migration/0.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ Ensure the trait is typed with `TContractState`.

To implement the interface:

1. Add `#[external(v0)]` before each method.
1. Add `#[abi(embed_v0)]` before each method.
2. Ensure to reference the created interface in the module with `use super::ICreateCard;`.

```rust,ignore
#[external(v0)]
#[abi(embed_v0)]
impl CreateCardImpl of ICreateCard<ContractState> {
fn create_card(
self: @ContractState,
Expand Down
2 changes: 1 addition & 1 deletion src/cairo/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ mod spawnHuman {
const COUNTER_ID: u32 = 9999999999999;
// impl: implement functions specified in trait
#[external(v0)]
#[abi(embed_v0)]
impl GoblinActionsImpl of IGoblinActions<ContractState> {
fn goblin_actions(self: @ContractState, entity_id: u32) {
let world = self.world_dispatcher.read();
Expand Down
2 changes: 1 addition & 1 deletion src/cairo/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ mod player_actions {
use super::{Position, Vec2};
use super::IPlayerActions;
#[external(v0)]
#[abi(embed_v0)]
impl PlayerActionsImpl of IPlayerActions<ContractState> {
//
// This is how we interact with the world contract.
Expand Down
4 changes: 2 additions & 2 deletions src/cairo/systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod player_actions {
struct Storage {}
// implementation of the PlayerActions interface
#[external(v0)]
#[abi(embed_v0)]
impl PlayerActionsImpl of IPlayerActions<ContractState> {
fn spawn(self: @ContractState, world: IWorldDispatcher) {
let player = get_caller_address();
Expand Down Expand Up @@ -103,7 +103,7 @@ mod player_actions {
}
// impl: implement functions specified in trait
#[external(v0)]
#[abi(embed_v0)]
impl PlayerActionsImpl of IPlayerActions<ContractState> {
// ContractState is defined by system decorator expansion
fn spawn(self: @ContractState) {
Expand Down
2 changes: 1 addition & 1 deletion src/tutorial/onchain-chess/1-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Should be noted that `actions` is the contract name.
3. Write a `spawn` function that accepts the `white address`, and `black address` as input and set necessary states using `set!(...)`. Implement the `player` entity from player model. Implement the game entity, comprised of the `Game` model and `GameTurn` model we created in the `game.cairo` and implement the piece entities from a1 to h8 containing the correct `PieceType` in the `spawn` fn.

```rust,ignore
#[external(v0)]
#[abi(embed_v0)]
impl IActionsImpl of IActions<ContractState> {
fn spawn(
self: @ContractState, white_address: ContractAddress, black_address: ContractAddress
Expand Down
2 changes: 1 addition & 1 deletion src/tutorial/onchain-chess/2-move.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1. Write a `move` function that accepts the `current position`, `next position`, `caller address`, and `game_id`. The `move` function should look like this:

```c
#[external(v0)]
#[abi(embed_v0)]
impl PlayerActionsImpl of IActions<ContractState> {
fn spawn(
self: @ContractState, white_address: ContractAddress, black_address: ContractAddress
Expand Down

0 comments on commit 5cdbc84

Please sign in to comment.