Skip to content

Commit

Permalink
Changed default tab for Contract ABI example to Cairo v2 instead of v1.
Browse files Browse the repository at this point in the history
  • Loading branch information
stoobie committed Feb 29, 2024
1 parent 610676d commit fbad954
Showing 1 changed file with 108 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,114 @@ The following is an example contract ABI:

[tabs]
====
Cairo v2::
+
[source,json]
----
[
{
"type": "impl",
"name": "CounterContract",
"interface_name": "new_syntax_test_contract::new_syntax_test_contract::ICounterContract"
},
{
"type": "interface",
"name": "new_syntax_test_contract::new_syntax_test_contract::ICounterContract",
"items": [
{
"type": "function",
"name": "increase_counter",
"inputs": [
{
"name": "amount",
"type": "core::integer::u128"
}
],
"outputs": [],
"state_mutability": "external"
},
{
"type": "function",
"name": "decrease_counter",
"inputs": [
{
"name": "amount",
"type": "core::integer::u128"
}
],
"outputs": [],
"state_mutability": "external"
},
{
"type": "function",
"name": "get_counter",
"inputs": [],
"outputs": [
{
"type": "core::integer::u128"
}
],
"state_mutability": "view"
}
]
},
{
"type": "constructor",
"name": "constructor",
"inputs": [
{
"name": "initial_counter",
"type": "core::integer::u128"
},
{
"name": "other_contract_addr",
"type": "core::starknet::contract_address::ContractAddress"
}
]
},
{
"type": "event",
"name": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::CounterIncreased",
"kind": "struct",
"members": [
{
"name": "amount",
"type": "core::integer::u128",
"kind": "data"
}
]
},
{
"type": "event",
"name": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::CounterDecreased",
"kind": "struct",
"members": [
{
"name": "amount",
"type": "core::integer::u128",
"kind": "data"
}
]
},
{
"type": "event",
"name": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::Event",
"kind": "enum",
"variants": [
{
"name": "CounterIncreased",
"type": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::CounterIncreased",
"kind": "nested"
},
{
"name": "CounterDecreased",
"type": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::CounterDecreased",
"kind": "nested"
}
]
}
]
----
Cairo v1::
+
[source,json]
Expand Down Expand Up @@ -253,114 +361,6 @@ Cairo v1::
}
]
----
Cairo v2::
+
[source,json]
----
[
{
"type": "impl",
"name": "CounterContract",
"interface_name": "new_syntax_test_contract::new_syntax_test_contract::ICounterContract"
},
{
"type": "interface",
"name": "new_syntax_test_contract::new_syntax_test_contract::ICounterContract",
"items": [
{
"type": "function",
"name": "increase_counter",
"inputs": [
{
"name": "amount",
"type": "core::integer::u128"
}
],
"outputs": [],
"state_mutability": "external"
},
{
"type": "function",
"name": "decrease_counter",
"inputs": [
{
"name": "amount",
"type": "core::integer::u128"
}
],
"outputs": [],
"state_mutability": "external"
},
{
"type": "function",
"name": "get_counter",
"inputs": [],
"outputs": [
{
"type": "core::integer::u128"
}
],
"state_mutability": "view"
}
]
},
{
"type": "constructor",
"name": "constructor",
"inputs": [
{
"name": "initial_counter",
"type": "core::integer::u128"
},
{
"name": "other_contract_addr",
"type": "core::starknet::contract_address::ContractAddress"
}
]
},
{
"type": "event",
"name": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::CounterIncreased",
"kind": "struct",
"members": [
{
"name": "amount",
"type": "core::integer::u128",
"kind": "data"
}
]
},
{
"type": "event",
"name": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::CounterDecreased",
"kind": "struct",
"members": [
{
"name": "amount",
"type": "core::integer::u128",
"kind": "data"
}
]
},
{
"type": "event",
"name": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::Event",
"kind": "enum",
"variants": [
{
"name": "CounterIncreased",
"type": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::CounterIncreased",
"kind": "nested"
},
{
"name": "CounterDecreased",
"type": "new_syntax_test_contract::new_syntax_test_contract::counter_contract::CounterDecreased",
"kind": "nested"
}
]
}
]
----
====

== Cairo v2.3.0 changes
Expand Down

0 comments on commit fbad954

Please sign in to comment.