From 3fb673e869eb215a670b715304f47aeafa616126 Mon Sep 17 00:00:00 2001 From: Ilyar <761285+ilyar@users.noreply.github.com> Date: Thu, 27 Jul 2023 16:52:13 +0200 Subject: [PATCH 1/2] fix: normalize slug for url and order --- src/standard/TIP-1/1.md | 3 ++- src/standard/TIP-1/2.md | 3 ++- src/standard/TIP-1/_category_.json | 3 +-- src/standard/TIP-3/_category_.json | 3 +-- src/standard/TIP-4/_category_.json | 3 +-- src/standard/TIP-6/_category_.json | 3 +-- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/standard/TIP-1/1.md b/src/standard/TIP-1/1.md index 2af4cc379..714b21a6d 100644 --- a/src/standard/TIP-1/1.md +++ b/src/standard/TIP-1/1.md @@ -2,6 +2,7 @@ title: 1.1 COPYLEFT sidebar_position: 1 description: Developer business models and license information +slug: /standard/TIP-1.1 --- # COPYLEFT (TIP-1.1) @@ -112,4 +113,4 @@ To recap the proposed system is compatible with all four essential freedoms: [^4]: [Economics in a Sharded Blockchain — Section 06 — Developer Business Models](https://near.org/papers/economics-in-sharded-blockchain/#developer-business-models) -[^5]: [Misinterpreting Copyright — A Series of Errors](https://www.gnu.org/philosophy/misinterpreting-copyright.en.html) \ No newline at end of file +[^5]: [Misinterpreting Copyright — A Series of Errors](https://www.gnu.org/philosophy/misinterpreting-copyright.en.html) diff --git a/src/standard/TIP-1/2.md b/src/standard/TIP-1/2.md index 14bb5a244..c0776888f 100644 --- a/src/standard/TIP-1/2.md +++ b/src/standard/TIP-1/2.md @@ -2,8 +2,9 @@ title: 1.2 MYCODE sidebar_position: 2 description: Returns the Cell with the current code of the smartcontract +slug: /standard/TIP-1.2 --- # MYCODE (TIP-1.2) -`F82A` — `MYCODE (- s)` — returns the Cell with the current code of the smartcontract. Equivalent to `GETPARAM 10`. Smartcontract has own code which cell representation can be obtained by this instruction. \ No newline at end of file +`F82A` — `MYCODE (- s)` — returns the Cell with the current code of the smartcontract. Equivalent to `GETPARAM 10`. Smartcontract has own code which cell representation can be obtained by this instruction. diff --git a/src/standard/TIP-1/_category_.json b/src/standard/TIP-1/_category_.json index 16a6113a6..135fb96f2 100644 --- a/src/standard/TIP-1/_category_.json +++ b/src/standard/TIP-1/_category_.json @@ -1,6 +1,5 @@ { - "position": 0, - "collapsed": false, + "position": 1, "label": "TIP-1 TVM Opcode", "link": { "slug": "standard/TIP-1", diff --git a/src/standard/TIP-3/_category_.json b/src/standard/TIP-3/_category_.json index 3310075f5..f99a44e02 100644 --- a/src/standard/TIP-3/_category_.json +++ b/src/standard/TIP-3/_category_.json @@ -1,5 +1,4 @@ { - "position": 1, - "collapsed": false, + "position": 3, "label": "TIP-3 FT" } diff --git a/src/standard/TIP-4/_category_.json b/src/standard/TIP-4/_category_.json index d8435a100..486e27ada 100644 --- a/src/standard/TIP-4/_category_.json +++ b/src/standard/TIP-4/_category_.json @@ -1,5 +1,4 @@ { - "position": 2, - "collapsed": false, + "position": 4, "label": "TIP-4 NFT" } diff --git a/src/standard/TIP-6/_category_.json b/src/standard/TIP-6/_category_.json index 1587e673b..727a26ca7 100644 --- a/src/standard/TIP-6/_category_.json +++ b/src/standard/TIP-6/_category_.json @@ -1,5 +1,4 @@ { - "position": 3, - "collapsed": false, + "position": 6, "label": "TIP-6" } From b235fcaaf3b8fb8533e7a5176fc8fb0200975b7f Mon Sep 17 00:00:00 2001 From: Ilyar <761285+ilyar@users.noreply.github.com> Date: Thu, 27 Jul 2023 16:52:17 +0200 Subject: [PATCH 2/2] feat: add new category for examples --- src/solidity-by-example/_category_.json | 9 ++++ .../application/_category_.json | 9 ++++ src/solidity-by-example/basic/_category_.json | 8 ++++ src/solidity-by-example/basic/first-app.md | 47 +++++++++++++++++++ src/solidity-by-example/basic/hello-world.md | 32 +++++++++++++ src/solidity-by-example/hack/_category_.json | 9 ++++ 6 files changed, 114 insertions(+) create mode 100644 src/solidity-by-example/_category_.json create mode 100644 src/solidity-by-example/application/_category_.json create mode 100644 src/solidity-by-example/basic/_category_.json create mode 100644 src/solidity-by-example/basic/first-app.md create mode 100644 src/solidity-by-example/basic/hello-world.md create mode 100644 src/solidity-by-example/hack/_category_.json diff --git a/src/solidity-by-example/_category_.json b/src/solidity-by-example/_category_.json new file mode 100644 index 000000000..8a9d2dab5 --- /dev/null +++ b/src/solidity-by-example/_category_.json @@ -0,0 +1,9 @@ +{ + "position": 0, + "label": "Solidity by example", + "link": { + "title": "Solidity by example", + "slug": "solidity-by-example", + "type": "generated-index" + } +} diff --git a/src/solidity-by-example/application/_category_.json b/src/solidity-by-example/application/_category_.json new file mode 100644 index 000000000..adcb325b0 --- /dev/null +++ b/src/solidity-by-example/application/_category_.json @@ -0,0 +1,9 @@ +{ + "position": 2, + "label": "Application", + "link": { + "title": "Application", + "slug": "application", + "type": "generated-index" + } +} diff --git a/src/solidity-by-example/basic/_category_.json b/src/solidity-by-example/basic/_category_.json new file mode 100644 index 000000000..eece57d19 --- /dev/null +++ b/src/solidity-by-example/basic/_category_.json @@ -0,0 +1,8 @@ +{ + "position": 0, + "label": "Basic", + "link": { + "slug": "solidity-by-example/basic", + "type": "generated-index" + } +} diff --git a/src/solidity-by-example/basic/first-app.md b/src/solidity-by-example/basic/first-app.md new file mode 100644 index 000000000..cb0333ab0 --- /dev/null +++ b/src/solidity-by-example/basic/first-app.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 2 +title: First Application +description: Specifies the compiler version of Solidity +--- + +Here is a simple contract that you can get, increment and decrement the count store in this contract. + +```solidity +// SPDX-License-Identifier: MIT +pragma ever-solidity ^0.70.0; + +contract Counter { + uint public count; + + // Function to increment count by 1 + function inc() public { + // This action is required to process external messages that bring no value + tvm.accept(); + count += 1; + } + + // Function to decrement count by 1 + function dec() public { + // This action is required to process external messages that bring no value + tvm.accept(); + // This function will fail if count = 0 + count -= 1; + } +} +``` + +## Deploying the contract + +```shell +npx everdev sol compile first-app.sol +npx everdev contract deploy first-app -v 100000000 +``` + +## Interacting with the contract + +```shell +npx everdev contract run first-app inc +npx everdev contract run-local first-app count +npx everdev contract run first-app dec +npx everdev contract run-local first-app count +``` diff --git a/src/solidity-by-example/basic/hello-world.md b/src/solidity-by-example/basic/hello-world.md new file mode 100644 index 000000000..1030fef19 --- /dev/null +++ b/src/solidity-by-example/basic/hello-world.md @@ -0,0 +1,32 @@ +--- +sidebar_position: 1 +title: "Hello World" +description: Specifies the compiler version of Solidity +--- + +`pragma` specifies the compiler version of Solidity. + + +```solidity +// SPDX-License-Identifier: MIT +// compiler version must be greater than or equal to 0.70.0 and less than 0.71.0 +pragma ever-solidity ^0.70.0; + +contract HelloWorld { + string public greet = "Hello World!"; +} +``` + +## Deploying the contract + +```shell +npx everdev sol set --compiler 0.70.0 +npx everdev sol compile hello-world.sol +npx everdev contract deploy hello-world -v 100000000 +``` + +## Interacting with the contract + +```shell +npx everdev contract run-local hello-world greet +``` diff --git a/src/solidity-by-example/hack/_category_.json b/src/solidity-by-example/hack/_category_.json new file mode 100644 index 000000000..ba2b78b95 --- /dev/null +++ b/src/solidity-by-example/hack/_category_.json @@ -0,0 +1,9 @@ +{ + "position": 3, + "label": "Hack", + "link": { + "title": "Hack", + "slug": "hack", + "type": "generated-index" + } +}