Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.1 -> main] Fix broken links in cdt repo #128

Merged
merged 9 commits into from
Apr 6, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ This guide provides instructions how to perform authorization checks in a smart

See the following code reference guides for functions which can be used to implement authorization checks in a smart contract:

* function [has_auth(name n)](http://docs.eosnetwork.com/cdt/latest/reference/Namespaces/namespaceeosio#function-has_auth)
* function [require_auth(name n)](http://docs.eosnetwork.com/cdt/latest/reference/Namespaces/namespaceeosio#function-require_auth)
* function [require_auth2(capi_name name, capi_name permission)](http://docs.eosnetwork.com/cdt/latest/reference/Files/action_8h)
* function [check(bool pred, ...)](http://docs.eosnetwork.com/cdt/latest/reference/Namespaces/namespaceeosio#function-check)
* function [has_auth(name n)](../../reference/Namespaces/namespaceeosio#function-has_auth)
* function [require_auth(name n)](../../reference/Namespaces/namespaceeosio#function-require_auth)
* function [require_auth2(capi_name name, capi_name permission)](../../reference/Files/action_8h)
* function [check(bool pred, ...)](../../reference/Namespaces/namespaceeosio#function-check)

## Procedure

Expand All @@ -45,7 +45,7 @@ void hi( name user ) {
}
```

Another example can be found in the [Tic Tac Toe Tutorial](https://docs.eosnetwork.com/docs/latest/tutorials/tic-tac-toe-game-contract#action-handler---move).
Another example can be found in the [Tic Tac Toe Tutorial](https://docs.eosnetwork.com/docs/latest/smart-contracts/tutorials/tic-tac-toe-game-contract#create-tictactoecpp-file).

### 2. Use require_auth

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ This guide provides instructions to define a primary index for a multi-index tab

See the following code reference:

* The [`multi-index`](../../classeosio_1_1multi__index) class.
* The [`multi-index`](../../reference/Classes/classeosio_1_1multi__index) class.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).

## Procedure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ This guide provides instructions to define a secondary index for a multi-index t

See the following code reference:

* The [`multi-index`](../../classeosio_1_1multi__index) class.
* The [`multi-index`](../../reference/Classes/classeosio_1_1multi__index) class.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).
* A multi-index table `testtab` along with its `test_table` data structure, its mandatory primary index, and the type alias definition `test_table_t`. Please see [How To Define A Primary Index](./how-to-define-a-primary-index) to set up these prerequisites.

## Procedure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ This guide provides instructions to define a singleton.

See the following code reference:

* The [`singleton`](../../classeosio_1_1singleton) class.
* The [`singleton`](../../reference/Classes/classeosio_1_1singleton) class.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).

## Procedure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ This guide provides instructions to to delete data from a multi-index table.

See the following code reference:

* The [`multi-index`](../../classeosio_1_1multi__index) class.
* The [`multi-index::find(...)`](../../group__multiindex#function-find) method.
* The [`multi-index::erase(...)`](../../group__multiindex/#function-erase) method.
* The [`multi-index`](../../reference/Classes/classeosio_1_1multi__index) class.
* The [`multi-index::find(...)`](../../reference/Modules/group__multiindex#function-find) method.
* The [`multi-index::erase(...)`](../../reference/Modules/group__multiindex#function-erase) method.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).
* A multi-index `testab` table instance which stores `user` objects indexed by the primary key which is of type `eosio::name`. Consult the section [How to instantiate a multi-index table](./how-to-instantiate-a-multi-index-table.md) to learn how to set it up.

## Procedure
Expand All @@ -27,7 +27,7 @@ Complete the following steps to implement a `del` action which deletes an user o

### 1. Find The User You Want To Delete

Use the multi-index [`find(...)`](../../group__multiindex#function-find) method to locate the user object you want to delete. The targeted user is searched based on its account name.
Use the multi-index [`find(...)`](../../reference/Modules/group__multiindex#function-find) method to locate the user object you want to delete. The targeted user is searched based on its account name.

```cpp
[[eosio::action]] void multi_index_example::del( name user ) {
Expand All @@ -38,7 +38,7 @@ Use the multi-index [`find(...)`](../../group__multiindex#function-find) method

### 2. Delete The User If Found

Check to see if the user exists and use [`erase`(...)](../../group__multiindex/#function-erase) method to delete the row from table. Otherwise print an informational message and return.
Check to see if the user exists and use [`erase`(...)](../../reference/Modules/group__multiindex#function-erase) method to delete the row from table. Otherwise print an informational message and return.

```diff
[[eosio::action]] void multi_index_example::del( name user ) {
Expand All @@ -62,7 +62,7 @@ In conclusion, the above instructions show how to delete data from a multi-index

## Next Steps

* You can verify if the user object was deleted from the multi-index table. .
* You can verify if the user object was deleted from the multi-index table.

```cpp
// check if the user was deleted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ This guide provides instructions to insert data into a multi-index table.

See the following code reference:

* The [`multi-index`](../../classeosio_1_1multi__index) class.
* The [`multi-index::find(...)`](../../group__multiindex#function-find) method.
* The [`multi-index::emplace(...)`](../../group__multiindex/#function-emplace) method.
* The [`multi-index`](../../reference/Classes/classeosio_1_1multi__index) class.
* The [`multi-index::find(...)`](../../reference/Modules/group__multiindex#function-find) method.
* The [`multi-index::emplace(...)`](../../reference/Modules/group__multiindex#function-emplace) method.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).
* A multi-index `testab` table instance which stores `user` objects indexed by the primary key which is of type `eosio::name`. Consult the section [How to instantiate a multi-index table](./how-to-instantiate-a-multi-index-table.md) to learn how to set it up.

## Procedure
Expand All @@ -38,7 +38,7 @@ Use of the multi-index table iterator to find out if the user object already exi

### 2. Insert The User If Not Found In Table

Use the [`emplace`](../../group__multiindex/#function-emplace) method to make the insertion if the user object is not already in the multi-index table. Otherwise print an informational message.
Use the [`emplace`](../../reference/Modules/group__multiindex#function-emplace) method to make the insertion if the user object is not already in the multi-index table. Otherwise print an informational message.

```diff
[[eosio::action]] void multi_index_example::set( name user ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ This guide provides instructions to instantiate a multi-index table.

See the following code reference:

* The [`multi-index`](../../classeosio_1_1multi__index) class.
* The [`multi-index`](../../reference/Classes/classeosio_1_1multi__index) class.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).

## Procedure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ This guide provides instructions on how iterate and retrieve data from a multi-i

See the following code reference:

* The [`multi-index`](../../classeosio_1_1multi__index) class.
* The [`multi-index::find(...)`](../../group__multiindex#function-find) method.
* The [`multi-index`](../../reference/Classes/classeosio_1_1multi__index) class.
* The [`multi-index::find(...)`](../../reference/Modules/group__multiindex#function-find) method.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).
* A multi-index `testab` table instance which stores `user` objects indexed by the primary key which is of type `eosio::name` and a secondary index for data member `secondary` of type `eosio::name` accessible through `by_secondary()` method. Consult the section [How to define a secondary index](./how-to-define-a-secondary-index) to learn how to set it up.

## Procedure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ This guide provides instructions to iterate and retrieve data from a multi-index

See the following code reference:

* The [`multi-index`](../../classeosio_1_1multi__index) class.
* The [`multi-index::find(...)`](../../group__multiindex#function-find) method.
* The [`multi-index`](../../reference/Classes/classeosio_1_1multi__index) class.
* The [`multi-index::find(...)`](../../reference/Modules/group__multiindex#function-find) method.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).
* A multi-index `testab` table instance which stores `user` objects indexed by the primary key which is of type `eosio::name`. Consult the section [How to instantiate a multi-index table](./how-to-instantiate-a-multi-index-table) to learn how to set it up.

## Procedure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ This guide provides instructions to modify data in a multi-index table.

See the following code reference:

* The [`multi-index`](../../classeosio_1_1multi__index) class.
* The [`multi-index::modify(...)`](../../group__multiindex/#function-modify) method.
* The [`multi-index`](../../reference/Classes/classeosio_1_1multi__index) class.
* The [`multi-index::modify(...)`](../../reference/Modules/group__multiindex#function-modify) method.

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/),
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).
* A multi-index `testab` table instance which stores `user` objects indexed by the primary key which is of type `eosio::name`. Consult the section [How to instantiate a multi-index table](./how-to-instantiate-a-multi-index-table) to learn how to set it up.

## Procedure
Expand All @@ -42,7 +42,7 @@ Optionally, for ease of use add the action wrapper definition as well.

### 2. Find The User You Want To Modify

Use the multi-index [`find(...)`](../../group__multiindex#function-find) method to locate the user object you want to modify. The targeted user is searched based on its account name.
Use the multi-index [`find(...)`](../../reference/Modules/group__multiindex#function-find) method to locate the user object you want to modify. The targeted user is searched based on its account name.

```cpp
[[eosio::action]] void multi_index_example::mod( name user, uint32_t value ) {
Expand All @@ -52,7 +52,7 @@ Use the multi-index [`find(...)`](../../group__multiindex#function-find) method

### 3. Yield Error If User Not Found

If the `user` object you want to update is not found then raise an error message by using the [`eosio::check`](../../namespaceeosio/#function-check-17) method.
If the `user` object you want to update is not found then raise an error message by using the [`eosio::check`](../../reference/Namespaces/namespaceeosio#function-check) method.

```diff
[[eosio::action]] void multi_index_example::mod( name user, uint32_t value ) {
Expand All @@ -63,7 +63,7 @@ If the `user` object you want to update is not found then raise an error message

### 4. Update The User If Found

If the `user` object you want to update is found, the [`eosio::check`](../../namespaceeosio/#function-check-17) method will do nothing and the iterator `itr` will be pointing at the object which you want to update. Use the [`multi-index::modify(...)`](../../group__multiindex/#function-modify) method to update the user object `datum` data member with the `value` parameter.
If the `user` object you want to update is found, the [`eosio::check`](../../reference/Namespaces/namespaceeosio#function-check) method will do nothing and the iterator `itr` will be pointing at the object which you want to update. Use the [`multi-index::modify(...)`](../../reference/Modules/group__multiindex#function-modify) method to update the user object `datum` data member with the `value` parameter.

```diff
[[eosio::action]] void multi_index_example::mod( name user, uint32_t value ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ This guide provides instructions to create and use an action wrapper in a smart

See the following code reference guide for action wrapper:

* [eosio::action_wrapper](../structeosio_1_1action__wrapper).
* [eosio::action_wrapper](../reference/Classes/structeosio_1_1action__wrapper).

## Before you begin

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/).
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).
* A smart contract named `multi_index_example`, defined in file `multi_index_example.hpp`.
* An action `mod` which modifies the integer value `n` stored for row with key `user`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In order to accomplish this, use the `return` statement and pass the desired ret

Make sure you have the following prerequisites in place:

* An Antelope development environment, for details consult the [Get Started Guide](https://docs.eosnetwork.com/docs/latest/getting-started/).
* An Antelope development environment, for details consult the [Documentation Portal](https://docs.eosnetwork.com/docs/latest/).
* A smart contract, let’s call it `smrtcontract`, which builds without error.
* An action, let’s call it `checkwithrv`, from which you want to return a value of a user defined type `action_response`.

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ If you are upgrading to CDT version 3.0 or later from version 1.8.1 (or earlier)

## License

[MIT](../LICENSE)
[MIT](https://github.com/AntelopeIO/cdt/blob/main/LICENSE)