From be1a71ebc7fd7bdcb05c25a9c2075d6dfb4e5677 Mon Sep 17 00:00:00 2001 From: ipopescu Date: Mon, 22 Jan 2024 13:35:50 +0100 Subject: [PATCH 1/4] Clarification regarding token transfers --- .../casper/resources/advanced/transfer-token-to-contract.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/docs/casper/resources/advanced/transfer-token-to-contract.md b/source/docs/casper/resources/advanced/transfer-token-to-contract.md index b6ab7b897c..cf41a71b61 100644 --- a/source/docs/casper/resources/advanced/transfer-token-to-contract.md +++ b/source/docs/casper/resources/advanced/transfer-token-to-contract.md @@ -7,6 +7,8 @@ slug: /resources/tutorials/advanced/transfer-token-to-contract This tutorial covers two methods to handle tokens via a contract. This is not a native process to a Casper network and will require the use of custom code. The following two scenarios provide a framework for developers and the pros and cons of each example. Developers should choose the option that best suits their individual needs. +For increased security, `transfer-*` methods are unavailable in stored session code, even when the stored session code runs in the account context. The tokens must be handled via contract code, as shown below. + ## Scenario 1 - Creating a Throw-Away Purse {#scenario1} The first scenario involves the use of a single-use, throw-away purse. The caller creates and funds a purse independent of their main purse, before passing the URef to the callee. From 132d8df68833eac03ecf96806dd68ba9c924aba6 Mon Sep 17 00:00:00 2001 From: ipopescu Date: Mon, 22 Jan 2024 13:39:55 +0100 Subject: [PATCH 2/4] Minor edit --- .../casper/resources/advanced/transfer-token-to-contract.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/docs/casper/resources/advanced/transfer-token-to-contract.md b/source/docs/casper/resources/advanced/transfer-token-to-contract.md index cf41a71b61..fb386c11a8 100644 --- a/source/docs/casper/resources/advanced/transfer-token-to-contract.md +++ b/source/docs/casper/resources/advanced/transfer-token-to-contract.md @@ -7,7 +7,7 @@ slug: /resources/tutorials/advanced/transfer-token-to-contract This tutorial covers two methods to handle tokens via a contract. This is not a native process to a Casper network and will require the use of custom code. The following two scenarios provide a framework for developers and the pros and cons of each example. Developers should choose the option that best suits their individual needs. -For increased security, `transfer-*` methods are unavailable in stored session code, even when the stored session code runs in the account context. The tokens must be handled via contract code, as shown below. +For increased security, token transfers must be handled via contract code, not session code. As a result, `transfer-*` methods are unavailable in stored session code, even when the stored session runs in the account context. ## Scenario 1 - Creating a Throw-Away Purse {#scenario1} From 1e77910ff00f506fe1449b0bcd9e32658ffede02 Mon Sep 17 00:00:00 2001 From: ipopescu Date: Mon, 22 Jan 2024 22:05:34 +0100 Subject: [PATCH 3/4] Added clarification --- .../casper/resources/advanced/transfer-token-to-contract.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/docs/casper/resources/advanced/transfer-token-to-contract.md b/source/docs/casper/resources/advanced/transfer-token-to-contract.md index fb386c11a8..29ba284b71 100644 --- a/source/docs/casper/resources/advanced/transfer-token-to-contract.md +++ b/source/docs/casper/resources/advanced/transfer-token-to-contract.md @@ -7,7 +7,7 @@ slug: /resources/tutorials/advanced/transfer-token-to-contract This tutorial covers two methods to handle tokens via a contract. This is not a native process to a Casper network and will require the use of custom code. The following two scenarios provide a framework for developers and the pros and cons of each example. Developers should choose the option that best suits their individual needs. -For increased security, token transfers must be handled via contract code, not session code. As a result, `transfer-*` methods are unavailable in stored session code, even when the stored session runs in the account context. +For increased security, token transfers from a main purse must be handled via contract code, not session code as in [other cases](../../developers/writing-onchain-code/writing-session-code.md#example-3-transfers-using-session-code-transfers-using-session-code). In this case, `transfer-*` methods are unavailable in stored session code, even when the stored session runs in the account context. ## Scenario 1 - Creating a Throw-Away Purse {#scenario1} From 76bd4e338139e1a96faf64238adc80faf9c5a8cf Mon Sep 17 00:00:00 2001 From: ipopescu Date: Wed, 24 Jan 2024 16:04:40 +0100 Subject: [PATCH 4/4] Changing the wording based on feedback --- .../casper/resources/advanced/transfer-token-to-contract.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/docs/casper/resources/advanced/transfer-token-to-contract.md b/source/docs/casper/resources/advanced/transfer-token-to-contract.md index 29ba284b71..95b15831b3 100644 --- a/source/docs/casper/resources/advanced/transfer-token-to-contract.md +++ b/source/docs/casper/resources/advanced/transfer-token-to-contract.md @@ -7,7 +7,7 @@ slug: /resources/tutorials/advanced/transfer-token-to-contract This tutorial covers two methods to handle tokens via a contract. This is not a native process to a Casper network and will require the use of custom code. The following two scenarios provide a framework for developers and the pros and cons of each example. Developers should choose the option that best suits their individual needs. -For increased security, token transfers from a main purse must be handled via contract code, not session code as in [other cases](../../developers/writing-onchain-code/writing-session-code.md#example-3-transfers-using-session-code-transfers-using-session-code). In this case, `transfer-*` methods are unavailable in stored session code, even when the stored session runs in the account context. +For increased security, token transfers from a main purse must be handled via session code (WASM), as shown [here](../../developers/writing-onchain-code/writing-session-code.md#example-3-transfers-using-session-code-transfers-using-session-code). Therefore, `transfer-*` methods are unavailable in stored WASM for tokens originating from an account's main purse, even when the stored WASM runs in the account context. ## Scenario 1 - Creating a Throw-Away Purse {#scenario1}