Skip to content

Commit

Permalink
deploy: 22f10db
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e committed Oct 9, 2023
1 parent c4f8472 commit c2f8462
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 16 deletions.
5 changes: 4 additions & 1 deletion master/calling-contracts/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ <h1 id="logs"><a class="header" href="#logs">Logs</a></h1>
<pre><code class="language-rust ignore"> fn produce_logs_variables() {
let f: u64 = 64;
let u: b256 = 0xef86afa9696cf0dc6385e2c407a6e159a1103cefb7e2ae0636fb33d3cb2a9e4a;
let e: str[4] = &quot;Fuel&quot;;
let e: str[4] = __to_str_array(&quot;Fuel&quot;);
let l: [u8; 3] = [1u8, 2u8, 3u8];

log(f);
Expand Down Expand Up @@ -177,6 +177,9 @@ <h1 id="logs"><a class="header" href="#logs">Logs</a></h1>
let logs = response.decode_logs();
</code></pre>
<p>Due to possible performance hits, it is not recommended to use <code>decode_logs()</code> outside of a debugging scenario.</p>
<blockquote>
<p><strong>Note:</strong> String slices can not be logged directly. Use the <code>__to_str_array()</code> function to convert it to a <code>str[N]</code> first.</p>
</blockquote>

</main>

Expand Down
2 changes: 1 addition & 1 deletion master/calling-contracts/variable-outputs.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h1 id="output-variables"><a class="header" href="#output-variables">Output vari
</code></pre>
<p>When calling <code>transfer_coins_to_output</code> with the SDK, you can specify the number of variable outputs by chaining <code>append_variable_outputs(amount)</code> to your call. Like this:</p>
<pre><code class="language-rust ignore"> let address = wallet.address();
let asset_id = contract_id.asset_id(&amp;Bits256::zeroed()).into();
let asset_id = contract_id.asset_id(&amp;Bits256::zeroed());

// withdraw some tokens to wallet
let response = contract_methods
Expand Down
2 changes: 1 addition & 1 deletion master/cookbook/deposit-and-withdraw.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h1 id="deposit-and-withdraw"><a class="header" href="#deposit-and-withdraw">Dep
fn withdraw(recipient: Address);
}

const BASE_TOKEN: b256 = 0x9ae5b658754e096e4d681c548daf46354495a437cc61492599e33fc64dcdc30c;
const BASE_TOKEN: AssetId = AssetId::from(0x9ae5b658754e096e4d681c548daf46354495a437cc61492599e33fc64dcdc30c);

impl LiquidityPool for Contract {
#[payable]
Expand Down
2 changes: 1 addition & 1 deletion master/deploying/configurable-constants.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h1 id="configurable-constants"><a class="header" href="#configurable-constants"
U8: u8 = 8u8,
BOOL: bool = true,
ARRAY: [u32; 3] = [253u32, 254u32, 255u32],
STR_4: str[4] = &quot;fuel&quot;,
STR_4: str[4] = __to_str_array(&quot;fuel&quot;),
STRUCT: StructWithGeneric&lt;u8&gt; = StructWithGeneric {
field_1: 8u8,
field_2: 16,
Expand Down
17 changes: 10 additions & 7 deletions master/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ <h2 id="deploying-a-contract-binary"><a class="header" href="#deploying-a-contra
U8: u8 = 8u8,
BOOL: bool = true,
ARRAY: [u32; 3] = [253u32, 254u32, 255u32],
STR_4: str[4] = &quot;fuel&quot;,
STR_4: str[4] = __to_str_array(&quot;fuel&quot;),
STRUCT: StructWithGeneric&lt;u8&gt; = StructWithGeneric {
field_1: 8u8,
field_2: 16,
Expand Down Expand Up @@ -1877,7 +1877,7 @@ <h2 id="error-handling"><a class="header" href="#error-handling">Error handling<
<pre><code class="language-rust ignore"> fn produce_logs_variables() {
let f: u64 = 64;
let u: b256 = 0xef86afa9696cf0dc6385e2c407a6e159a1103cefb7e2ae0636fb33d3cb2a9e4a;
let e: str[4] = &quot;Fuel&quot;;
let e: str[4] = __to_str_array(&quot;Fuel&quot;);
let l: [u8; 3] = [1u8, 2u8, 3u8];

log(f);
Expand Down Expand Up @@ -1911,6 +1911,9 @@ <h2 id="error-handling"><a class="header" href="#error-handling">Error handling<
let logs = response.decode_logs();
</code></pre>
<p>Due to possible performance hits, it is not recommended to use <code>decode_logs()</code> outside of a debugging scenario.</p>
<blockquote>
<p><strong>Note:</strong> String slices can not be logged directly. Use the <code>__to_str_array()</code> function to convert it to a <code>str[N]</code> first.</p>
</blockquote>
<div style="break-before: page; page-break-before: always;"></div><h1 id="output-variables"><a class="header" href="#output-variables">Output variables</a></h1>
<!-- This section should explain variable outputs -->
<!-- variable_outputs:example:start -->
Expand All @@ -1923,7 +1926,7 @@ <h2 id="error-handling"><a class="header" href="#error-handling">Error handling<
</code></pre>
<p>When calling <code>transfer_coins_to_output</code> with the SDK, you can specify the number of variable outputs by chaining <code>append_variable_outputs(amount)</code> to your call. Like this:</p>
<pre><code class="language-rust ignore"> let address = wallet.address();
let asset_id = contract_id.asset_id(&amp;Bits256::zeroed()).into();
let asset_id = contract_id.asset_id(&amp;Bits256::zeroed());

// withdraw some tokens to wallet
let response = contract_methods
Expand Down Expand Up @@ -2187,14 +2190,14 @@ <h2 id="logs-1"><a class="header" href="#logs-1">Logs</a></h2>
<h2 id="calling-contracts-from-scripts"><a class="header" href="#calling-contracts-from-scripts">Calling contracts from scripts</a></h2>
<p>Scripts use the same interfaces for setting external contracts as <a href="./calling-contracts/other-contracts.html">contract methods</a>.</p>
<p>Below is an example that uses <code>with_contracts(&amp;[&amp;contract_instance, ...])</code>.</p>
<pre><code class="language-rust ignore"> let response = instance
<pre><code class="language-rust ignore"> let response = script_instance
.main(contract_id)
.with_contracts(&amp;[&amp;contract_instance])
.call()
.await?;
</code></pre>
<p>And this is an example that uses <code>with_contract_ids(&amp;[&amp;contract_id, ...])</code>.</p>
<pre><code class="language-rust ignore"> let response = instance
<pre><code class="language-rust ignore"> let response = script_instance
.main(contract_id)
.with_contract_ids(&amp;[contract_id.into()])
.call()
Expand All @@ -2220,7 +2223,7 @@ <h2 id="configurable-constants-1"><a class="header" href="#configurable-constant
U8: u8 = 8u8,
BOOL: bool = true,
ARRAY: [u32; 3] = [253u32, 254u32, 255u32],
STR_4: str[4] = &quot;fuel&quot;,
STR_4: str[4] = __to_str_array(&quot;fuel&quot;),
STRUCT: StructWithGeneric&lt;u8&gt; = StructWithGeneric {
field_1: 8u8,
field_2: 16,
Expand Down Expand Up @@ -3345,7 +3348,7 @@ <h2 id="loadscript"><a class="header" href="#loadscript">LoadScript</a></h2>
fn withdraw(recipient: Address);
}

const BASE_TOKEN: b256 = 0x9ae5b658754e096e4d681c548daf46354495a437cc61492599e33fc64dcdc30c;
const BASE_TOKEN: AssetId = AssetId::from(0x9ae5b658754e096e4d681c548daf46354495a437cc61492599e33fc64dcdc30c);

impl LiquidityPool for Contract {
#[payable]
Expand Down
6 changes: 3 additions & 3 deletions master/running-scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ <h2 id="logs"><a class="header" href="#logs">Logs</a></h2>
<h2 id="calling-contracts-from-scripts"><a class="header" href="#calling-contracts-from-scripts">Calling contracts from scripts</a></h2>
<p>Scripts use the same interfaces for setting external contracts as <a href="./calling-contracts/other-contracts.html">contract methods</a>.</p>
<p>Below is an example that uses <code>with_contracts(&amp;[&amp;contract_instance, ...])</code>.</p>
<pre><code class="language-rust ignore"> let response = instance
<pre><code class="language-rust ignore"> let response = script_instance
.main(contract_id)
.with_contracts(&amp;[&amp;contract_instance])
.call()
.await?;
</code></pre>
<p>And this is an example that uses <code>with_contract_ids(&amp;[&amp;contract_id, ...])</code>.</p>
<pre><code class="language-rust ignore"> let response = instance
<pre><code class="language-rust ignore"> let response = script_instance
.main(contract_id)
.with_contract_ids(&amp;[contract_id.into()])
.call()
Expand All @@ -226,7 +226,7 @@ <h2 id="configurable-constants"><a class="header" href="#configurable-constants"
U8: u8 = 8u8,
BOOL: bool = true,
ARRAY: [u32; 3] = [253u32, 254u32, 255u32],
STR_4: str[4] = &quot;fuel&quot;,
STR_4: str[4] = __to_str_array(&quot;fuel&quot;),
STRUCT: StructWithGeneric&lt;u8&gt; = StructWithGeneric {
field_1: 8u8,
field_2: 16,
Expand Down
2 changes: 1 addition & 1 deletion master/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion master/searchindex.json

Large diffs are not rendered by default.

0 comments on commit c2f8462

Please sign in to comment.