Skip to content

Commit cbf6bbc

Browse files
authored
Merge pull request #1168 from Concordium/DOC301-RenameSmartContracts
Renamed and reorganised smart contract articles
2 parents ba01df3 + a866596 commit cbf6bbc

23 files changed

+82
-69
lines changed

source/mainnet/docs/help-and-faq/set-up-doc-env-MacOs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Open your browser and visit http://localhost:8000 to view the documentation. To
109109

110110
.. code-block:: console
111111
112-
pipenv run ./script/build.sh
112+
pipenv run ./scripts/build.sh
113113
114114
This compiles the documentation into a format that can be hosted and accessed by users.
115115

source/mainnet/docs/index.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ Explore our developer resources, including detailed documentation, tutorials, an
7171
:caption: Smart Contracts
7272
:hidden:
7373

74+
QuickStart <smart-contracts/guides/quick-start>
7475
What is a smart contract? <smart-contracts/introduction>
75-
QuickStart to smart contract deployment <smart-contracts/guides/quick-start>
76-
Build a smart contract <smart-contracts/guides/build-contract>
77-
Deploy a smart contract <smart-contracts/guides/deploy-module>
78-
Development best practices <smart-contracts/guides/development>
79-
Cost reduction best practices <smart-contracts/guides/costs>
76+
Build <smart-contracts/guides/build-contract>
77+
Deploy <smart-contracts/guides/deploy-module>
78+
Best practices <smart-contracts/best-practices/index>
8079
References <smart-contracts/references/index>
8180

8281
.. toctree::

source/mainnet/docs/smart-contracts/guides/costs.rst renamed to source/mainnet/docs/smart-contracts/best-practices/costs.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _sc-costs-best-practices:
22

3-
=============================
4-
Cost reduction best practices
5-
=============================
3+
==============
4+
Cost reduction
5+
==============
66

77
There are several ways that you can reduce transaction costs when developing your smart contracts.
88

source/mainnet/docs/smart-contracts/guides/development.rst renamed to source/mainnet/docs/smart-contracts/best-practices/development.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _sc-development-best-practices:
22

3-
==========================
4-
Development best practices
5-
==========================
3+
===========
4+
Development
5+
===========
66

77
This document provides guidelines for developing smart contracts, including best practices for smart contract development, audit, information about common pitfalls and security vulnerabilities, and how to avoid them.
88

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. _best-practices:
2+
3+
==============
4+
Best Practices
5+
==============
6+
7+
You can use Concordium, with its unique approach to identity verification and privacy, as a robust platform for secure and scalable smart contract development.
8+
Creating efficient, reliable, and cost-effective smart contracts requires you to follow best practices that maximize performance while minimizing risks and costs.
9+
These articles guide you through the best practices for building high-quality smart contracts on Concordium.
10+
By following these recommendations, you can ensure your contracts are not only technically sound but also optimized.
11+
12+
.. toctree::
13+
:maxdepth: 1
14+
:hidden:
15+
16+
development
17+
costs

source/mainnet/docs/smart-contracts/contract-instances.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _contract-instances:
22

3-
========================
4-
Smart contract instances
5-
========================
3+
=========
4+
Instances
5+
=========
66

77
A :term:`smart contract instance<instance>` is a smart contract module together with a
88
specific state and an amount of CCD tokens. A smart contract instance is often just called an *instance*.

source/mainnet/docs/smart-contracts/contract-lifecycle.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _sc-lifecycle:
22

33
==============================
4-
Smart contract life cycle
4+
Life cycle
55
==============================
66

77
A smart contract is first deployed to the chain as part of a :ref:`contract

source/mainnet/docs/smart-contracts/contract-module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _contract-module:
22

33
======================
4-
Smart contract modules
4+
Modules
55
======================
66

77
Smart contracts are deployed on the chain in *smart contract modules*. A smart contract module is often referred to simply as a *module*.

source/mainnet/docs/smart-contracts/contract-schema.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
.. _contract-schema:
1414

15-
======================
16-
Smart contract schemas
17-
======================
15+
================
16+
Contract schemas
17+
================
1818

1919
A smart contract schema is a description of how to represent bytes in a more
2020
structured representation. It can be used by external tools when displaying the

source/mainnet/docs/smart-contracts/develop-contracts.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
1515
.. _writing-smart-contracts:
1616

17-
===============================
18-
Develop smart contracts in Rust
19-
===============================
17+
==========
18+
Using Rust
19+
==========
2020

2121
On the Concordium blockchain smart contracts are deployed as Wasm modules, but
2222
Wasm is designed primarily as a compilation target and is not convenient to
@@ -143,6 +143,10 @@ There are a number of things to notice:
143143
the values are stored in the state. To load
144144
the values again, the state context is needed, hence the ``DeserialWithState``.
145145
146+
.. note::
147+
148+
There is also the option of building a contract using ``no_std``. For more information, read :ref:`no-std`
149+
146150
.. _serialize-state-and-parameters:
147151

148152
Serializable state and parameters

source/mainnet/docs/smart-contracts/guides/compile-module.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
.. _compile-module:
66

7-
====================================
8-
Compile a Rust smart contract module
9-
====================================
7+
==================
8+
Module Compilation
9+
==================
1010

1111
This guide will show you how to compile smart contract module written in Rust to
1212
a Wasm module.

source/mainnet/docs/smart-contracts/guides/custom-errors.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. _custom discriminant values: https://doc.rust-lang.org/reference/items/enumerations.html#custom-discriminant-values-for-fieldless-enumerations
22
.. _custom-errors:
33

4-
====================
5-
Return custom errors
6-
====================
4+
=============
5+
Custom errors
6+
=============
77

88
This guide shows how to return custom errors from your Rust smart contract.
99

source/mainnet/docs/smart-contracts/guides/factory-pattern.rst

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
.. _factory-pattern:
22

3-
=======================================
4-
Use the factory pattern on Concordium
5-
=======================================
6-
7-
.. Warning::
8-
9-
This guide makes use of features that are first available in protocol version 7,
10-
namely getting the contract name and module reference of a smart contract instance
11-
from a smart contract.
12-
Before the protocol upgrade to version 7 (expected summer 2024), these features will not work.
3+
===============
4+
Factory pattern
5+
===============
136

147
The factory pattern is a design pattern where one contract (the factory) creates instances of
158
another contract (the products). This pattern makes sense on Ethereum, where deploying a smart

source/mainnet/docs/smart-contracts/guides/initialize-contract.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. include:: ../../../variables.rst
22
.. _initialize-contract:
33

4-
====================================
5-
Initialize a smart contract instance
6-
====================================
4+
==========
5+
Initialize
6+
==========
77

88
This guide will show you how to initialize a smart contract from a deployed
99
smart contract module with parameters in JSON or binary format.

source/mainnet/docs/smart-contracts/guides/inspect-instance.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _inspect-instance:
22

3-
=================================
4-
Inspect a smart contract instance
5-
=================================
3+
=======
4+
Inspect
5+
=======
66

77
This guide explains how to inspect a smart contract instance.
88
Inspecting an instance shows you its name, owner, module reference, balance,

source/mainnet/docs/smart-contracts/guides/integration-test-contract.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _integration-test-contract:
22

3-
===================================
4-
Integration test a contract in Rust
5-
===================================
3+
=================
4+
Integration tests
5+
=================
66

77
This guide describes how to write *integration tests* in Rust for your smart contracts using the `Concordium smart contract testing library <https://docs.rs/concordium-smart-contract-testing/latest/concordium_smart_contract_testing/>`_.
88

source/mainnet/docs/smart-contracts/guides/interact-instance.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _interact-instance:
22

3-
=======================================
4-
Interact with a smart contract instance
5-
=======================================
3+
========
4+
Interact
5+
========
66

77
This guide will show you, how to interact with a smart contract instance, which
88
means triggering a receive function that, possibly, updates the state of the

source/mainnet/docs/smart-contracts/guides/invoke-instance.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _invoke-instance:
22

3-
================================
4-
Invoke a smart contract instance
5-
================================
3+
======
4+
Invoke
5+
======
66

77
This guide explains how to invoke a smart contract instance, which
88
means triggering a receive function and viewing its return value. Invoking an

source/mainnet/docs/smart-contracts/guides/json-params.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _json-params:
22

3-
=============================
4-
Work with the JSON parameters
5-
=============================
3+
===============
4+
JSON parameters
5+
===============
66

77
This guide explains how to interact with the CIS-2 smart contract functions by providing input JSON parameters. This guide uses the `cis2-multi smart contract <https://github.com/Concordium/concordium-rust-smart-contracts/tree/main/examples/cis2-multi>`__ as a starting point, and then continues with a couple of custom input types.
88

source/mainnet/docs/smart-contracts/guides/no-std.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _no-std:
22

3-
======================
4-
Build using ``no_std``
5-
======================
3+
================
4+
Using ``no_std``
5+
================
66

77
This guide shows how to enable ``no_std`` for your rust smart contract,
88
potentially reducing the size of the resulting Wasm module by several kilobytes.

source/mainnet/docs/smart-contracts/guides/setup-contract.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
.. _setup-contract:
44

5-
===============================
6-
Set up a smart contract project
7-
===============================
5+
================
6+
Set up a project
7+
================
88

99
This guide documents two different options (*from a template* or *from scratch*) to create a new Concordium smart contract project.
1010
The *from a template* option is available for ``cargo-concordium`` version 2.2.0 or greater. It provides you with some

source/mainnet/docs/smart-contracts/guides/unit-test-contract.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
.. _unit-test-contract:
44

5-
============================
6-
Unit test a contract in Rust
7-
============================
5+
============
6+
Unit testing
7+
============
88

99
.. warning::
1010

source/mainnet/docs/smart-contracts/guides/upgradeable-contract.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _guide-upgradable-contract:
22

3-
===========================
4-
Make a contract upgradeable
5-
===========================
3+
====================
4+
Upgradeability Guide
5+
====================
66

77
This guide shows how to make a Rust smart contract upgradeable.
88

0 commit comments

Comments
 (0)